[OpenLayers-Users] Re: Transform WMS/WFS Layer from one projection to other projection

Rob rob-news at gmx.de
Wed Aug 10 12:22:45 EDT 2011


Mustafa646 <noorcs22 at ...> writes:

> 
> So far, we can transform a point from one projection to an other projection
> like below:
> 
> var point = new OpenLayers.LonLat(13.01956, 55.59735); 
> var pt = point.transform(new OpenLayers.Projection("EPSG:4326"), new
> OpenLayers.Projection("EPSG:3008"));
> 
> Is it possible to transform a WMS/WFS Layer (shapefile) from one projection
> to another projection ?
> 
> --
> View this message in context:
http://osgeo-org.1803224.n2.nabble.com/Transform-WMS-WFS-Layer-from-one-projection-to-other-projection-tp6672793p6672793.html
> Sent from the OpenLayers Users mailing list archive at Nabble.com.
> 


Hi,

for WFS you can use "projection" property in your Request, e.g.:

        layer = new parent.OpenLayers.Layer.Vector("NameOfLayer", {
            projection: srs_value, // your target SRS here!!!
            strategies : [ new parent.OpenLayers.Strategy.BBOX() ],
            protocol : new parent.OpenLayers.Protocol.WFS({
                url : url,
                featureType : ftName,
                featureNS : ns,
                geometryName : geoProp,
                srsName : srsName,
                version : version
            })
        });

and use the proj4js definitions to transform.

Rob





More information about the Users mailing list