map fill-opacity in TextSymbolizer to fontOpacity
This commit is contained in:
@@ -338,9 +338,14 @@ OpenLayers.Format.SLD.v1 = OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0, {
|
|||||||
"CssParameter": function(node, symbolizer) {
|
"CssParameter": function(node, symbolizer) {
|
||||||
var cssProperty = node.getAttribute("name");
|
var cssProperty = node.getAttribute("name");
|
||||||
var symProperty = this.cssMap[cssProperty];
|
var symProperty = this.cssMap[cssProperty];
|
||||||
// for labels, fill should map to the fontColor
|
// for labels, fill should map to fontColor and fill-opacity
|
||||||
if (symbolizer.label && cssProperty === 'fill') {
|
// to fontOpacity
|
||||||
symProperty = "fontColor";
|
if (symbolizer.label) {
|
||||||
|
if (cssProperty === 'fill') {
|
||||||
|
symProperty = "fontColor";
|
||||||
|
} else if (cssProperty === 'fill-opacity') {
|
||||||
|
symProperty = "fontOpacity";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(symProperty) {
|
if(symProperty) {
|
||||||
// Limited support for parsing of OGC expressions
|
// Limited support for parsing of OGC expressions
|
||||||
@@ -893,9 +898,10 @@ 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.fontOpacity != null) {
|
||||||
this.writeNode("Fill", {
|
this.writeNode("Fill", {
|
||||||
fillColor: symbolizer.fontColor
|
fillColor: symbolizer.fontColor,
|
||||||
|
fillOpacity: symbolizer.fontOpacity
|
||||||
}, node);
|
}, node);
|
||||||
}
|
}
|
||||||
return node;
|
return node;
|
||||||
|
|||||||
@@ -71,12 +71,14 @@
|
|||||||
</Font>
|
</Font>
|
||||||
<Fill>
|
<Fill>
|
||||||
<CssParameter name="fill">#000000</CssParameter>
|
<CssParameter name="fill">#000000</CssParameter>
|
||||||
|
<CssParameter name="fill-opacity">0.5</CssParameter>
|
||||||
</Fill>
|
</Fill>
|
||||||
<Graphic>
|
<Graphic>
|
||||||
<Mark>
|
<Mark>
|
||||||
<WellKnownName>square</WellKnownName>
|
<WellKnownName>square</WellKnownName>
|
||||||
<Fill>
|
<Fill>
|
||||||
<CssParameter name="fill">#59BF34</CssParameter>
|
<CssParameter name="fill">#59BF34</CssParameter>
|
||||||
|
<CssParameter name="fill-opacity">0.8</CssParameter>
|
||||||
</Fill>
|
</Fill>
|
||||||
<Stroke>
|
<Stroke>
|
||||||
<CssParameter name="stroke">#2D6917</CssParameter>
|
<CssParameter name="stroke">#2D6917</CssParameter>
|
||||||
|
|||||||
Reference in New Issue
Block a user