[OpenLayers-Users] how to control the style of a WFS layer?

Piero Campa piero.campa at gmail.com
Thu Apr 1 12:58:19 EDT 2010


I don't know wether the OpenLayers.Layer.WFS actually allows for styleMaps,
but I'm sure OpenLayers.Layer.Vector does: try creating a feature-layer with
this latter method.

Ex.
		myWfsLayer = new OpenLayers.Layer.Vector("layerName", {
			styleMap: myStyle,
			strategies: [myStrategy],
			filter: myFilter,
			protocol: new OpenLayers.Protocol.WFS({
				url: myWfsUrl,
				featureType: "layerName",
				featureNS: "workspaceNamespaceURI",
				srsName: "EPSG:XXXX", 
				version: "<version>"
				})
		});

I believe you're not the first having problems with OpenLayers.Layer.WFS.
(I guess you're using Geoserver on the server side (that topp: is familiar):
layerName is then the name of the layer in Geoserver).

Hope this helps!
Piero

The filter is optional



-- 
View this message in context: http://n2.nabble.com/how-to-control-the-style-of-a-WFS-layer-tp4838263p4838384.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.



More information about the Users mailing list