do not use rotation but use labelRotation instead (thanks @ahocevar for the catch)

This commit is contained in:
Bart van den Eijnden
2012-02-24 17:48:35 +01:00
parent 66d3b81929
commit 3b81b423a5

View File

@@ -224,7 +224,10 @@ OpenLayers.Format.SLD.v1 = OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0, {
this.readChildNodes(node, symbolizer);
},
"PointPlacement": function(node, symbolizer) {
this.readChildNodes(node, symbolizer);
var config = {};
this.readChildNodes(node, config);
config.labelRotation = config.rotation;
delete config.rotation;
var labelAlign,
x = symbolizer.labelAnchorPointX,
y = symbolizer.labelAnchorPointY;
@@ -242,7 +245,8 @@ OpenLayers.Format.SLD.v1 = OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0, {
} else if (y >= 2/3) {
labelAlign += 't';
}
symbolizer.labelAlign = labelAlign;
config.labelAlign = labelAlign;
OpenLayers.Util.applyDefaults(symbolizer, config);
},
"AnchorPoint": function(node, symbolizer) {
this.readChildNodes(node, symbolizer);
@@ -999,8 +1003,8 @@ OpenLayers.Format.SLD.v1 = OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0, {
symbolizer.labelYOffset != null) {
this.writeNode("Displacement", symbolizer, node);
}
if (symbolizer.rotation != null) {
this.writeNode("Rotation", symbolizer.rotation, node);
if (symbolizer.labelRotation != null) {
this.writeNode("Rotation", symbolizer.labelRotation, node);
}
return node;
},