[OpenLayers-Users] Overlays with google maps

Christopher Schmidt crschmidt at metacarta.com
Mon Mar 12 09:06:07 EDT 2007


On Mon, Mar 12, 2007 at 11:48:55AM +0000, Jon Blower wrote:
> Hi Chris,
> 
> I'm afraid still haven't quite understood how OL can be used to
> overlay layers (e.g. WMS) on top of Google Maps images (also, the
> example page http://www.openlayers.org/dev/examples/google.html
> doesn't work for me in Firefox 1.5: it comes up with an error "'$' is
> not defined" in line 25 of google.html).
> 
> In this post you said "For Google (for reasons I don't really
> understand) this is non-deterministic: If you set a different center,
> the tiles draw differently."  

This is an OpenLayers problem, not a Google problem.  

> I don't understand what this means.
> Google Maps are in a straight Mercator projection (not modified in any
> way, as far as I can tell) so I can't see what's non-deterministic
> about it.  Also, I don't understand how simply stretching the tiles on
> the client will work - Mercator projection is not a linear stretch of
> a lat-lon (Plate Carree) projection.

Correct. Stretching is a workaround, not a fix. Beyond a certain level
-- about zoom level 4-5 on the Google scale -- the workaround starts to
get pretty ugly. 

OpenLayers doesn't support reprojection. I believe that Bill Woodall has
put together some code to change that -- setting up a Mercator subclass
of WMS or some such, which does reprojection. I don't know where his
code is: I can't find a patch at the moment. 

However, from a "does OpenLayers do this" perspective, the answer at the
moment is 'no'. Google is not as well supported as it should be, and as
a result, there are a number of issues with laying WMS over the top of
it. 

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list