Map "click" event renamed to "singleclick"

As discussed with @tschaub in #1195.
This commit is contained in:
Éric Lemoine
2013-10-31 09:17:24 +01:00
parent 2c930d74b5
commit 8402eee0c3
13 changed files with 23 additions and 23 deletions

View File

@@ -54,8 +54,8 @@ ol.events.condition.always = goog.functions.TRUE;
* @return {boolean} True if the event is a click event.
* @todo stability experimental
*/
ol.events.condition.clickOnly = function(mapBrowserEvent) {
return mapBrowserEvent.type == ol.MapBrowserEvent.EventType.CLICK;
ol.events.condition.singleClick = function(mapBrowserEvent) {
return mapBrowserEvent.type == ol.MapBrowserEvent.EventType.SINGLECLICK;
};

View File

@@ -27,7 +27,7 @@ ol.interaction.Select = function(opt_options) {
* @type {ol.events.ConditionType}
*/
this.condition_ = goog.isDef(options.condition) ?
options.condition : ol.events.condition.clickOnly;
options.condition : ol.events.condition.singleClick;
/**
* @private

View File

@@ -195,7 +195,7 @@ ol.MapBrowserEventHandler.prototype.emulateClick_ = function(browserEvent) {
this.clickTimeoutId_ = goog.global.setTimeout(goog.bind(function() {
this.clickTimeoutId_ = 0;
var newEvent = new ol.MapBrowserEvent(
ol.MapBrowserEvent.EventType.CLICK, this.map_, browserEvent);
ol.MapBrowserEvent.EventType.SINGLECLICK, this.map_, browserEvent);
this.dispatchEvent(newEvent);
}, this), 250);
}
@@ -341,12 +341,12 @@ ol.MapBrowserEventHandler.prototype.disposeInternal = function() {
* @enum {string}
*/
ol.MapBrowserEvent.EventType = {
CLICK: goog.events.EventType.CLICK,
DBLCLICK: goog.events.EventType.DBLCLICK,
DOWN: 'down',
DRAGSTART: 'dragstart',
DRAG: 'drag',
DRAGEND: 'dragend',
SINGLECLICK: 'singleclick',
TOUCHSTART: goog.events.EventType.TOUCHSTART,
TOUCHMOVE: goog.events.EventType.TOUCHMOVE,
TOUCHEND: goog.events.EventType.TOUCHEND