* added stroke, fill and graphic symbolizer properties (all boolean) to

control whether or not to render a stroke, fill and graphic.
 * added a defaultsPerSymbolizer property to OpenLayers.Style to allow 
for extending incomplete symbolizers with defaults for stroke, fill or 
graphic. This also makes Format.SLD read/write round trips possible 
without modifying empty or incomplete <Stroke/>, <Fill/> and <Graphic/> 
constructs. r=tschaub (closes #1876)


git-svn-id: http://svn.openlayers.org/trunk/openlayers@9278 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2009-04-13 13:35:13 +00:00
parent 13e42ec59b
commit 2aa7f22926
7 changed files with 327 additions and 45 deletions

View File

@@ -137,7 +137,7 @@ OpenLayers.Format.SLD.v1 = OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0, {
);
},
"UserStyle": function(node, layer) {
var obj = {rules: []};
var obj = {defaultsPerSymbolizer: true, rules: []};
this.readChildNodes(node, obj);
var style = new OpenLayers.Style(this.defaultSymbolizer, obj);
layer.userStyles.push(style);
@@ -232,9 +232,11 @@ OpenLayers.Format.SLD.v1 = OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0, {
rule.symbolizer["Point"] = symbolizer;
},
"Stroke": function(node, symbolizer) {
symbolizer.stroke = true;
this.readChildNodes(node, symbolizer);
},
"Fill": function(node, symbolizer) {
symbolizer.fill = true;
this.readChildNodes(node, symbolizer);
},
"CssParameter": function(node, symbolizer) {
@@ -250,6 +252,7 @@ OpenLayers.Format.SLD.v1 = OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0, {
}
},
"Graphic": function(node, symbolizer) {
symbolizer.graphic = true;
var graphic = {};
// painter's order not respected here, clobber previous with next
this.readChildNodes(node, graphic);