Use view2DState in ol.interaction.Drag
This commit is contained in:
@@ -119,11 +119,12 @@ ol.interaction.Drag.prototype.handleMapBrowserEvent =
|
|||||||
}
|
}
|
||||||
} else if (mapBrowserEvent.type == ol.MapBrowserEvent.EventType.DRAGSTART) {
|
} else if (mapBrowserEvent.type == ol.MapBrowserEvent.EventType.DRAGSTART) {
|
||||||
goog.asserts.assertInstanceof(browserEvent, goog.events.BrowserEvent);
|
goog.asserts.assertInstanceof(browserEvent, goog.events.BrowserEvent);
|
||||||
|
var view2DState = view.getView2D().getView2DState();
|
||||||
this.startX = browserEvent.clientX;
|
this.startX = browserEvent.clientX;
|
||||||
this.startY = browserEvent.clientY;
|
this.startY = browserEvent.clientY;
|
||||||
this.deltaX = 0;
|
this.deltaX = 0;
|
||||||
this.deltaY = 0;
|
this.deltaY = 0;
|
||||||
this.startCenter = /** @type {!ol.Coordinate} */ (view.getCenter());
|
this.startCenter = view2DState.center;
|
||||||
this.startCoordinate = /** @type {ol.Coordinate} */
|
this.startCoordinate = /** @type {ol.Coordinate} */
|
||||||
(mapBrowserEvent.getCoordinate());
|
(mapBrowserEvent.getCoordinate());
|
||||||
var handled = this.handleDragStart(mapBrowserEvent);
|
var handled = this.handleDragStart(mapBrowserEvent);
|
||||||
|
|||||||
Reference in New Issue
Block a user