fixed rotation for browsers that don't support defs/use. Committed version modified from patch version as suggested by tschaub. r=tschaub (closes #2402)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9953 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -336,9 +336,16 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
||||
}
|
||||
|
||||
if (typeof style.rotation != "undefined" && pos) {
|
||||
var rotation = OpenLayers.String.format(
|
||||
"rotate(${0} ${1} ${2})", [style.rotation, pos.x, pos.y]);
|
||||
node.setAttributeNS(null, "transform", rotation);
|
||||
if(node.nodeName !== "svg") {
|
||||
node.setAttributeNS(null, "transform",
|
||||
"rotate(" + style.rotation + " " + pos.x + " " +
|
||||
pos.y + ")");
|
||||
} else {
|
||||
var symbolCenter = 0.5 * this.symbolSize[id] / 3;
|
||||
node.firstChild.setAttributeNS(null, "transform",
|
||||
"rotate(" + style.rotation + " " + symbolCenter +
|
||||
" " + symbolCenter + ")");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user