fixed event handling and rendering of graphicName symbols for Safari and Opera. r=crschmidt (closes #1653)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@7671 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -692,8 +692,11 @@ OpenLayers.Renderer.Elements = OpenLayers.Class(OpenLayers.Renderer, {
|
|||||||
* happened on a layer.
|
* happened on a layer.
|
||||||
*/
|
*/
|
||||||
getFeatureIdFromEvent: function(evt) {
|
getFeatureIdFromEvent: function(evt) {
|
||||||
var node = evt.target || evt.srcElement;
|
var target = evt.target;
|
||||||
return node._featureId;
|
var useElement = target && target.correspondingUseElement;
|
||||||
|
var node = useElement ? useElement : (target || evt.srcElement);
|
||||||
|
var featureId = node._featureId;
|
||||||
|
return featureId;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -250,11 +250,19 @@ OpenLayers.Renderer.SVG = OpenLayers.Class(OpenLayers.Renderer.Elements, {
|
|||||||
// This is a workaround for strange rendering behavior in FF3.
|
// This is a workaround for strange rendering behavior in FF3.
|
||||||
if (node.getAttributeNS(this.xlinkns, "href") != href) {
|
if (node.getAttributeNS(this.xlinkns, "href") != href) {
|
||||||
node.setAttributeNS(this.xlinkns, "href", href);
|
node.setAttributeNS(this.xlinkns, "href", href);
|
||||||
|
} else if (size != parseFloat(node.getAttributeNS(null, "width"))) {
|
||||||
|
// hide the element (and force a reflow so it really gets
|
||||||
|
// hidden. This workaround is needed for Safari.
|
||||||
|
node.style.visibility = "hidden";
|
||||||
|
this.container.scrollLeft = this.container.scrollLeft;
|
||||||
}
|
}
|
||||||
node.setAttributeNS(null, "width", size);
|
node.setAttributeNS(null, "width", size);
|
||||||
node.setAttributeNS(null, "height", size);
|
node.setAttributeNS(null, "height", size);
|
||||||
node.setAttributeNS(null, "x", pos.x - offset);
|
node.setAttributeNS(null, "x", pos.x - offset);
|
||||||
node.setAttributeNS(null, "y", pos.y - offset);
|
node.setAttributeNS(null, "y", pos.y - offset);
|
||||||
|
// set the visibility back to normal (after the Safari
|
||||||
|
// workaround above)
|
||||||
|
node.style.visibility = "";
|
||||||
} else {
|
} else {
|
||||||
node.setAttributeNS(null, "r", style.pointRadius);
|
node.setAttributeNS(null, "r", style.pointRadius);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user