events/condition: Add doubleClick condition

This commit is contained in:
Tobias Bieniek
2015-08-01 20:46:21 +02:00
parent 22ca08179d
commit e3ead5df06

View File

@@ -111,6 +111,18 @@ ol.events.condition.singleClick = function(mapBrowserEvent) {
};
/**
* Return `true` if the event is a map `dblclick` event, `false` otherwise.
*
* @param {ol.MapBrowserEvent} mapBrowserEvent Map browser event.
* @return {boolean} True if the event is a map `dblclick` event.
* @api stable
*/
ol.events.condition.doubleClick = function(mapBrowserEvent) {
return mapBrowserEvent.type == ol.MapBrowserEvent.EventType.DBLCLICK;
};
/**
* Return `true` if no modifier key (alt-, shift- or platform-modifier-key) is
* pressed.