[OpenLayers-Users] WFS layer over Google Map layer projection
problem
bdtyah
bdtyah at yahoo.fr
Tue May 12 13:47:42 EDT 2009
I add the projection attribute to my WFS layer like this :
wfsLayer = new OpenLayers.Layer.WFS( "WFS layer",
"/geoserver/ows",
{ typename: 'topp:roads,
projection: new OpenLayers.Projection("EPSG:4326")
} );
I found the response here :
http://openlayers.org/dev/examples/wfs-reprojection.html
http://openlayers.org/dev/examples/wfs-reprojection.html
Skymota wrote:
>
> Please tell us how you resolved this problem, thanks
>
>
>
>
> bdtyah wrote:
>>
>> Resolved, thanks
>>
>>
>> bdtyah wrote:
>>>
>>> Hi,
>>> I'm using geoserver to serve wfs features that uses EPSG:4326
>>> projection. I want to display them over a GoogleMap layer
>>> (EPSG:900913projection). I uses Mercator Options as is mentionned in
>>> many topics but I still have superposition problems. It's seems that
>>> features coordinates are treated as mercator coordinates rather than
>>> degrees.
>>> There is my code :
>>>
>>> var mercatorOptions = {
>>> controls: [],
>>> projection: new OpenLayers.Projection("EPSG:900913"),
>>> displayProjection: new OpenLayers.Projection("EPSG:4326"),
>>> units: "m",
>>> numZoomLevels: 18,
>>> maxResolution: 156543.0339,
>>> maxExtent: new OpenLayers.Bounds(-20037508, -20037508,20037508,
>>> 20037508.34)
>>> };
>>> map = new OpenLayers.Map( 'map',mercatorOptions);
>>> var gmap = new OpenLayers.Layer.Google( "Google" , {"type":
>>> G_NORMAL_MAP, "maxZoomLevel":18,"sphericalMercator": true} );
>>> map.addLayer(gmap);
>>> wfsLayer = new OpenLayers.Layer.WFS( "WFS layer",
>>> "/geoserver/ows",
>>> { typename: 'topp:roads } );
>>> map.addLayer(wfsLayer);
>>>
>>>
>>>
>>
>>
>
>
--
View this message in context: http://n2.nabble.com/WFS-layer-over-Google-Map-layer-projection-problem-tp2862733p2870700.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
More information about the Users
mailing list