Ticket #821: patch-821-r5408-A0.diff
| File patch-821-r5408-A0.diff, 2.4 kB (added by pgiraud, 1 year ago) |
|---|
-
lib/OpenLayers/Renderer/SVG.js
old new 215 215 var opacity = style.graphicOpacity || style.fillOpacity; 216 216 217 217 node.setAttributeNS(null, "x", (x + xOffset).toFixed()); 218 node.setAttributeNS(null, "y", ( -y + yOffset).toFixed());218 node.setAttributeNS(null, "y", (y + yOffset).toFixed()); 219 219 node.setAttributeNS(null, "width", width); 220 220 node.setAttributeNS(null, "height", height); 221 221 node.setAttributeNS("http://www.w3.org/1999/xlink", "href", style.externalGraphic); 222 node.setAttributeNS(null, "transform", "scale(1,-1)");223 222 node.setAttributeNS(null, "style", "opacity: "+opacity); 224 223 } else { 225 224 node.setAttributeNS(null, "r", style.pointRadius); … … 304 303 */ 305 304 createRoot: function() { 306 305 var id = this.container.id + "_root"; 307 308 306 var root = this.nodeFactory(id, "g"); 309 310 // flip the SVG display Y axis upside down so it311 // matches the display Y axis of the map312 root.setAttributeNS(null, "transform", "scale(1, -1)");313 314 307 return root; 315 308 }, 316 309 … … 344 337 drawCircle: function(node, geometry, radius) { 345 338 var resolution = this.getResolution(); 346 339 var x = (geometry.x / resolution + this.left); 347 var y = ( geometry.y / resolution - this.top);340 var y = (this.top - geometry.y / resolution); 348 341 349 342 if (this.inValidRange(x, y)) { 350 343 node.setAttributeNS(null, "cx", x); … … 423 416 drawRectangle: function(node, geometry) { 424 417 var resolution = this.getResolution(); 425 418 var x = (geometry.x / resolution + this.left); 426 var y = ( geometry.y / resolution - this.top);419 var y = (this.top - geometry.y / resolution); 427 420 428 421 if (this.inValidRange(x, y)) { 429 422 node.setAttributeNS(null, "x", x); … … 504 497 getShortString: function(point) { 505 498 var resolution = this.getResolution(); 506 499 var x = (point.x / resolution + this.left); 507 var y = ( point.y / resolution - this.top);500 var y = (this.top - point.y / resolution); 508 501 509 502 if (this.inValidRange(x, y)) { 510 503 return x + "," + y;
