[OpenLayers-Trac] [OpenLayers] #1531: add a convenience method to create one stylemap that can hold different symbolizers for points, lines and polygons
OpenLayers
trac at openlayers.org
Sun May 4 15:39:35 EDT 2008
#1531: add a convenience method to create one stylemap that can hold different
symbolizers for points, lines and polygons
-----------------------+----------------------------------------------------
Reporter: ahocevar | Owner: ahocevar
Type: task | Status: new
Priority: minor | Milestone: 2.7 Release
Component: Style | Version: 2.6
Resolution: | Keywords:
State: Review |
-----------------------+----------------------------------------------------
Changes (by ahocevar):
* state: Needs Discussion => Review
Comment:
1531-!r7060-A0.patch does significantly more than what I proposed in the
original ticket description:
* Implemented a new geometryType property for OpenLayers.Rule. This
property can be set to determine for which geometry types (i.e. lines,
points, polygons) the rule should apply.
* Added support for FeatureTypeStyle and SemanticTypeIdentifier in
OpenLayers.Format.SLD. For SLD.write, every geometry type that is found in
the rules' geometryType properties will be assigned to a separate
FeatureTypeStyle with the geometry type as SemanticTypeIdentifier.
SLD.read will read SemanticTypeIdentifier, analyzes it and sets the
appropriate geometry type. This works for SemanticTypeIdentifiers that
address the geometry type (i.e. generic:point, generic:line and
generic:polygon, according to the SLD spec).
* Added a convenience method makeGeometryTypeAware() to
OpenLayers.!StyleMap. This will allow users who pack symbolizers that
should only apply to point, line or polygon features into a single rule to
convert those symbolizers to appropriate rules with geometryType
The whole idea of this patch is to meet both requirements of specifying
symbolizers according to SLD's PointSymbolizer, LineSymbolizer and
PolygonSymbolizer (a PointSymbolizer applied to a polygon means e.g. to
draw a point symbol in the centroid point of a polygon), and to define
different styles for different geometry types according to SLD's
SemanticTypeIdentifier (i.e. apply a rule only if the feature's geometry
type matches the rule's geometryType).
Note that rendering e.g. polygons with a point symbol is not supported yet
in OpenLayers, but once that will happen, this patch gives us the API for
it.
The patch includes tests for the new features. All tests pass in FF2 and
IE6. Any review will be appreciated.
--
Ticket URL: <http://trac.openlayers.org/ticket/1531#comment:1>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer
More information about the Trac
mailing list