0
votes

I have written a tile image generator for use with overlay.getTileUrl(tileCoord,zoom) that works as expected for map type Road_Map for zoom levels to 21

function tile2lng(x,z) { return (x/Math.pow(2,z)*360-180); }
function tile2lat(y,z) { var n=Math.PI-2*Math.PI*y/Math.pow(2,z);
return (180/Math.PI*Math.atan(0.5*(Math.exp(n)-Math.exp(-n)))); }

at lat/lng 37.21 / -77.26

When the Satellite map is zoomed to level 18 the tile coordinates for the requested overlay tile calculate to lat/lng 27.37 / -77.26

Actually, there seem to be two passes at loading the map. First tile lat/lng is requested correctly, then a Projection_Changed event occurs, and then tiles are re-requested with lat/lng calculated incorrectly. It seems the projection for Satellite tiles displayed at map zoom 18 to 21 is not the standard Google mercator projection. How should this change be detected by overlay.getTileURL(coord,zoom) ?

What is the proper way to calculate lat/lng for Satellite tiles when map zoomed 18 to 21 ?

1
The projection for zoom 18 is no diffrerent from other zoom levels.What overlay type are you using? (I guess it'a an ImageMapType ). If so, your getTileUrl function should accept (Point: (x:number, y:number)) as parameters and return a URL as a string pointing to the custom tile. Please post your complete getTileUrl() function.Marcelo
Please see example at [link]vafwis.org/fwis/GoogleMaps/testLatLngZoom.html which begins at zoom 17. Zoom to 18 and tile coord to lat/lng gives the wrong positionuser2015986

1 Answers

0
votes

And the answer is: at this time, there are no exposed projection parameters.

What I really needed:

map.setTilt(0);

I did not realize Google Maps automatically rendered satelite zoom 18 and higher with tilt set at 45 which changes the standard base map projection.

Happy days!