Simplifying logic that returns undefined when root is invisible.

This commit is contained in:
ahocevar
2012-02-28 10:45:18 +01:00
parent d4a9f60c93
commit 4ee28dc63e

View File

@@ -788,10 +788,7 @@ OpenLayers.Renderer.Canvas = OpenLayers.Class(OpenLayers.Renderer, {
getFeatureIdFromEvent: function(evt) {
var featureId, feature;
// if the drawing canvas isn't visible, return undefined.
if (this.root.style.display === "none") { return feature; }
if (this.hitDetection) {
if (this.hitDetection && this.root.style.display !== "none") {
// this dragging check should go in the feature handler
if (!this.map.dragging) {
var xy = evt.xy;