[OpenLayers-Users] Hide and show layer results in wrongprojection

Christopher Schmidt crschmidt at metacarta.com
Mon Sep 28 10:06:20 EDT 2009


On Mon, Sep 28, 2009 at 03:56:23PM +0200, Jelmer Baas wrote:
> Christopher,
> 
> Thank you for your (very) quick response. The link you gave does give me
> something to read. 
> But it still doesn't explain why it works the first time, but not
> afterwards, does it? (Also, tiled mode doesn't work at all)

Single tile layers essentially default to 'reproject': true for the initial
load, but are not set that way for tile updates (which go through the same 
code path as tiled WMS layers; only the 'init' is different). The behavior that
your'e seeing on the initial load is essentially what I expect you would see
both before and after the load if you switched 'reproject' to 'on'.

-- Chris 

> Regards,
> Jelmer
> 
> > On Mon, Sep 28, 2009 at 03:49:02PM +0200, Jelmer Baas wrote:
> > > Hello List,
> > > 
> > > I've been fiddling with OpenLayers for a bit now, and I'm 
> > very impressed
> > > with the results. The one big problem I keep having though, 
> > is related
> > > to (re)projection of my layers.
> > > 
> > > With two of my own layers in WGS84, I have no trouble. But 
> > now I try to
> > > use Google Maps as a background layer, and everything goes wrong. My
> > > country (The Netherlands) is a big wide blob all of the sudden.
> > 
> > In order to correctly overlay raster imagery on Google Maps, you must
> > use Spherical Mercator: 
> >   http://docs.openlayers.org/library/spherical_mercator.html
> > 
> > If you wish to approximate projecting correctly, you can set the
> > 'reproject':true option on your WMS layer, but in order to use 
> > vector layers over Google Maps, you will need to use 
> > spherical mercator
> > anyway, so it might be best to just switch.
> > 
> > -- Chris
> > 
> > > The odd thing is that I somehow managed to fix this.... 
> > Until I hide and
> > > show the layer again. Then it's back to it's wrong state.
> > > 
> > > Can anyone shed some light on this? Or tell me what I'm doing wrong?
> > > 
> > > My test page is at http://www.cocontheweb.nl/_ftth/ and 
> > should display
> > > the Google layer with a yellow layer on top. Here you can also
> > > enable/disable the layer to see the result.
> > > 
> > > The map file (MapServer) has a "wms_srs" "EPSG:4326" tag, with each
> > > layer having "wms_srs" "EPSG:28992 EPSG:4326". 
> > > 
> > > Any help would be greatly appreciated,
> > > 
> > > Regards,
> > > Jelmer Baas
> > > _______________________________________________
> > > Users mailing list
> > > Users at openlayers.org
> > > http://openlayers.org/mailman/listinfo/users
> > 
> > -- 
> > Christopher Schmidt
> > MetaCarta
> > 

-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list