From 12264fb33a43a875cfafbaa27fc4e7ad7deabe3e Mon Sep 17 00:00:00 2001 From: bartvde Date: Thu, 15 Apr 2010 14:55:44 +0000 Subject: [PATCH] pullup #2581 into the 2.9 branch git-svn-id: http://svn.openlayers.org/branches/openlayers/2.9@10218 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Control/GetFeature.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/OpenLayers/Control/GetFeature.js b/lib/OpenLayers/Control/GetFeature.js index d7a50b3461..91c7a71abf 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. 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);