[OpenLayers-Users] WMS Layer not supporting SRS parameters

Christopher Schmidt crschmidt at metacarta.com
Mon Mar 31 00:12:40 EDT 2008


On Sun, Mar 30, 2008 at 08:25:16PM -0700, ITBeyond wrote:
> 
> Thanks Chris,
> 
> So if I am adding google maps and other maps using different projections and
> then adding multiple WMS layers which may be in different projections how
> does this work? 

Raster layers in OpenLayers must be in one projection and one projection
only. This includes Google Maps layers. If you want to lay down on top
of Google Maps, you'll need to use Spherical Mercator (ESRI calls it
"Web Mercator") for all of the raster layers that you are using.

So I think the answer to your question is "It doesn't."

It would be possible to create several different baselayers in different
projections, and then have differently projected overlays for each of
them, but that's somewhat complex, and OpenLayers definitely doesn't
make it trivial. 

> My issue seems to only occur when I use isBaseLayer = false
> (hence trying to output the WMS layer on top of a google or custom map). As
> the OL code seems to ignore the projection parameter when isBaselayer =
> false it defaults it to 4326 (which is not listed anyway in my code). 

4326 is the default projection of any OpenLayers map. 

The BaseLayer of the map is the source of the projection information:
so, when you have all your layers as baselayers, openlayers will use the
projection of each one as the projection of your map. You could take
advantage of this and have a seperate set of overlays in the specified
projection for each map (or, if all your overlays supported all the
projections that your base maps had, this might 'just work'), but
really, OpenLayers is only designed to have rasters in one projection in
one map.

> If I check the isBaselayer = true the URL has my projection in it. So
> in a nut shell changing the isBaseLayer value seems to use or ignore
> the projection parameter in my WMS layer is this correct?

Sort of.  The BaseLayer controls the projection of the map. When the
baselayer changes, the projection changes. 

Regards,
-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list