Use OpenLayers.Event.preventDefault, deprecate OpenLayers.Renderer.SVG.preventDefault.

This commit is contained in:
Frederic Junod
2012-05-29 09:14:33 +02:00
parent a6119f6a75
commit 74dd106082

View File

@@ -284,7 +284,7 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
node.setAttributeNS(null, "height", height);
node.setAttributeNS(this.xlinkns, "href", style.externalGraphic);
node.setAttributeNS(null, "style", "opacity: "+opacity);
node.onclick = OpenLayers.Renderer.SVG.preventDefault;
node.onclick = OpenLayers.Event.preventDefault;
} else if (this.isComplexSymbol(style.graphicName)) {
// the symbol viewBox is three times as large as the symbol
var offset = style.pointRadius * 3;
@@ -1000,9 +1000,10 @@ OpenLayers.Renderer.SVG.LABEL_VFACTOR = {
/**
* Function: OpenLayers.Renderer.SVG.preventDefault
* *Deprecated*. Use <OpenLayers.Event.preventDefault> method instead.
* Used to prevent default events (especially opening images in a new tab on
* ctrl-click) from being executed for externalGraphic symbols
*/
OpenLayers.Renderer.SVG.preventDefault = function(e) {
e.preventDefault && e.preventDefault();
OpenLayers.Event.preventDefault(e);
};