diff --git a/lib/OpenLayers/Control/GetFeature.js b/lib/OpenLayers/Control/GetFeature.js index d7a50b3461..b53bdb5b25 100644 --- a/lib/OpenLayers/Control/GetFeature.js +++ b/lib/OpenLayers/Control/GetFeature.js @@ -59,8 +59,10 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, { /** * APIProperty: click - * {Boolean} Use a click handler for selecting/unselecting features. - * Default is true. + * {Boolean} Use a click handler for selecting/unselecting features. If + * both and are set to true, the click handler takes + * precedence over the box handler if a box with zero extent was + * selected. If both clicks and Default is true. */ click: true, @@ -305,7 +307,11 @@ OpenLayers.Control.GetFeature = OpenLayers.Class(OpenLayers.Control, { ); } else { - bounds = this.pixelToBounds(position); + if(this.click) { + // box without extent - let the click handler take care of it + return; + } + bounds = this.pixelToBounds(position); } this.setModifiers(this.handlers.box.dragHandler.evt); this.request(bounds);