[OpenLayers-Users] Overlays with google maps

Christopher Schmidt crschmidt at metacarta.com
Fri Feb 16 17:20:53 EST 2007


On Fri, Feb 16, 2007 at 05:02:03PM -0500, Stephen Woodbridge wrote:
> Hi all,
> 
> We have been using OL with a ka-map tile-cache and are starting to work 
> with google layers also. We generate route overlay images using s 
> separate perl script. This script assumes a geographic projection (ie: 
> lat-long) which is what out ka-map tiles are based on. We get perfect 
> registration of the route with the ka-map tiles, but it is off for the 
> google layer.
> 
> What to I need to do to make the route align better with the google layers?

There is currently no way to use pre-cached tiles with Google Maps.
Google uses a projection that is close to a simple mercator projection
(+proj=merc), but the interactions through the API are all in decimal
degrees. OpenLayers does not do reprojection on the client-side, so it
does not speak to WMS in mercator while maintaining an internal concept
of Google as being decimal-degrees based.

The WMS layer will automatically reproject, when using overlays, asking
Google for the geographic location of tile corners, and then
'stretching' the WMS request to match. (You can see this on the
google.html in the examples.) However, there is no way to do this with
pre-cached tiles, because Google will give different answers for tile
locations depending on the center position of the map, so tile
boundaries will not match.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list