I'm trying to create a custom tile overlay for my google map application. I'm using Python on my server to create the map tile images. I found a neat little python script called globalmaptiles.py which appears to be pretty popular. Unfortunately, the documentation of the script is very scant, at least for me, someone who is not an expert at these kinds of things.
Through trial and error, I finally figured out how to go from google map tile blocks to lat/long bounds. For anyone finding this post through a google search looking for how to do this, look no further; this is how: ------------------ from globalmaptiles import GlobalMercator gmt = GlobalMercator() #convert google XY image blocks to some other kind (???) of image block format x,y = gmt.GoogleTile(int(x), int(y), int(zoom)) #convert this other image block format into lattitude/longitude bound values W, N, E, S = gmt.TileLatLonBounds(int(x), int(y), int(zoom)) #create the bounds envelope (Envelope is a geodjango object) bounds = Envelope((N, W, S, E, )) #geodjango code to get all points within the bounds of the bases = Base.objects.filter(location__intersects=bounds.wkt) ----------------- Now all I need to do is figure out how to go from lat/long coordinates of the "bases" to x/y pixel coordinates, so I know where to add the marker icons. Instead of going through that whole trial and error process all over again, could someone please be so kind as to just tell me how to do it? By the way, the source code for globalmaptiles.py can be found here: http://www.maptiler.org/google-maps-coordinates-tile-bounds-projection/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Maps API" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Maps-API?hl=en -~----------~----~----~----~------~----~------~--~---
