fixing rotation so previously rotated geometries will be rotated back if the rotation symbolizer attribute is not set any more. r=bartvde (closes #2500)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@10135 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -335,15 +335,18 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
||||
node.setAttributeNS(null, "r", style.pointRadius);
|
||||
}
|
||||
|
||||
if (typeof style.rotation != "undefined" && pos) {
|
||||
var rotation = style.rotation;
|
||||
if (node._rotation !== rotation && pos) {
|
||||
node._rotation = rotation;
|
||||
rotation |= 0;
|
||||
if(node.nodeName !== "svg") {
|
||||
node.setAttributeNS(null, "transform",
|
||||
"rotate(" + style.rotation + " " + pos.x + " " +
|
||||
"rotate(" + rotation + " " + pos.x + " " +
|
||||
pos.y + ")");
|
||||
} else {
|
||||
var symbolCenter = 0.5 * this.symbolSize[id] / 3;
|
||||
node.firstChild.setAttributeNS(null, "transform",
|
||||
"rotate(" + style.rotation + " " + symbolCenter +
|
||||
"rotate(" + rotation + " " + symbolCenter +
|
||||
" " + symbolCenter + ")");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user