[OpenLayers-Trac] [OpenLayers] #1531: add support for geometry type aware styling rules
OpenLayers
trac at openlayers.org
Wed May 21 11:25:30 EDT 2008
#1531: add support for geometry type aware styling rules
-------------------------------+--------------------------------------------
Reporter: ahocevar | Owner: ahocevar
Type: feature | Status: new
Priority: minor | Milestone: Future
Component: Style | Version: 2.6
Resolution: | Keywords:
State: Needs Discussion |
-------------------------------+--------------------------------------------
Changes (by ahocevar):
* state: Needs More Work => Needs Discussion
* milestone: 2.7 Release => Future
Comment:
Ok, after tschaub's suggestion of allowing functions as symbolizers, a
little more thoughts about that. Currently, a symbolizer can have values
or property names for its values, e.g.
{{{
var symbolizer = {
strokeColor: "blue",
fillColor: "${fill}"
}
}}}
In the future, we could add a third way to define symbolizer values:
{{{
var symbolizer = {
strokeColor: function(feature) {
switch(feature.state){
"Insert": return "green";
"Update": return "yellow";
"Delete": return "red";
default: return "gray";
}
}
}}}
This is similar to what tschaub proposed (allow a function as symbolizer),
just the other way around. With that, we have almost everything we need to
implement ogc:Function. What we still need is a function factory that
creates the correct functions with closures for the parameters when
deserializing SLD or ogc:Filter. Those functions can then be attached to a
feature.
The only concern with that is performance: calling functions is slow, and
we might have to call a lot of functions if every symbolizer property is
created by a function.
Anyway, that's just a few thoughts, discussion of a larger picture of all
that might be in order.
--
Ticket URL: <http://trac.openlayers.org/ticket/1531#comment:5>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list