We can rely on the click event

No need to use the mousedown/touchstart event here, because the click event gives us both clientX/clientY and button on touch devices.
This commit is contained in:
ahocevar
2012-09-26 18:27:12 +02:00
parent 4257f5c7c6
commit 47c343ce4f

View File

@@ -160,9 +160,9 @@ ol.MapBrowserEventHandler.prototype.touchEnableBrowserEvent_ =
*/
ol.MapBrowserEventHandler.prototype.click_ = function(browserEvent) {
if (!this.dragged_) {
this.touchEnableBrowserEvent_(this.down_);
this.touchEnableBrowserEvent_(browserEvent);
var newEvent = new ol.MapBrowserEvent(
ol.MapBrowserEvent.EventType.CLICK, this.map_, this.down_);
ol.MapBrowserEvent.EventType.CLICK, this.map_, browserEvent);
this.down_ = null;
this.dispatchEvent(newEvent);
}