Avoid duplicate feature requests for clicks, and make clear that the click handler takes precedence over the box handler. r=bartvde,pgiraud (pullup #2581)

git-svn-id: http://svn.openlayers.org/trunk/openlayers@10215 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
ahocevar
2010-04-15 14:44:50 +00:00
parent ca3ecfc5b1
commit 4f809a9714

View File

@@ -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 <click> and <box> 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);