Rename olx.View2DState to olx.ViewState and use viewState property
This commit is contained in:
@@ -81,16 +81,16 @@ ol.interaction.DragRotateAndZoom.prototype.handlePointerDrag =
|
||||
var theta = Math.atan2(delta.y, delta.x);
|
||||
var magnitude = delta.magnitude();
|
||||
var view = map.getView();
|
||||
var view2DState = view.getState();
|
||||
var viewState = view.getState();
|
||||
map.render();
|
||||
if (goog.isDef(this.lastAngle_)) {
|
||||
var angleDelta = theta - this.lastAngle_;
|
||||
ol.interaction.Interaction.rotateWithoutConstraints(
|
||||
map, view, view2DState.rotation - angleDelta);
|
||||
map, view, viewState.rotation - angleDelta);
|
||||
}
|
||||
this.lastAngle_ = theta;
|
||||
if (goog.isDef(this.lastMagnitude_)) {
|
||||
var resolution = this.lastMagnitude_ * (view2DState.resolution / magnitude);
|
||||
var resolution = this.lastMagnitude_ * (viewState.resolution / magnitude);
|
||||
ol.interaction.Interaction.zoomWithoutConstraints(map, view, resolution);
|
||||
}
|
||||
if (goog.isDef(this.lastMagnitude_)) {
|
||||
@@ -112,10 +112,10 @@ ol.interaction.DragRotateAndZoom.prototype.handlePointerUp =
|
||||
var map = mapBrowserEvent.map;
|
||||
var view = map.getView();
|
||||
view.setHint(ol.ViewHint.INTERACTING, -1);
|
||||
var view2DState = view.getState();
|
||||
var viewState = view.getState();
|
||||
var direction = this.lastScaleDelta_ - 1;
|
||||
ol.interaction.Interaction.rotate(map, view, view2DState.rotation);
|
||||
ol.interaction.Interaction.zoom(map, view, view2DState.resolution,
|
||||
ol.interaction.Interaction.rotate(map, view, viewState.rotation);
|
||||
ol.interaction.Interaction.zoom(map, view, viewState.resolution,
|
||||
undefined, ol.DRAGROTATEANDZOOM_ANIMATION_DURATION,
|
||||
direction);
|
||||
this.lastScaleDelta_ = 0;
|
||||
|
||||
Reference in New Issue
Block a user