I understand how projections work -- especially in V2 where I use my own projections for certain types of maps.
Thank you for point out the implementation of MercatorProjection. However, the fact that someone (probably a google employee) couldn't figure out how to get the current projection in a sane way only reinforces my view that there is *no sane way* to get the current projection of the underlying map when you are coding a MapType which is added as an overlay. The documentation indicates that the projection is given to you, but it doesn't actually work. Bugs happen. As I am sure that you are aware, without knowledge of the actual projection, you can't do the mapping from tile coordinates to lat lng. Philip On Feb 16, 5:49 pm, Marcelo <[email protected]> wrote: > On Feb 16, 8:45 pm, Philip <[email protected]> wrote: > > > The background is that I'm writing a custom map type that can be > > overlayed on an existing map type. However, I need to convert the tile > > coordinates into lat/lng. This needs a MapCanvasProjection object, but > > they are hard to come by. > > There's a good explanation of how conversions work in V3 > here:http://code.google.com/apis/maps/documentation/v3/overlays.html#Custo... > > This example contains a MercatorProjection > object:http://code.google.com/apis/maps/documentation/v3/examples/map-coordi... > > -- > Marcelo -http://maps.forum.nu > -- > > > > > The documentation on MapType is pretty limited. I need the current > > projection (to convert tile coords back into latlng). This is listed > > as a property of the MapType, but it certainly isn't being set (by the > > time that the first getTile method is called). [Also, I note that the > > type of projection property is probably wrong in the documentation > > as well]. So I thought I would just grab the projection from the > > current map type being displayed. However the mapTypes on the main map > > is a MapTypeRegistry and even though the getter method is probably > > 'get', I can't figure out the argument to get the current (or any) > > MapType. In particular, map.mapTypes.get(map.getMapTypeId()) returns > > null. > > > Philip > > -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" 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-js-api-v3?hl=en.
