do not use rotation but use labelRotation instead (thanks @ahocevar for the catch)
This commit is contained in:
@@ -224,7 +224,10 @@ OpenLayers.Format.SLD.v1 = OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0, {
|
|||||||
this.readChildNodes(node, symbolizer);
|
this.readChildNodes(node, symbolizer);
|
||||||
},
|
},
|
||||||
"PointPlacement": function(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,
|
var labelAlign,
|
||||||
x = symbolizer.labelAnchorPointX,
|
x = symbolizer.labelAnchorPointX,
|
||||||
y = symbolizer.labelAnchorPointY;
|
y = symbolizer.labelAnchorPointY;
|
||||||
@@ -242,7 +245,8 @@ OpenLayers.Format.SLD.v1 = OpenLayers.Class(OpenLayers.Format.Filter.v1_0_0, {
|
|||||||
} else if (y >= 2/3) {
|
} else if (y >= 2/3) {
|
||||||
labelAlign += 't';
|
labelAlign += 't';
|
||||||
}
|
}
|
||||||
symbolizer.labelAlign = labelAlign;
|
config.labelAlign = labelAlign;
|
||||||
|
OpenLayers.Util.applyDefaults(symbolizer, config);
|
||||||
},
|
},
|
||||||
"AnchorPoint": function(node, symbolizer) {
|
"AnchorPoint": function(node, symbolizer) {
|
||||||
this.readChildNodes(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) {
|
symbolizer.labelYOffset != null) {
|
||||||
this.writeNode("Displacement", symbolizer, node);
|
this.writeNode("Displacement", symbolizer, node);
|
||||||
}
|
}
|
||||||
if (symbolizer.rotation != null) {
|
if (symbolizer.labelRotation != null) {
|
||||||
this.writeNode("Rotation", symbolizer.rotation, node);
|
this.writeNode("Rotation", symbolizer.labelRotation, node);
|
||||||
}
|
}
|
||||||
return node;
|
return node;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user