From 3b81b423a5db683120db0db07c665d6db8c9c237 Mon Sep 17 00:00:00 2001 From: Bart van den Eijnden Date: Fri, 24 Feb 2012 17:48:35 +0100 Subject: [PATCH] do not use rotation but use labelRotation instead (thanks @ahocevar for the catch) --- lib/OpenLayers/Format/SLD/v1.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/OpenLayers/Format/SLD/v1.js b/lib/OpenLayers/Format/SLD/v1.js index 8244c09909..3d5bc87c9a 100644 --- a/lib/OpenLayers/Format/SLD/v1.js +++ b/lib/OpenLayers/Format/SLD/v1.js @@ -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; },