[OpenLayers-Users] FW: Google & Vector layer

Christopher Schmidt crschmidt at metacarta.com
Thu Oct 11 08:07:37 EDT 2007


On Thu, Oct 11, 2007 at 08:07:26AM +0100, Shaw, Richard A wrote:
> 
> > How do I get my vector layer which is in WGS84 to overlay properly on google maps ?
> > 
> > I've downloaded and integrated GoogleMercator layer and can see that the world tiles overlay correctly as per the example but the following don't work -
> > 
> > Set the extents in WGS84
> > Getting a co-ordinate of the click point in WGS84
> > Overlaying my information as a vector defined in WGS84
> > 
> > What am I missing ?

All your overlay layers must be the same projection as your base layer
-- Google, Yahoo, etc. use the projection that has been referred to as
EPSG:900913. When using SphericalMercator option on the layers, they
have two additional functions: forwardMercator(lon,lat), which returns
an x, y and inverseMercator(x,y) which returns a lon,lat.   

Using these, it is possible to forward or reverse the projection to get
the coordinates you are interested in.

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list