Rename _ol_interaction_Pointer_ to PointerInteraction
This commit is contained in:
@@ -6,7 +6,7 @@ import LineString from '../src/ol/geom/LineString.js';
|
|||||||
import Point from '../src/ol/geom/Point.js';
|
import Point from '../src/ol/geom/Point.js';
|
||||||
import Polygon from '../src/ol/geom/Polygon.js';
|
import Polygon from '../src/ol/geom/Polygon.js';
|
||||||
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
import {defaults as defaultInteractions} from '../src/ol/interaction.js';
|
||||||
import _ol_interaction_Pointer_ from '../src/ol/interaction/Pointer.js';
|
import PointerInteraction from '../src/ol/interaction/Pointer.js';
|
||||||
import TileLayer from '../src/ol/layer/Tile.js';
|
import TileLayer from '../src/ol/layer/Tile.js';
|
||||||
import VectorLayer from '../src/ol/layer/Vector.js';
|
import VectorLayer from '../src/ol/layer/Vector.js';
|
||||||
import TileJSON from '../src/ol/source/TileJSON.js';
|
import TileJSON from '../src/ol/source/TileJSON.js';
|
||||||
@@ -29,7 +29,7 @@ var app = {};
|
|||||||
*/
|
*/
|
||||||
app.Drag = function() {
|
app.Drag = function() {
|
||||||
|
|
||||||
_ol_interaction_Pointer_.call(this, {
|
PointerInteraction.call(this, {
|
||||||
handleDownEvent: app.Drag.prototype.handleDownEvent,
|
handleDownEvent: app.Drag.prototype.handleDownEvent,
|
||||||
handleDragEvent: app.Drag.prototype.handleDragEvent,
|
handleDragEvent: app.Drag.prototype.handleDragEvent,
|
||||||
handleMoveEvent: app.Drag.prototype.handleMoveEvent,
|
handleMoveEvent: app.Drag.prototype.handleMoveEvent,
|
||||||
@@ -61,7 +61,7 @@ app.Drag = function() {
|
|||||||
this.previousCursor_ = undefined;
|
this.previousCursor_ = undefined;
|
||||||
|
|
||||||
};
|
};
|
||||||
inherits(app.Drag, _ol_interaction_Pointer_);
|
inherits(app.Drag, PointerInteraction);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
import Event from '../events/Event.js';
|
import Event from '../events/Event.js';
|
||||||
import {inherits, nullFunction} from '../index.js';
|
import {inherits, nullFunction} from '../index.js';
|
||||||
import _ol_events_condition_ from '../events/condition.js';
|
import _ol_events_condition_ from '../events/condition.js';
|
||||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
import PointerInteraction from '../interaction/Pointer.js';
|
||||||
import _ol_render_Box_ from '../render/Box.js';
|
import _ol_render_Box_ from '../render/Box.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,7 +27,7 @@ import _ol_render_Box_ from '../render/Box.js';
|
|||||||
*/
|
*/
|
||||||
var DragBox = function(opt_options) {
|
var DragBox = function(opt_options) {
|
||||||
|
|
||||||
_ol_interaction_Pointer_.call(this, {
|
PointerInteraction.call(this, {
|
||||||
handleDownEvent: DragBox.handleDownEvent_,
|
handleDownEvent: DragBox.handleDownEvent_,
|
||||||
handleDragEvent: DragBox.handleDragEvent_,
|
handleDragEvent: DragBox.handleDragEvent_,
|
||||||
handleUpEvent: DragBox.handleUpEvent_
|
handleUpEvent: DragBox.handleUpEvent_
|
||||||
@@ -68,7 +68,7 @@ var DragBox = function(opt_options) {
|
|||||||
options.boxEndCondition : DragBox.defaultBoxEndCondition;
|
options.boxEndCondition : DragBox.defaultBoxEndCondition;
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(DragBox, _ol_interaction_Pointer_);
|
inherits(DragBox, PointerInteraction);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import _ol_coordinate_ from '../coordinate.js';
|
|||||||
import {easeOut} from '../easing.js';
|
import {easeOut} from '../easing.js';
|
||||||
import _ol_events_condition_ from '../events/condition.js';
|
import _ol_events_condition_ from '../events/condition.js';
|
||||||
import {FALSE} from '../functions.js';
|
import {FALSE} from '../functions.js';
|
||||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
import PointerInteraction from '../interaction/Pointer.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
@@ -20,7 +20,7 @@ import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
|||||||
*/
|
*/
|
||||||
var DragPan = function(opt_options) {
|
var DragPan = function(opt_options) {
|
||||||
|
|
||||||
_ol_interaction_Pointer_.call(this, {
|
PointerInteraction.call(this, {
|
||||||
handleDownEvent: DragPan.handleDownEvent_,
|
handleDownEvent: DragPan.handleDownEvent_,
|
||||||
handleDragEvent: DragPan.handleDragEvent_,
|
handleDragEvent: DragPan.handleDragEvent_,
|
||||||
handleUpEvent: DragPan.handleUpEvent_
|
handleUpEvent: DragPan.handleUpEvent_
|
||||||
@@ -59,7 +59,7 @@ var DragPan = function(opt_options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(DragPan, _ol_interaction_Pointer_);
|
inherits(DragPan, PointerInteraction);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -70,7 +70,7 @@ inherits(DragPan, _ol_interaction_Pointer_);
|
|||||||
DragPan.handleDragEvent_ = function(mapBrowserEvent) {
|
DragPan.handleDragEvent_ = function(mapBrowserEvent) {
|
||||||
var targetPointers = this.targetPointers;
|
var targetPointers = this.targetPointers;
|
||||||
var centroid =
|
var centroid =
|
||||||
_ol_interaction_Pointer_.centroid(targetPointers);
|
PointerInteraction.centroid(targetPointers);
|
||||||
if (targetPointers.length == this.lastPointersCount_) {
|
if (targetPointers.length == this.lastPointersCount_) {
|
||||||
if (this.kinetic_) {
|
if (this.kinetic_) {
|
||||||
this.kinetic_.update(centroid[0], centroid[1]);
|
this.kinetic_.update(centroid[0], centroid[1]);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import ViewHint from '../ViewHint.js';
|
|||||||
import _ol_events_condition_ from '../events/condition.js';
|
import _ol_events_condition_ from '../events/condition.js';
|
||||||
import {FALSE} from '../functions.js';
|
import {FALSE} from '../functions.js';
|
||||||
import Interaction from '../interaction/Interaction.js';
|
import Interaction from '../interaction/Interaction.js';
|
||||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
import PointerInteraction from '../interaction/Pointer.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
@@ -26,7 +26,7 @@ var DragRotate = function(opt_options) {
|
|||||||
|
|
||||||
var options = opt_options ? opt_options : {};
|
var options = opt_options ? opt_options : {};
|
||||||
|
|
||||||
_ol_interaction_Pointer_.call(this, {
|
PointerInteraction.call(this, {
|
||||||
handleDownEvent: DragRotate.handleDownEvent_,
|
handleDownEvent: DragRotate.handleDownEvent_,
|
||||||
handleDragEvent: DragRotate.handleDragEvent_,
|
handleDragEvent: DragRotate.handleDragEvent_,
|
||||||
handleUpEvent: DragRotate.handleUpEvent_
|
handleUpEvent: DragRotate.handleUpEvent_
|
||||||
@@ -52,7 +52,7 @@ var DragRotate = function(opt_options) {
|
|||||||
this.duration_ = options.duration !== undefined ? options.duration : 250;
|
this.duration_ = options.duration !== undefined ? options.duration : 250;
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(DragRotate, _ol_interaction_Pointer_);
|
inherits(DragRotate, PointerInteraction);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import RotationConstraint from '../RotationConstraint.js';
|
|||||||
import ViewHint from '../ViewHint.js';
|
import ViewHint from '../ViewHint.js';
|
||||||
import _ol_events_condition_ from '../events/condition.js';
|
import _ol_events_condition_ from '../events/condition.js';
|
||||||
import Interaction from '../interaction/Interaction.js';
|
import Interaction from '../interaction/Interaction.js';
|
||||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
import PointerInteraction from '../interaction/Pointer.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
@@ -27,7 +27,7 @@ var DragRotateAndZoom = function(opt_options) {
|
|||||||
|
|
||||||
var options = opt_options ? opt_options : {};
|
var options = opt_options ? opt_options : {};
|
||||||
|
|
||||||
_ol_interaction_Pointer_.call(this, {
|
PointerInteraction.call(this, {
|
||||||
handleDownEvent: DragRotateAndZoom.handleDownEvent_,
|
handleDownEvent: DragRotateAndZoom.handleDownEvent_,
|
||||||
handleDragEvent: DragRotateAndZoom.handleDragEvent_,
|
handleDragEvent: DragRotateAndZoom.handleDragEvent_,
|
||||||
handleUpEvent: DragRotateAndZoom.handleUpEvent_
|
handleUpEvent: DragRotateAndZoom.handleUpEvent_
|
||||||
@@ -66,7 +66,7 @@ var DragRotateAndZoom = function(opt_options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(DragRotateAndZoom, _ol_interaction_Pointer_);
|
inherits(DragRotateAndZoom, PointerInteraction);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ import MultiPolygon from '../geom/MultiPolygon.js';
|
|||||||
import Point from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import Polygon, {fromCircle, makeRegular} from '../geom/Polygon.js';
|
import Polygon, {fromCircle, makeRegular} from '../geom/Polygon.js';
|
||||||
import DrawEventType from '../interaction/DrawEventType.js';
|
import DrawEventType from '../interaction/DrawEventType.js';
|
||||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
import PointerInteraction from '../interaction/Pointer.js';
|
||||||
import InteractionProperty from '../interaction/Property.js';
|
import InteractionProperty from '../interaction/Property.js';
|
||||||
import VectorLayer from '../layer/Vector.js';
|
import VectorLayer from '../layer/Vector.js';
|
||||||
import VectorSource from '../source/Vector.js';
|
import VectorSource from '../source/Vector.js';
|
||||||
@@ -38,7 +38,7 @@ import _ol_style_Style_ from '../style/Style.js';
|
|||||||
*/
|
*/
|
||||||
var Draw = function(options) {
|
var Draw = function(options) {
|
||||||
|
|
||||||
_ol_interaction_Pointer_.call(this, {
|
PointerInteraction.call(this, {
|
||||||
handleDownEvent: Draw.handleDownEvent_,
|
handleDownEvent: Draw.handleDownEvent_,
|
||||||
handleEvent: Draw.handleEvent,
|
handleEvent: Draw.handleEvent,
|
||||||
handleUpEvent: Draw.handleUpEvent_
|
handleUpEvent: Draw.handleUpEvent_
|
||||||
@@ -290,7 +290,7 @@ var Draw = function(options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(Draw, _ol_interaction_Pointer_);
|
inherits(Draw, PointerInteraction);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -308,7 +308,7 @@ Draw.getDefaultStyleFunction = function() {
|
|||||||
* @inheritDoc
|
* @inheritDoc
|
||||||
*/
|
*/
|
||||||
Draw.prototype.setMap = function(map) {
|
Draw.prototype.setMap = function(map) {
|
||||||
_ol_interaction_Pointer_.prototype.setMap.call(this, map);
|
PointerInteraction.prototype.setMap.call(this, map);
|
||||||
this.updateState_();
|
this.updateState_();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -337,7 +337,7 @@ Draw.handleEvent = function(event) {
|
|||||||
} else if (event.type === MapBrowserEventType.DBLCLICK) {
|
} else if (event.type === MapBrowserEventType.DBLCLICK) {
|
||||||
pass = false;
|
pass = false;
|
||||||
}
|
}
|
||||||
return _ol_interaction_Pointer_.handleEvent.call(this, event) && pass;
|
return PointerInteraction.handleEvent.call(this, event) && pass;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import GeometryType from '../geom/GeometryType.js';
|
|||||||
import Point from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import {fromExtent as polygonFromExtent} from '../geom/Polygon.js';
|
import {fromExtent as polygonFromExtent} from '../geom/Polygon.js';
|
||||||
import _ol_interaction_ExtentEventType_ from '../interaction/ExtentEventType.js';
|
import _ol_interaction_ExtentEventType_ from '../interaction/ExtentEventType.js';
|
||||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
import PointerInteraction from '../interaction/Pointer.js';
|
||||||
import VectorLayer from '../layer/Vector.js';
|
import VectorLayer from '../layer/Vector.js';
|
||||||
import VectorSource from '../source/Vector.js';
|
import VectorSource from '../source/Vector.js';
|
||||||
import _ol_style_Style_ from '../style/Style.js';
|
import _ol_style_Style_ from '../style/Style.js';
|
||||||
@@ -81,7 +81,7 @@ var _ol_interaction_Extent_ = function(opt_options) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Inherit ol.interaction.Pointer */
|
/* Inherit ol.interaction.Pointer */
|
||||||
_ol_interaction_Pointer_.call(this, {
|
PointerInteraction.call(this, {
|
||||||
handleDownEvent: _ol_interaction_Extent_.handleDownEvent_,
|
handleDownEvent: _ol_interaction_Extent_.handleDownEvent_,
|
||||||
handleDragEvent: _ol_interaction_Extent_.handleDragEvent_,
|
handleDragEvent: _ol_interaction_Extent_.handleDragEvent_,
|
||||||
handleEvent: _ol_interaction_Extent_.handleEvent_,
|
handleEvent: _ol_interaction_Extent_.handleEvent_,
|
||||||
@@ -123,7 +123,7 @@ var _ol_interaction_Extent_ = function(opt_options) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_interaction_Extent_, _ol_interaction_Pointer_);
|
inherits(_ol_interaction_Extent_, PointerInteraction);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.MapBrowserEvent} mapBrowserEvent Event.
|
* @param {ol.MapBrowserEvent} mapBrowserEvent Event.
|
||||||
@@ -140,7 +140,7 @@ _ol_interaction_Extent_.handleEvent_ = function(mapBrowserEvent) {
|
|||||||
this.handlePointerMove_(mapBrowserEvent);
|
this.handlePointerMove_(mapBrowserEvent);
|
||||||
}
|
}
|
||||||
//call pointer to determine up/down/drag
|
//call pointer to determine up/down/drag
|
||||||
_ol_interaction_Pointer_.handleEvent.call(this, mapBrowserEvent);
|
PointerInteraction.handleEvent.call(this, mapBrowserEvent);
|
||||||
//return false to stop propagation
|
//return false to stop propagation
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
@@ -416,7 +416,7 @@ _ol_interaction_Extent_.prototype.createOrUpdatePointerFeature_ = function(verte
|
|||||||
_ol_interaction_Extent_.prototype.setMap = function(map) {
|
_ol_interaction_Extent_.prototype.setMap = function(map) {
|
||||||
this.extentOverlay_.setMap(map);
|
this.extentOverlay_.setMap(map);
|
||||||
this.vertexOverlay_.setMap(map);
|
this.vertexOverlay_.setMap(map);
|
||||||
_ol_interaction_Pointer_.prototype.setMap.call(this, map);
|
PointerInteraction.prototype.setMap.call(this, map);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ import {boundingExtent, buffer, createOrUpdateFromCoordinate} from '../extent.js
|
|||||||
import GeometryType from '../geom/GeometryType.js';
|
import GeometryType from '../geom/GeometryType.js';
|
||||||
import Point from '../geom/Point.js';
|
import Point from '../geom/Point.js';
|
||||||
import _ol_interaction_ModifyEventType_ from '../interaction/ModifyEventType.js';
|
import _ol_interaction_ModifyEventType_ from '../interaction/ModifyEventType.js';
|
||||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
import PointerInteraction from '../interaction/Pointer.js';
|
||||||
import VectorLayer from '../layer/Vector.js';
|
import VectorLayer from '../layer/Vector.js';
|
||||||
import VectorSource from '../source/Vector.js';
|
import VectorSource from '../source/Vector.js';
|
||||||
import VectorEventType from '../source/VectorEventType.js';
|
import VectorEventType from '../source/VectorEventType.js';
|
||||||
@@ -45,7 +45,7 @@ import _ol_style_Style_ from '../style/Style.js';
|
|||||||
*/
|
*/
|
||||||
var _ol_interaction_Modify_ = function(options) {
|
var _ol_interaction_Modify_ = function(options) {
|
||||||
|
|
||||||
_ol_interaction_Pointer_.call(this, {
|
PointerInteraction.call(this, {
|
||||||
handleDownEvent: _ol_interaction_Modify_.handleDownEvent_,
|
handleDownEvent: _ol_interaction_Modify_.handleDownEvent_,
|
||||||
handleDragEvent: _ol_interaction_Modify_.handleDragEvent_,
|
handleDragEvent: _ol_interaction_Modify_.handleDragEvent_,
|
||||||
handleEvent: _ol_interaction_Modify_.handleEvent,
|
handleEvent: _ol_interaction_Modify_.handleEvent,
|
||||||
@@ -227,7 +227,7 @@ var _ol_interaction_Modify_ = function(options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_interaction_Modify_, _ol_interaction_Pointer_);
|
inherits(_ol_interaction_Modify_, PointerInteraction);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -321,7 +321,7 @@ _ol_interaction_Modify_.prototype.setActive = function(active) {
|
|||||||
this.overlay_.getSource().removeFeature(this.vertexFeature_);
|
this.overlay_.getSource().removeFeature(this.vertexFeature_);
|
||||||
this.vertexFeature_ = null;
|
this.vertexFeature_ = null;
|
||||||
}
|
}
|
||||||
_ol_interaction_Pointer_.prototype.setActive.call(this, active);
|
PointerInteraction.prototype.setActive.call(this, active);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -330,7 +330,7 @@ _ol_interaction_Modify_.prototype.setActive = function(active) {
|
|||||||
*/
|
*/
|
||||||
_ol_interaction_Modify_.prototype.setMap = function(map) {
|
_ol_interaction_Modify_.prototype.setMap = function(map) {
|
||||||
this.overlay_.setMap(map);
|
this.overlay_.setMap(map);
|
||||||
_ol_interaction_Pointer_.prototype.setMap.call(this, map);
|
PointerInteraction.prototype.setMap.call(this, map);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -823,7 +823,7 @@ _ol_interaction_Modify_.handleEvent = function(mapBrowserEvent) {
|
|||||||
this.ignoreNextSingleClick_ = false;
|
this.ignoreNextSingleClick_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return _ol_interaction_Pointer_.handleEvent.call(this, mapBrowserEvent) &&
|
return PointerInteraction.handleEvent.call(this, mapBrowserEvent) &&
|
||||||
!handled;
|
!handled;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {inherits} from '../index.js';
|
|||||||
import ViewHint from '../ViewHint.js';
|
import ViewHint from '../ViewHint.js';
|
||||||
import {FALSE} from '../functions.js';
|
import {FALSE} from '../functions.js';
|
||||||
import Interaction from '../interaction/Interaction.js';
|
import Interaction from '../interaction/Interaction.js';
|
||||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
import PointerInteraction from '../interaction/Pointer.js';
|
||||||
import RotationConstraint from '../RotationConstraint.js';
|
import RotationConstraint from '../RotationConstraint.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -20,7 +20,7 @@ import RotationConstraint from '../RotationConstraint.js';
|
|||||||
*/
|
*/
|
||||||
var PinchRotate = function(opt_options) {
|
var PinchRotate = function(opt_options) {
|
||||||
|
|
||||||
_ol_interaction_Pointer_.call(this, {
|
PointerInteraction.call(this, {
|
||||||
handleDownEvent: PinchRotate.handleDownEvent_,
|
handleDownEvent: PinchRotate.handleDownEvent_,
|
||||||
handleDragEvent: PinchRotate.handleDragEvent_,
|
handleDragEvent: PinchRotate.handleDragEvent_,
|
||||||
handleUpEvent: PinchRotate.handleUpEvent_
|
handleUpEvent: PinchRotate.handleUpEvent_
|
||||||
@@ -66,7 +66,7 @@ var PinchRotate = function(opt_options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(PinchRotate, _ol_interaction_Pointer_);
|
inherits(PinchRotate, PointerInteraction);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -106,7 +106,7 @@ PinchRotate.handleDragEvent_ = function(mapBrowserEvent) {
|
|||||||
// FIXME: should be the intersection point between the lines:
|
// FIXME: should be the intersection point between the lines:
|
||||||
// touch0,touch1 and previousTouch0,previousTouch1
|
// touch0,touch1 and previousTouch0,previousTouch1
|
||||||
var viewportPosition = map.getViewport().getBoundingClientRect();
|
var viewportPosition = map.getViewport().getBoundingClientRect();
|
||||||
var centroid = _ol_interaction_Pointer_.centroid(this.targetPointers);
|
var centroid = PointerInteraction.centroid(this.targetPointers);
|
||||||
centroid[0] -= viewportPosition.left;
|
centroid[0] -= viewportPosition.left;
|
||||||
centroid[1] -= viewportPosition.top;
|
centroid[1] -= viewportPosition.top;
|
||||||
this.anchor_ = map.getCoordinateFromPixel(centroid);
|
this.anchor_ = map.getCoordinateFromPixel(centroid);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {inherits} from '../index.js';
|
|||||||
import ViewHint from '../ViewHint.js';
|
import ViewHint from '../ViewHint.js';
|
||||||
import {FALSE} from '../functions.js';
|
import {FALSE} from '../functions.js';
|
||||||
import Interaction from '../interaction/Interaction.js';
|
import Interaction from '../interaction/Interaction.js';
|
||||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
import PointerInteraction from '../interaction/Pointer.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
@@ -19,7 +19,7 @@ import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
|||||||
*/
|
*/
|
||||||
var PinchZoom = function(opt_options) {
|
var PinchZoom = function(opt_options) {
|
||||||
|
|
||||||
_ol_interaction_Pointer_.call(this, {
|
PointerInteraction.call(this, {
|
||||||
handleDownEvent: PinchZoom.handleDownEvent_,
|
handleDownEvent: PinchZoom.handleDownEvent_,
|
||||||
handleDragEvent: PinchZoom.handleDragEvent_,
|
handleDragEvent: PinchZoom.handleDragEvent_,
|
||||||
handleUpEvent: PinchZoom.handleUpEvent_
|
handleUpEvent: PinchZoom.handleUpEvent_
|
||||||
@@ -59,7 +59,7 @@ var PinchZoom = function(opt_options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(PinchZoom, _ol_interaction_Pointer_);
|
inherits(PinchZoom, PointerInteraction);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -104,7 +104,7 @@ PinchZoom.handleDragEvent_ = function(mapBrowserEvent) {
|
|||||||
|
|
||||||
// scale anchor point.
|
// scale anchor point.
|
||||||
var viewportPosition = map.getViewport().getBoundingClientRect();
|
var viewportPosition = map.getViewport().getBoundingClientRect();
|
||||||
var centroid = _ol_interaction_Pointer_.centroid(this.targetPointers);
|
var centroid = PointerInteraction.centroid(this.targetPointers);
|
||||||
centroid[0] -= viewportPosition.left;
|
centroid[0] -= viewportPosition.left;
|
||||||
centroid[1] -= viewportPosition.top;
|
centroid[1] -= viewportPosition.top;
|
||||||
this.anchor_ = map.getCoordinateFromPixel(centroid);
|
this.anchor_ = map.getCoordinateFromPixel(centroid);
|
||||||
|
|||||||
@@ -23,12 +23,12 @@ import _ol_obj_ from '../obj.js';
|
|||||||
* @extends {ol.interaction.Interaction}
|
* @extends {ol.interaction.Interaction}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
var _ol_interaction_Pointer_ = function(opt_options) {
|
var PointerInteraction = function(opt_options) {
|
||||||
|
|
||||||
var options = opt_options ? opt_options : {};
|
var options = opt_options ? opt_options : {};
|
||||||
|
|
||||||
var handleEvent = options.handleEvent ?
|
var handleEvent = options.handleEvent ?
|
||||||
options.handleEvent : _ol_interaction_Pointer_.handleEvent;
|
options.handleEvent : PointerInteraction.handleEvent;
|
||||||
|
|
||||||
Interaction.call(this, {
|
Interaction.call(this, {
|
||||||
handleEvent: handleEvent
|
handleEvent: handleEvent
|
||||||
@@ -39,28 +39,28 @@ var _ol_interaction_Pointer_ = function(opt_options) {
|
|||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.handleDownEvent_ = options.handleDownEvent ?
|
this.handleDownEvent_ = options.handleDownEvent ?
|
||||||
options.handleDownEvent : _ol_interaction_Pointer_.handleDownEvent;
|
options.handleDownEvent : PointerInteraction.handleDownEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {function(ol.MapBrowserPointerEvent)}
|
* @type {function(ol.MapBrowserPointerEvent)}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.handleDragEvent_ = options.handleDragEvent ?
|
this.handleDragEvent_ = options.handleDragEvent ?
|
||||||
options.handleDragEvent : _ol_interaction_Pointer_.handleDragEvent;
|
options.handleDragEvent : PointerInteraction.handleDragEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {function(ol.MapBrowserPointerEvent)}
|
* @type {function(ol.MapBrowserPointerEvent)}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.handleMoveEvent_ = options.handleMoveEvent ?
|
this.handleMoveEvent_ = options.handleMoveEvent ?
|
||||||
options.handleMoveEvent : _ol_interaction_Pointer_.handleMoveEvent;
|
options.handleMoveEvent : PointerInteraction.handleMoveEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {function(ol.MapBrowserPointerEvent):boolean}
|
* @type {function(ol.MapBrowserPointerEvent):boolean}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.handleUpEvent_ = options.handleUpEvent ?
|
this.handleUpEvent_ = options.handleUpEvent ?
|
||||||
options.handleUpEvent : _ol_interaction_Pointer_.handleUpEvent;
|
options.handleUpEvent : PointerInteraction.handleUpEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
@@ -82,14 +82,14 @@ var _ol_interaction_Pointer_ = function(opt_options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_interaction_Pointer_, Interaction);
|
inherits(PointerInteraction, Interaction);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Array.<ol.pointer.PointerEvent>} pointerEvents List of events.
|
* @param {Array.<ol.pointer.PointerEvent>} pointerEvents List of events.
|
||||||
* @return {ol.Pixel} Centroid pixel.
|
* @return {ol.Pixel} Centroid pixel.
|
||||||
*/
|
*/
|
||||||
_ol_interaction_Pointer_.centroid = function(pointerEvents) {
|
PointerInteraction.centroid = function(pointerEvents) {
|
||||||
var length = pointerEvents.length;
|
var length = pointerEvents.length;
|
||||||
var clientX = 0;
|
var clientX = 0;
|
||||||
var clientY = 0;
|
var clientY = 0;
|
||||||
@@ -107,7 +107,7 @@ _ol_interaction_Pointer_.centroid = function(pointerEvents) {
|
|||||||
* or pointerup event.
|
* or pointerup event.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_interaction_Pointer_.prototype.isPointerDraggingEvent_ = function(mapBrowserEvent) {
|
PointerInteraction.prototype.isPointerDraggingEvent_ = function(mapBrowserEvent) {
|
||||||
var type = mapBrowserEvent.type;
|
var type = mapBrowserEvent.type;
|
||||||
return type === MapBrowserEventType.POINTERDOWN ||
|
return type === MapBrowserEventType.POINTERDOWN ||
|
||||||
type === MapBrowserEventType.POINTERDRAG ||
|
type === MapBrowserEventType.POINTERDRAG ||
|
||||||
@@ -119,7 +119,7 @@ _ol_interaction_Pointer_.prototype.isPointerDraggingEvent_ = function(mapBrowser
|
|||||||
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
_ol_interaction_Pointer_.prototype.updateTrackedPointers_ = function(mapBrowserEvent) {
|
PointerInteraction.prototype.updateTrackedPointers_ = function(mapBrowserEvent) {
|
||||||
if (this.isPointerDraggingEvent_(mapBrowserEvent)) {
|
if (this.isPointerDraggingEvent_(mapBrowserEvent)) {
|
||||||
var event = mapBrowserEvent.pointerEvent;
|
var event = mapBrowserEvent.pointerEvent;
|
||||||
|
|
||||||
@@ -142,7 +142,7 @@ _ol_interaction_Pointer_.prototype.updateTrackedPointers_ = function(mapBrowserE
|
|||||||
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||||
* @this {ol.interaction.Pointer}
|
* @this {ol.interaction.Pointer}
|
||||||
*/
|
*/
|
||||||
_ol_interaction_Pointer_.handleDragEvent = nullFunction;
|
PointerInteraction.handleDragEvent = nullFunction;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -150,7 +150,7 @@ _ol_interaction_Pointer_.handleDragEvent = nullFunction;
|
|||||||
* @return {boolean} Capture dragging.
|
* @return {boolean} Capture dragging.
|
||||||
* @this {ol.interaction.Pointer}
|
* @this {ol.interaction.Pointer}
|
||||||
*/
|
*/
|
||||||
_ol_interaction_Pointer_.handleUpEvent = FALSE;
|
PointerInteraction.handleUpEvent = FALSE;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -158,14 +158,14 @@ _ol_interaction_Pointer_.handleUpEvent = FALSE;
|
|||||||
* @return {boolean} Capture dragging.
|
* @return {boolean} Capture dragging.
|
||||||
* @this {ol.interaction.Pointer}
|
* @this {ol.interaction.Pointer}
|
||||||
*/
|
*/
|
||||||
_ol_interaction_Pointer_.handleDownEvent = FALSE;
|
PointerInteraction.handleDownEvent = FALSE;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
* @param {ol.MapBrowserPointerEvent} mapBrowserEvent Event.
|
||||||
* @this {ol.interaction.Pointer}
|
* @this {ol.interaction.Pointer}
|
||||||
*/
|
*/
|
||||||
_ol_interaction_Pointer_.handleMoveEvent = nullFunction;
|
PointerInteraction.handleMoveEvent = nullFunction;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -177,7 +177,7 @@ _ol_interaction_Pointer_.handleMoveEvent = nullFunction;
|
|||||||
* @this {ol.interaction.Pointer}
|
* @this {ol.interaction.Pointer}
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_interaction_Pointer_.handleEvent = function(mapBrowserEvent) {
|
PointerInteraction.handleEvent = function(mapBrowserEvent) {
|
||||||
if (!(mapBrowserEvent instanceof MapBrowserPointerEvent)) {
|
if (!(mapBrowserEvent instanceof MapBrowserPointerEvent)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -217,8 +217,8 @@ _ol_interaction_Pointer_.handleEvent = function(mapBrowserEvent) {
|
|||||||
* @return {boolean} Should the event be stopped?
|
* @return {boolean} Should the event be stopped?
|
||||||
* @protected
|
* @protected
|
||||||
*/
|
*/
|
||||||
_ol_interaction_Pointer_.prototype.shouldStopEvent = function(handled) {
|
PointerInteraction.prototype.shouldStopEvent = function(handled) {
|
||||||
return handled;
|
return handled;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default _ol_interaction_Pointer_;
|
export default PointerInteraction;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {boundingExtent, createEmpty} from '../extent.js';
|
|||||||
import {TRUE, FALSE} from '../functions.js';
|
import {TRUE, FALSE} from '../functions.js';
|
||||||
import GeometryType from '../geom/GeometryType.js';
|
import GeometryType from '../geom/GeometryType.js';
|
||||||
import {fromCircle} from '../geom/Polygon.js';
|
import {fromCircle} from '../geom/Polygon.js';
|
||||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
import PointerInteraction from '../interaction/Pointer.js';
|
||||||
import _ol_obj_ from '../obj.js';
|
import _ol_obj_ from '../obj.js';
|
||||||
import VectorSource from '../source/Vector.js';
|
import VectorSource from '../source/Vector.js';
|
||||||
import VectorEventType from '../source/VectorEventType.js';
|
import VectorEventType from '../source/VectorEventType.js';
|
||||||
@@ -41,7 +41,7 @@ import RBush from '../structs/RBush.js';
|
|||||||
*/
|
*/
|
||||||
var _ol_interaction_Snap_ = function(opt_options) {
|
var _ol_interaction_Snap_ = function(opt_options) {
|
||||||
|
|
||||||
_ol_interaction_Pointer_.call(this, {
|
PointerInteraction.call(this, {
|
||||||
handleEvent: _ol_interaction_Snap_.handleEvent_,
|
handleEvent: _ol_interaction_Snap_.handleEvent_,
|
||||||
handleDownEvent: TRUE,
|
handleDownEvent: TRUE,
|
||||||
handleUpEvent: _ol_interaction_Snap_.handleUpEvent_
|
handleUpEvent: _ol_interaction_Snap_.handleUpEvent_
|
||||||
@@ -149,7 +149,7 @@ var _ol_interaction_Snap_ = function(opt_options) {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_interaction_Snap_, _ol_interaction_Pointer_);
|
inherits(_ol_interaction_Snap_, PointerInteraction);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -304,7 +304,7 @@ _ol_interaction_Snap_.prototype.setMap = function(map) {
|
|||||||
keys.length = 0;
|
keys.length = 0;
|
||||||
features.forEach(this.forEachFeatureRemove_.bind(this));
|
features.forEach(this.forEachFeatureRemove_.bind(this));
|
||||||
}
|
}
|
||||||
_ol_interaction_Pointer_.prototype.setMap.call(this, map);
|
PointerInteraction.prototype.setMap.call(this, map);
|
||||||
|
|
||||||
if (map) {
|
if (map) {
|
||||||
if (this.features_) {
|
if (this.features_) {
|
||||||
@@ -600,7 +600,7 @@ _ol_interaction_Snap_.handleEvent_ = function(evt) {
|
|||||||
evt.coordinate = result.vertex.slice(0, 2);
|
evt.coordinate = result.vertex.slice(0, 2);
|
||||||
evt.pixel = result.vertexPixel;
|
evt.pixel = result.vertexPixel;
|
||||||
}
|
}
|
||||||
return _ol_interaction_Pointer_.handleEvent.call(this, evt);
|
return PointerInteraction.handleEvent.call(this, evt);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import _ol_events_ from '../events.js';
|
|||||||
import Event from '../events/Event.js';
|
import Event from '../events/Event.js';
|
||||||
import {TRUE} from '../functions.js';
|
import {TRUE} from '../functions.js';
|
||||||
import {includes} from '../array.js';
|
import {includes} from '../array.js';
|
||||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
import PointerInteraction from '../interaction/Pointer.js';
|
||||||
import InteractionProperty from '../interaction/Property.js';
|
import InteractionProperty from '../interaction/Property.js';
|
||||||
import _ol_interaction_TranslateEventType_ from '../interaction/TranslateEventType.js';
|
import _ol_interaction_TranslateEventType_ from '../interaction/TranslateEventType.js';
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ import _ol_interaction_TranslateEventType_ from '../interaction/TranslateEventTy
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
var _ol_interaction_Translate_ = function(opt_options) {
|
var _ol_interaction_Translate_ = function(opt_options) {
|
||||||
_ol_interaction_Pointer_.call(this, {
|
PointerInteraction.call(this, {
|
||||||
handleDownEvent: _ol_interaction_Translate_.handleDownEvent_,
|
handleDownEvent: _ol_interaction_Translate_.handleDownEvent_,
|
||||||
handleDragEvent: _ol_interaction_Translate_.handleDragEvent_,
|
handleDragEvent: _ol_interaction_Translate_.handleDragEvent_,
|
||||||
handleMoveEvent: _ol_interaction_Translate_.handleMoveEvent_,
|
handleMoveEvent: _ol_interaction_Translate_.handleMoveEvent_,
|
||||||
@@ -85,7 +85,7 @@ var _ol_interaction_Translate_ = function(opt_options) {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inherits(_ol_interaction_Translate_, _ol_interaction_Pointer_);
|
inherits(_ol_interaction_Translate_, PointerInteraction);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -231,7 +231,7 @@ _ol_interaction_Translate_.prototype.setHitTolerance = function(hitTolerance) {
|
|||||||
*/
|
*/
|
||||||
_ol_interaction_Translate_.prototype.setMap = function(map) {
|
_ol_interaction_Translate_.prototype.setMap = function(map) {
|
||||||
var oldMap = this.getMap();
|
var oldMap = this.getMap();
|
||||||
_ol_interaction_Pointer_.prototype.setMap.call(this, map);
|
PointerInteraction.prototype.setMap.call(this, map);
|
||||||
this.updateState_(oldMap);
|
this.updateState_(oldMap);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user