SelectFeature stops selecting features after a right click on the map

This commit is contained in:
fredj
2011-12-07 15:03:39 +01:00
parent ae56952f00
commit b11b33e3ab
2 changed files with 93 additions and 1 deletions

View File

@@ -173,7 +173,13 @@ OpenLayers.Handler.Feature = OpenLayers.Class(OpenLayers.Handler, {
* evt - {Event}
*/
mousedown: function(evt) {
this.down = evt.xy;
// Feature selection is only done with a left click. Other handlers may stop the
// propagation of left-click mousedown events but not right-click mousedown events.
// This mismatch causes problems when comparing the location of the down and up
// events in the click function so it is important ignore right-clicks.
if (OpenLayers.Event.isLeftClick(evt) || OpenLayers.Event.isSingleTouch(evt)) {
this.down = evt.xy;
}
return this.handle(evt) ? !this.stopDown : true;
},