modifier+click no longer opens a new tab on FF when using externalGraphic. r=bartvde,pgiraud (closes #1421)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@11584 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -285,6 +285,7 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
|||||||
node.setAttributeNS(null, "height", height);
|
node.setAttributeNS(null, "height", height);
|
||||||
node.setAttributeNS(this.xlinkns, "href", style.externalGraphic);
|
node.setAttributeNS(this.xlinkns, "href", style.externalGraphic);
|
||||||
node.setAttributeNS(null, "style", "opacity: "+opacity);
|
node.setAttributeNS(null, "style", "opacity: "+opacity);
|
||||||
|
node.onclick = OpenLayers.Renderer.SVG.preventDefault;
|
||||||
} else if (this.isComplexSymbol(style.graphicName)) {
|
} else if (this.isComplexSymbol(style.graphicName)) {
|
||||||
// the symbol viewBox is three times as large as the symbol
|
// the symbol viewBox is three times as large as the symbol
|
||||||
var offset = style.pointRadius * 3;
|
var offset = style.pointRadius * 3;
|
||||||
@@ -983,3 +984,12 @@ OpenLayers.Renderer.SVG.LABEL_VSHIFT = {
|
|||||||
"t": "-70%",
|
"t": "-70%",
|
||||||
"b": "0"
|
"b": "0"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Function: OpenLayers.Renderer.SVG.preventDefault
|
||||||
|
* 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();
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user