The style is not part of the protocol but an option like protocol: var layer = new OpenLayers.Layer.Vector(name, { strategies: [new OpenLayers.Strategy.Fixed()], protocol: new OpenLayers.Protocol.WFS({ url: wfsUri, featureType: 'sectors', featureNS: namespace }), styleMap: new OpenLayers.StyleMap({ "default": new OpenLayers.Style({fillColor: "red"}) }) });
Arnd -----Ursprüngliche Nachricht----- Von: openlayers-users-boun...@lists.osgeo.org [mailto:openlayers-users-boun...@lists.osgeo.org] Im Auftrag von brking Gesendet: Dienstag, 16. Juli 2013 16:26 An: openlayers-users@lists.osgeo.org Betreff: [OpenLayers-Users] Just want to set fill on Vector layer I've been trying a few combinations of setting style and stylemap on a vector layer I'm reading from GeoServer, but I just can't get the fill to change at all. How do I manually set the fill to a hard coded value ? I want to do this as I add layers to randomly set colors. Thanks. var layer = new OpenLayers.Layer.Vector(name, { strategies: [new OpenLayers.Strategy.Fixed()], protocol: new OpenLayers.Protocol.WFS({ url: wfsUri, featureType: 'sectors', featureNS: namespace, styleMap: new OpenLayers.StyleMap({ "default": new OpenLayers.Style({ fillColor: "red" }) }) }) }); -- View this message in context: http://osgeo-org.1560.x6.nabble.com/Just-want-to-set-fill-on-Vector-layer-tp 5066810.html Sent from the OpenLayers Users mailing list archive at Nabble.com. _______________________________________________ Users mailing list us...@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/openlayers-users _______________________________________________ Users mailing list us...@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/openlayers-users