Hello,

I want to dynamically set a strokeColor based on feature.styler.color rather 
that feature.attribute.color.

I am using this code:

var context = function(feature) {
                feature.stylers ? ret = feature.stylers : ret = 
feature.attributes;
                ret ? null : ret = feature;
                return ret;
}

var defaultStyle = new OpenLayers.Style(OpenLayers.Util.applyDefaults({ 
strokeColor: "${color}", strokeWidth: 3 }
        , OpenLayers.Feature.Vector.style["default"]), {context: context});

I have also tried this:

var defaultStyle = new OpenLayers.Style(OpenLayers.Util.applyDefaults({ 
strokeColor: "${color}", strokeWidth: 3 }
        , OpenLayers.Feature.Vector.style["default"]), {context: {styler: 
null}}) ;

But neither seem to work! I am particularly confused as the top example works 
for OpenLayers.Rule context manipulation.

Any hints?


Cheers,
James Sewell
LISAsoft Developer
+61 (3) 8680 3200 / +61 414 688 892



_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to