[OpenLayers-Users] WMS SRS:EPSG4326 with OpenLayers doesn´t work

Christopher Schmidt crschmidt at metacarta.com
Wed Oct 7 07:43:07 EDT 2009


On Wed, Oct 07, 2009 at 09:58:01AM +0200, Andreas Hocevar wrote:
> Bytechanger wrote:
> > I want add a baselayer from WMS in EPSG 4326
> > but this doesn´t work!
> >
> > 1.
> >    map=new OpenLayers.Map('map', { projection: new
> > OpenLayers.Projection("EPSG:4326"), ...);

You missed filling in the '...' here, which actually has the relevant
information, most likely.

-- CHris

> 
> Ok, although EPSG:4326 is the default so you do not need to set it.
> 
> > 2. var TestLayer= new OpenLayers.Layer.WMS("Test", "http://www.geo
> > ....?", { REQUEST: 'getMap', SRS:'EPSG:4326' ...},{isBaseLayer:true});
> >   
> 
> Don't add REQUEST and SRS params -- OpenLayers will do that for you. But
> make sure to add a LAYERS param.
> 
> > map.addLayer(TestLayer);
> >
> > But I don´t see anything !! No mapdata....
> >   
> 
> You have to zoom to an extent first to see something:
> 
> map.zoomToMaxExtent();
> 
> Also look at one of the examples (e.g.
> http://openlayers.org/dev/examples/lite.html) to see how this works.
> 
> > when I want to get the WMS-Request...
> >   TestLayer.getURL(map.Extent());
> >   
> 
> Extent() is not a method of the map, so what you are trying to do here
> cannot work.
> 
> > I get wrong EPSG !!!! the Request inherits:  &SRS=EPSG%3A4326   <- RIGHT!
> >                                                                   
> > &BBOX=-76506.698386357, and so on  <- WRONG Coordinate Format!!!!!!
> >
> > map.Extent() returns also the wrong format !!!!!!!!
> >   
> 
> map.Extent() will raise an exception. Did you mean map.getExtent()?
> 
> Regards,
> Andreas.
> 
> -- 
> Andreas Hocevar
> OpenGeo - http://opengeo.org/
> Expert service straight from the developers.
> 
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users

-- 
Christopher Schmidt
MetaCarta



More information about the Users mailing list