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

Andreas Hocevar ahocevar at opengeo.org
Thu Oct 8 09:59:43 EDT 2009


Hi,

in WMS <= 1.1, the axis order is always longitude-latitude.

50.910 and 6.750 are valid coordinates for EPSG:4326, but I don't know which of these is your longitude and which one the latitude.

Regards,
Andreas.

Bytechanger wrote:
> Hi,
>
> I think I´ve found the fault.....
>
> the coordinates  50.910 and 6.750  is EPSG:4326 ??
> OpenLayers gives in -180.0000, -90.0000, 180.0000, 90.0000 ????
>
> I think OpenLayers.WMS requests in -180.0000, -90.0000, 180.0000,
> 90.0000 form, not in 50.910 and 6.750 ???
>
>
> Greetings
>
> Byte
>
> Andreas Hocevar schrieb:
>   
>> 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"), ...);
>>>   
>>>     
>>>       
>> 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.




More information about the Users mailing list