[OpenLayers-Users] WFS reprojection on Google Maps

Luís de Sousa luis.a.de.sousa at gmail.com
Tue May 10 05:20:33 EDT 2011


Hello everyone,

Thanks to Hugo Martins I'm not able to overlay WFS layers correctly
over Google Maps, the srs parameter has to match the map's srs:

var arht = new OpenLayers.Layer.Vector("Limites ARHT", {
		strategies: [new OpenLayers.Strategy.BBOX()/*, saveStrategy*/],
		projection: new OpenLayers.Projection("EPSG:900913"),
		protocol: new OpenLayers.Protocol.WFS({
		    version: "1.1.0",
		    srsName: "EPSG:900913",
		    url: "http://localhost:8090/geoserver/wfs",
		    featureNS :  "http://www.arhtejo.pt",
		    featureType: "LimitesARHT",
		    //geometryName: "the_geom",
		    schema: "http://localhost:8090/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=ARH:LimitesARHT"
		})
	    });

Still struggling with WMS overlays though, where's what I'm using for
the Tasmania sample data:

var wms  = new OpenLayers.Layer.WMS(
		"tasmania_roads",
		"http://localhost:8090/geoserver/wms",
		{
		    layers: 'topp:tasmania_roads',
		    transparent: true,
		    srs: "EPSG:900913"
		},
		{
		    isBaseLayer: false,
		    ratio: 1
		}
	    );

Like this the layer isn't even showing up. Any suggestions? Thank you,

Luís


More information about the Users mailing list