Rename _ol_MapBrowserPointEvent_ to MapBrowserPointerEvent
This commit is contained in:
committed by
Frederic Junod
parent
039bde29cc
commit
ec64789940
@@ -4,7 +4,7 @@
|
||||
import {inherits} from './index.js';
|
||||
import _ol_has_ from './has.js';
|
||||
import MapBrowserEventType from './MapBrowserEventType.js';
|
||||
import _ol_MapBrowserPointerEvent_ from './MapBrowserPointerEvent.js';
|
||||
import MapBrowserPointerEvent from './MapBrowserPointerEvent.js';
|
||||
import _ol_events_ from './events.js';
|
||||
import _ol_events_EventTarget_ from './events/EventTarget.js';
|
||||
import _ol_pointer_EventType_ from './pointer/EventType.js';
|
||||
@@ -118,21 +118,21 @@ inherits(_ol_MapBrowserEventHandler_, _ol_events_EventTarget_);
|
||||
* @private
|
||||
*/
|
||||
_ol_MapBrowserEventHandler_.prototype.emulateClick_ = function(pointerEvent) {
|
||||
var newEvent = new _ol_MapBrowserPointerEvent_(
|
||||
var newEvent = new MapBrowserPointerEvent(
|
||||
MapBrowserEventType.CLICK, this.map_, pointerEvent);
|
||||
this.dispatchEvent(newEvent);
|
||||
if (this.clickTimeoutId_ !== 0) {
|
||||
// double-click
|
||||
clearTimeout(this.clickTimeoutId_);
|
||||
this.clickTimeoutId_ = 0;
|
||||
newEvent = new _ol_MapBrowserPointerEvent_(
|
||||
newEvent = new MapBrowserPointerEvent(
|
||||
MapBrowserEventType.DBLCLICK, this.map_, pointerEvent);
|
||||
this.dispatchEvent(newEvent);
|
||||
} else {
|
||||
// click
|
||||
this.clickTimeoutId_ = setTimeout(function() {
|
||||
this.clickTimeoutId_ = 0;
|
||||
var newEvent = new _ol_MapBrowserPointerEvent_(
|
||||
var newEvent = new MapBrowserPointerEvent(
|
||||
MapBrowserEventType.SINGLECLICK, this.map_, pointerEvent);
|
||||
this.dispatchEvent(newEvent);
|
||||
}.bind(this), 250);
|
||||
@@ -165,7 +165,7 @@ _ol_MapBrowserEventHandler_.prototype.updateActivePointers_ = function(pointerEv
|
||||
*/
|
||||
_ol_MapBrowserEventHandler_.prototype.handlePointerUp_ = function(pointerEvent) {
|
||||
this.updateActivePointers_(pointerEvent);
|
||||
var newEvent = new _ol_MapBrowserPointerEvent_(
|
||||
var newEvent = new MapBrowserPointerEvent(
|
||||
MapBrowserEventType.POINTERUP, this.map_, pointerEvent);
|
||||
this.dispatchEvent(newEvent);
|
||||
|
||||
@@ -206,7 +206,7 @@ _ol_MapBrowserEventHandler_.prototype.isMouseActionButton_ = function(pointerEve
|
||||
*/
|
||||
_ol_MapBrowserEventHandler_.prototype.handlePointerDown_ = function(pointerEvent) {
|
||||
this.updateActivePointers_(pointerEvent);
|
||||
var newEvent = new _ol_MapBrowserPointerEvent_(
|
||||
var newEvent = new MapBrowserPointerEvent(
|
||||
MapBrowserEventType.POINTERDOWN, this.map_, pointerEvent);
|
||||
this.dispatchEvent(newEvent);
|
||||
|
||||
@@ -258,7 +258,7 @@ _ol_MapBrowserEventHandler_.prototype.handlePointerMove_ = function(pointerEvent
|
||||
// moved a significant distance.
|
||||
if (this.isMoving_(pointerEvent)) {
|
||||
this.dragging_ = true;
|
||||
var newEvent = new _ol_MapBrowserPointerEvent_(
|
||||
var newEvent = new MapBrowserPointerEvent(
|
||||
MapBrowserEventType.POINTERDRAG, this.map_, pointerEvent,
|
||||
this.dragging_);
|
||||
this.dispatchEvent(newEvent);
|
||||
@@ -280,7 +280,7 @@ _ol_MapBrowserEventHandler_.prototype.handlePointerMove_ = function(pointerEvent
|
||||
*/
|
||||
_ol_MapBrowserEventHandler_.prototype.relayEvent_ = function(pointerEvent) {
|
||||
var dragging = !!(this.down_ && this.isMoving_(pointerEvent));
|
||||
this.dispatchEvent(new _ol_MapBrowserPointerEvent_(
|
||||
this.dispatchEvent(new MapBrowserPointerEvent(
|
||||
pointerEvent.type, this.map_, pointerEvent, dragging));
|
||||
};
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ import MapBrowserEvent from './MapBrowserEvent.js';
|
||||
* @param {boolean=} opt_dragging Is the map currently being dragged?
|
||||
* @param {?olx.FrameState=} opt_frameState Frame state.
|
||||
*/
|
||||
var _ol_MapBrowserPointerEvent_ = function(type, map, pointerEvent, opt_dragging,
|
||||
var MapBrowserPointerEvent = function(type, map, pointerEvent, opt_dragging,
|
||||
opt_frameState) {
|
||||
|
||||
MapBrowserEvent.call(this, type, map, pointerEvent.originalEvent, opt_dragging,
|
||||
@@ -27,5 +27,5 @@ var _ol_MapBrowserPointerEvent_ = function(type, map, pointerEvent, opt_dragging
|
||||
|
||||
};
|
||||
|
||||
inherits(_ol_MapBrowserPointerEvent_, MapBrowserEvent);
|
||||
export default _ol_MapBrowserPointerEvent_;
|
||||
inherits(MapBrowserPointerEvent, MapBrowserEvent);
|
||||
export default MapBrowserPointerEvent;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import {inherits} from '../index.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import MapBrowserEventType from '../MapBrowserEventType.js';
|
||||
import _ol_MapBrowserPointerEvent_ from '../MapBrowserPointerEvent.js';
|
||||
import MapBrowserPointerEvent from '../MapBrowserPointerEvent.js';
|
||||
import _ol_coordinate_ from '../coordinate.js';
|
||||
import Event from '../events/Event.js';
|
||||
import {boundingExtent, getArea} from '../extent.js';
|
||||
@@ -132,7 +132,7 @@ inherits(_ol_interaction_Extent_, _ol_interaction_Pointer_);
|
||||
* @private
|
||||
*/
|
||||
_ol_interaction_Extent_.handleEvent_ = function(mapBrowserEvent) {
|
||||
if (!(mapBrowserEvent instanceof _ol_MapBrowserPointerEvent_)) {
|
||||
if (!(mapBrowserEvent instanceof MapBrowserPointerEvent)) {
|
||||
return true;
|
||||
}
|
||||
//display pointer (if not dragging)
|
||||
|
||||
@@ -6,7 +6,7 @@ import _ol_Collection_ from '../Collection.js';
|
||||
import _ol_CollectionEventType_ from '../CollectionEventType.js';
|
||||
import _ol_Feature_ from '../Feature.js';
|
||||
import MapBrowserEventType from '../MapBrowserEventType.js';
|
||||
import _ol_MapBrowserPointerEvent_ from '../MapBrowserPointerEvent.js';
|
||||
import MapBrowserPointerEvent from '../MapBrowserPointerEvent.js';
|
||||
import _ol_array_ from '../array.js';
|
||||
import _ol_coordinate_ from '../coordinate.js';
|
||||
import _ol_events_ from '../events.js';
|
||||
@@ -799,7 +799,7 @@ _ol_interaction_Modify_.handleUpEvent_ = function(evt) {
|
||||
* @api
|
||||
*/
|
||||
_ol_interaction_Modify_.handleEvent = function(mapBrowserEvent) {
|
||||
if (!(mapBrowserEvent instanceof _ol_MapBrowserPointerEvent_)) {
|
||||
if (!(mapBrowserEvent instanceof MapBrowserPointerEvent)) {
|
||||
return true;
|
||||
}
|
||||
this.lastPointerEvent_ = mapBrowserEvent;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import {inherits, nullFunction} from '../index.js';
|
||||
import {FALSE} from '../functions.js';
|
||||
import MapBrowserEventType from '../MapBrowserEventType.js';
|
||||
import _ol_MapBrowserPointerEvent_ from '../MapBrowserPointerEvent.js';
|
||||
import MapBrowserPointerEvent from '../MapBrowserPointerEvent.js';
|
||||
import _ol_interaction_Interaction_ from '../interaction/Interaction.js';
|
||||
import _ol_obj_ from '../obj.js';
|
||||
|
||||
@@ -178,7 +178,7 @@ _ol_interaction_Pointer_.handleMoveEvent = nullFunction;
|
||||
* @api
|
||||
*/
|
||||
_ol_interaction_Pointer_.handleEvent = function(mapBrowserEvent) {
|
||||
if (!(mapBrowserEvent instanceof _ol_MapBrowserPointerEvent_)) {
|
||||
if (!(mapBrowserEvent instanceof MapBrowserPointerEvent)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user