[OpenLayers-Trac] [OpenLayers] #1548: add support for a context in StyleMap.addUniqueValueRules

OpenLayers trac at openlayers.org
Thu May 15 10:29:28 EDT 2008


#1548: add support for a context in StyleMap.addUniqueValueRules
---------------------+------------------------------------------------------
 Reporter:  pgiraud  |       Owner:     
     Type:  feature  |      Status:  new
 Priority:  minor    |   Milestone:     
Component:  general  |     Version:  2.6
 Keywords:           |       State:     
---------------------+------------------------------------------------------
 Currently, it's not possible to add unique value rules for properties that
 aren't in the feature attributes.

 What we would like to have is something like :
 {{{
 var lookup = {
                 "Insert": {fillColor: "green"},
                 "Delete": {fillColor: "red"}
             }

             var context = {
                 getState: function(feature) {
                     return feature.state;
                 }
             }

             styleMap.addUniqueValueRules("default", "${getState}", lookup,
 context);
 }}}

 I will propose a patch soon if can get to something working.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/1548>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list