[OpenLayers-Users] Just want to set fill on Vector layer

brking brking at gmail.com
Tue Jul 16 07:25:54 PDT 2013


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


More information about the Users mailing list