Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed broken default map, and a bug where map tiles near the Internat…

…ional Date Line were getting requested with a Longitude of -182.109375 by Google, which was causing my geomodel provider to fail.
  • Loading branch information...
commit 9a970c8f73c98e23522a150e96fc91fdeaaff4df 1 parent 0ea7f76
@lehrblogger authored
Showing with 5 additions and 1 deletion.
  1. +4 −0 gheatae/provider.py
  2. +1 −1  handlers.py
View
4 gheatae/provider.py
@@ -17,6 +17,10 @@ def get_user_data(self, user=None, lat_north=90, lng_west=-180, range_lat=-180,
# log.info("GeoRange: (%6.4f, %6.4f) ZoomStep: (%6.4f, %6.4f)" % (lat_north, lng_west, range_lat, range_lng))
# log.info("Range: (%6.4f - %6.4f), (%6.4f - %6.4f)" % (min(90, max(-90, lat_north + range_lat)), lat_north, min(180, max(-180, lng_west + range_lng)), lng_west))
if user:
+ # not sure why Google was giving latitudes outside of the allowable range near the International Date Line at zoom level 3,
+ # but cap it to the max anyway here. this might result in incorrectly drawn tiles near there, but oh well.
+ if lng_west < -180:
+ lng_west = -180
return UserVenue.bounding_box_fetch(UserVenue.all().filter('user =', user).order('-last_checkin_at'), #TODO find a way to specify this elsewhere!!
geotypes.Box(min(90, max(-90, lat_north + range_lat)),
min(180, max(-180, lng_west + range_lng)),
View
2  handlers.py
@@ -47,7 +47,7 @@ def get(self):
'height': constants.default_dimension,
'domain': environ['HTTP_HOST'],
'static_url': 'http://maps.google.com/maps/api/staticmap?center=40.7427050566%2C-73.9888000488&format=png&zoom=13&key=ABQIAAAAwA6oEsCLgzz6I150wm3ELBQO7aMTgd18mR6eRdj9blrVCeGU7BS14EnkGH_2LpNpZ8DJW0u7G5ocLQ&sensor=false&size=640x640',
- 'mapimage_url': 'map/%s.png' % 'ag93aGVyZS1kby15b3UtZ29yEAsSCE1hcEltYWdlGM2LRgw',
+ 'mapimage_url': 'map/%s.png' % 'ag93aGVyZS1kby15b3UtZ29yEQsSCE1hcEltYWdlGNL0_wIM',
}
user = users.get_current_user()
if user:
Please sign in to comment.
Something went wrong with that request. Please try again.