[OpenLayers-Users] WMS and Mercator projection

Andreas Hocevar ahocevar at opengeo.org
Mon May 31 09:41:45 EDT 2010


On May 31, 2010, at 15:12 , Joosep-Georg Järvemaa wrote:

> Thanks Andreas for your answer,
> 
>> So I'd configure the map like this:
>> 
>> var options = {
>> projection: new OpenLayers.Projection("EPSG:3301"),
>> displayProjection: new OpenLayers.Projection("EPSG:4326"),
>> units: 'm',
>> 'maxExtent': new OpenLayers.Bounds(
>> 370753.1145, 6382922.7769, 739245.6000, 6624811.0577
>> ),
>> 'maxResolution': 'auto'
>> };
> 
> Now it stopped working at all -- see
> http://skip.nonsense.ee/.dev/openlayers/ahocevar@opengeo.org.html

Looking at your WMS Capabilities again, I see that the 'of10000' layer does not support EPSG:3301. Remove it from the "layers" list, and you should be fine.

Also note that displayProjection will display your coordinates in EPSG:3301, because OpenLayers cannot transform from 3301 to 4326. But all you have to do is to include proj4js (google for it), and add the proj4js definition from the spatialreference.org link I posted in my first reply to your js code.

Regards,
Andreas.

> 
> 
> I can see that OpenLayers is sending now WMS requests with
> SRS=EPSG%3A3301&BBOX=370753.1145,6382922.7769,561216.32772835,6573385.9901283
> 
> But it should send them with
> SRS=EPSG:4326&bbox=24.6461274,59.3624859,24.6479219,59.3634004
> 
> Like:
> 
> http://xgis.maaamet.ee/wms-pub/alus-geo?STYLES=&SRS=EPSG:4326&FORMAT=image/png&VERSION=1.1.1&REQUEST=GetMap&LAYERS=of10000,TOPOYKSUS_6569,TOPOYKSUS_7793&bbox=24.6461274,59.3624859,24.6479219,59.3634004&width=499&height=499
> 
> 
> 
> Regards,
> -- 
> Joosep-Georg
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users

-- 
Andreas Hocevar
OpenGeo - http://opengeo.org/
Expert service straight from the developers.




More information about the Users mailing list