[OpenLayers-Users] Unable to use both OpenLayers.Layer.Google and OpenLayers.Layer.TMS

Nick Burch nick at torchbox.com
Mon Jun 4 10:45:41 EDT 2007


Hi

I'm trying to use OpenLayers to display google maps, with various overlays 
drawn on top of it.

I've configured mapnik to render my overlays in a google-link mercator 
projection, and that's all working fine. If I configure OpenLayers to just 
display my overlays, as a TMS layer with a custom getURL function, it all 
works great. (I even had Artem check all of this, since he happened to be 
nearby, and he confirms it's all setup properly)


The problem comes when I try to set a OpenLayers.Layer.Google as my base layer, 
with the OpenLayers.Layer.TMS as a non base layer overlay.

In this situation, the google layer alters the bounds and resolution, and 
wants the centre in long+lat, not mercator meters. The result is that my 
TMS layer tile url code ends up generating garbage x and y values (because 
the resolution and bounds are all wrong, as is the centre), so the overlay 
doesn't work.

(If I replace the Google layer with a TMS layer that requests google tiles, it 
all works fine.)


Does anyone know why loading a google layer trashes all the settings for the 
TMS layers, and what the workaround is for displaying a TMS mercator layer on 
top of google maps?

Thanks
Nick



More information about the Users mailing list