[OpenLayers-Users] WMS and Mercator projection

Andreas Hocevar ahocevar at opengeo.org
Mon May 31 09:01:11 EDT 2010


Hi,

several things are wrong in your code.

* Looking at your WMS Capabilities, I see that only EPSG:3301 is supported for your layers.

* OpenLayers does not do client side reprojection

* displayProjection is only there to tell controls in which coordinate system they should display coordinates

* maxExtent has to be provided in coordinates of the map projection.

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'
};

I took the maxExtent from the Projected Bounds found here: http://spatialreference.org/ref/epsg/3301/

Regards,
Andreas.

On May 31, 2010, at 14:28 , Joosep-Georg Järvemaa wrote:

> Hello,
> 
> 
> Appears that my question hasn't appeared in the list yet, so reposting.
> 
> 
> Tried different examples but the image is still showing up streched --
> http://skip.nonsense.ee/.dev/openlayers/
> 
> With JOSM everything is working -- image is displayed in EPSG:3857 and
> WMS images get asked in EPSG:4326 as it should...
> 
> 
> How to fix?
> 
> 
> 
> Regards,
> -- 
> Joosep-Georg Järvemaa
> _______________________________________________
> 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