if not mapimage:
      mapimage              = MapImage()
      mapimage.user         = user
      mapimage.update_count = 0
    mapimage.centerlat  = float(centerlat)
    mapimage.centerlng  = float(centerlng)
    mapimage.northlat   = float(northlat)
    mapimage.westlng    = float(westlng)
    mapimage.zoom       = int(zoom)
    mapimage.height     = int(height)
    mapimage.width      = int(width)
    img = update_map_image(user, int(zoom), int(width), int(height), float(northlat), float(westlng))
    mapimage.img          = db.Blob(img)
    mapimage.last_updated = datetime.now()
    mapimage.static_url = "http://maps.google.com/maps/api/staticmap?" + urllib.urlencode(google_data)
    mapimage.put()
  except DeadlineExceededError, err:    
    logging.error("Ran out of time before creating a map! %s" % err)

def update_map_file(): # really there should be a flag in the user object to indicate the map needs updating, but for that to be reliable that needs to put with each new checkin, so these need to have the user as the parent so the transaction works, and that's just a nightmare.
  mapimages = MapImage.all().order('last_updated').fetch(10)
  for mapimage in mapimages:
    if not mapimage.update_count:
      mapimage.update_count = 0
      mapimage.put()
    userinfo = UserInfo.all().filter('user = '******'s no userinfo
      mapimage.put()