cannot unselect on clickout when selecting by drawing a box, r=pgiraud (closes #2204)
git-svn-id: http://svn.openlayers.org/trunk/openlayers@9979 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf
This commit is contained in:
@@ -484,6 +484,13 @@ OpenLayers.Control.SelectFeature = OpenLayers.Class(OpenLayers.Control, {
|
||||
if(cont !== false) {
|
||||
layer.selectedFeatures.push(feature);
|
||||
this.highlight(feature);
|
||||
// if the feature handler isn't involved in the feature
|
||||
// selection (because the box handler is used or the
|
||||
// feature is selected programatically) we fake the
|
||||
// feature handler to allow unselecting on click
|
||||
if(!this.handlers.feature.lastFeature) {
|
||||
this.handlers.feature.lastFeature = layer.selectedFeatures[0];
|
||||
}
|
||||
layer.events.triggerEvent("featureselected", {feature: feature});
|
||||
this.onSelect.call(this.scope, feature);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user