http://code.google.com/apis/maps/documentation/javascript/maptypes.html#WorldCoordinates
Check out the World Coordinates and Pixel Coordinates sections. pixelCoordinate = worldCoordinate * (2 to the power of zoomLevel) So you want to convert your tile coordinates into two pixel coordinates, pixel (x,y) for both sw corner and ne corner. Now convert those pixel coordinates to world coordinates: world coordinates = pixel coordinates / (2 to the power of zoom level) (I think that's right!?) And finally convert world coordinates to (lat, lng) using the map projection's fromPointToLatLng() method: http://code.google.com/apis/maps/documentation/javascript/reference.html#Projection "This interface specifies a function which implements translation from world coordinates on a map projection to LatLng values. The Maps API calls this method when it needs to translate actions on screen to positions on the map. Projection objects must implement this method." Note: If map.getProjection() returns undefined then you're trying to access the projection before the map has fully initialised. A solution is: google.maps.event.addListenerOnce(map, 'projection_changed', function() { // the map's projection object can now be used var projection=map.getProjection() ; }); Martin. On Dec 6, 1:23 pm, spiderplant0 <[email protected]> wrote: > I'll clarify the question. > I need to convert tile coords plus zoom into lat/lng. > I can easily convert tile coords plus zoom into and world coordinates > as the maths is simple. > However what is not trivial is the conversion between world > coordinates and lat/lng. > Does google maps include a function to do this? -- 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.
