[OpenLayers-Users] WFS layer over Google Map layer projection problem

bdtyah bdtyah at yahoo.fr
Mon May 11 09:53:30 EDT 2009


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-tp2862733p2863071.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.




More information about the Users mailing list