[OpenLayers-Trac] [OpenLayers] #533: Style vector layers with SLD
OpenLayers
trac at openlayers.org
Sat Nov 10 19:38:05 EST 2007
#533: Style vector layers with SLD
----------------------+-----------------------------------------------------
Reporter: sderle | Owner:
Type: feature | Status: new
Priority: minor | Milestone: 2.6 Release
Component: Format | Version:
Resolution: | Keywords: review
----------------------+-----------------------------------------------------
Changes (by ahocevar):
* component: Layer => Format
Comment:
The current version of the patch does not reflect the latest changes,
those are only in the ahocevar/sldRenderer sandbox. I still have to create
some tests for the new features, and after that I will split up this patch
into three separate tickets, because there is more in it than just SLD. I
think this will also be easier to review and move into trunk. So if this
is ok, I'll split the patch up into the following three parts:
* Rules Framework (!OpenLayers.Rule and subclasses)
* Styles Framework (!OpenLayers.Style, depends on the Rules Framework)
* SLD Parser (!OpenLayers.Format.SLD, depends on the Styles Framework)
The Styles Framework is the only part that has impact on existing code.
Another question, because this was commented by Eric: what do the other
developers think about changing all style properties for features,
!Control.Select and layers to be !OpenLayers.Style instead of the style
hash that is now being used?
If that is desired, I would propose to change the style properties of
those classes to type !OpenLayers.Style. The constructor of
!OpenLayers.Style can already take a style hash as argument. So the only
thing to change in existing applications would be from e.g.
{{{
layer.style = myStyleHash;
}}}
to
{{{
layer.style = new OpenLayers.Style(myStyleHash);
}}}
Another thing I would like to discuss is the caching of style/symbolizer
attributes that need string format parsing to replace property names with
literals (the "foo ${bar}" stuff), which is currently done in
!OpenLayers.Style.createStyle, populating the propertyStyles property when
it is invoked for the first time.
Should I change rules and defaultStyle from API-properties to private
properties, and add a !setStyle and a !setRules method (maybe also
!addRule)? These methods would then call a common method that does the
caching after setting the style/rules.
--
Ticket URL: <http://trac.openlayers.org/ticket/533#comment:7>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list