PointPlacement and LinePlacement are choices, so don't output both

This commit is contained in:
Bart van den Eijnden
2012-02-29 14:42:11 +01:00
parent 8273f153dc
commit 0e1a30b3cd
2 changed files with 6 additions and 3 deletions

View File

@@ -990,12 +990,14 @@ OpenLayers.Format.SLD.v1 = OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0, {
},
"LabelPlacement": function(symbolizer) {
var node = this.createElementNSPlus("sld:LabelPlacement");
if (symbolizer.labelAnchorPointX != null ||
// PointPlacement and LinePlacement are choices, so don't output both
if ((symbolizer.labelAnchorPointX != null ||
symbolizer.labelAnchorPointY != null ||
symbolizer.labelAlign != null ||
symbolizer.labelXOffset != null ||
symbolizer.labelYOffset != null ||
symbolizer.labelRotation != null) {
symbolizer.labelRotation != null) &&
symbolizer.labelPerpendicularOffset == null) {
this.writeNode("PointPlacement", symbolizer, node);
}
if (symbolizer.labelPerpendicularOffset != null) {

View File

@@ -538,7 +538,8 @@
}),
new OpenLayers.Symbolizer.Text({
label: "${FOO}",
labelPerpendicularOffset: 10
labelPerpendicularOffset: 10,
labelAlign: "rb"
})
]
})