use a more clean way to achieve the same
This commit is contained in:
@@ -866,15 +866,10 @@ OpenLayers.Format.SLD.v1 = OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0, {
|
|||||||
return node;
|
return node;
|
||||||
},
|
},
|
||||||
"CssParameter": function(obj) {
|
"CssParameter": function(obj) {
|
||||||
var name = this.getCssProperty(obj.key);
|
|
||||||
var value = obj.symbolizer[obj.key];
|
|
||||||
if (obj.symbolizer.label && name === 'fill') {
|
|
||||||
value = obj.symbolizer.fontColor;
|
|
||||||
}
|
|
||||||
// not handling ogc:expressions for now
|
// not handling ogc:expressions for now
|
||||||
return this.createElementNSPlus("sld:CssParameter", {
|
return this.createElementNSPlus("sld:CssParameter", {
|
||||||
attributes: {name: name},
|
attributes: {name: this.getCssProperty(obj.key)},
|
||||||
value: value
|
value: obj.symbolizer[obj.key]
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
"TextSymbolizer": function(symbolizer) {
|
"TextSymbolizer": function(symbolizer) {
|
||||||
@@ -899,7 +894,9 @@ OpenLayers.Format.SLD.v1 = OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0, {
|
|||||||
// add in optional Fill
|
// add in optional Fill
|
||||||
if(symbolizer.fontColor != null ||
|
if(symbolizer.fontColor != null ||
|
||||||
symbolizer.fillOpacity != null) {
|
symbolizer.fillOpacity != null) {
|
||||||
this.writeNode("Fill", symbolizer, node);
|
this.writeNode("Fill", {
|
||||||
|
fillColor: symbolizer.fontColor
|
||||||
|
}, node);
|
||||||
}
|
}
|
||||||
return node;
|
return node;
|
||||||
},
|
},
|
||||||
@@ -1013,7 +1010,7 @@ OpenLayers.Format.SLD.v1 = OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0, {
|
|||||||
// GraphicFill here
|
// GraphicFill here
|
||||||
|
|
||||||
// add in CssParameters
|
// add in CssParameters
|
||||||
if(symbolizer.fillColor || (symbolizer.label && symbolizer.fontColor)) {
|
if(symbolizer.fillColor) {
|
||||||
this.writeNode(
|
this.writeNode(
|
||||||
"CssParameter",
|
"CssParameter",
|
||||||
{symbolizer: symbolizer, key: "fillColor"},
|
{symbolizer: symbolizer, key: "fillColor"},
|
||||||
|
|||||||
Reference in New Issue
Block a user