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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user