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:
@@ -160,9 +160,9 @@ ol.MapBrowserEventHandler.prototype.touchEnableBrowserEvent_ =
|
|||||||
*/
|
*/
|
||||||
ol.MapBrowserEventHandler.prototype.click_ = function(browserEvent) {
|
ol.MapBrowserEventHandler.prototype.click_ = function(browserEvent) {
|
||||||
if (!this.dragged_) {
|
if (!this.dragged_) {
|
||||||
this.touchEnableBrowserEvent_(this.down_);
|
this.touchEnableBrowserEvent_(browserEvent);
|
||||||
var newEvent = new ol.MapBrowserEvent(
|
var newEvent = new ol.MapBrowserEvent(
|
||||||
ol.MapBrowserEvent.EventType.CLICK, this.map_, this.down_);
|
ol.MapBrowserEvent.EventType.CLICK, this.map_, browserEvent);
|
||||||
this.down_ = null;
|
this.down_ = null;
|
||||||
this.dispatchEvent(newEvent);
|
this.dispatchEvent(newEvent);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user