PinchRotate interaction sets/unsets interacting hint
This commit is contained in:
@@ -5,6 +5,7 @@ goog.provide('ol.interaction.PinchRotate');
|
|||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.style');
|
goog.require('goog.style');
|
||||||
goog.require('ol.Coordinate');
|
goog.require('ol.Coordinate');
|
||||||
|
goog.require('ol.ViewHint');
|
||||||
goog.require('ol.interaction.Interaction');
|
goog.require('ol.interaction.Interaction');
|
||||||
goog.require('ol.interaction.Pointer');
|
goog.require('ol.interaction.Pointer');
|
||||||
|
|
||||||
@@ -122,12 +123,14 @@ ol.interaction.PinchRotate.prototype.handlePointerUp =
|
|||||||
function(mapBrowserEvent) {
|
function(mapBrowserEvent) {
|
||||||
if (this.targetPointers.length < 2) {
|
if (this.targetPointers.length < 2) {
|
||||||
var map = mapBrowserEvent.map;
|
var map = mapBrowserEvent.map;
|
||||||
// FIXME works for View2D only
|
var view = map.getView();
|
||||||
var view = map.getView().getView2D();
|
view.setHint(ol.ViewHint.INTERACTING, -1);
|
||||||
var view2DState = view.getView2DState();
|
|
||||||
if (this.rotating_) {
|
if (this.rotating_) {
|
||||||
|
// FIXME works for View2D only
|
||||||
|
var view2D = view.getView2D();
|
||||||
|
var view2DState = view2D.getView2DState();
|
||||||
ol.interaction.Interaction.rotate(
|
ol.interaction.Interaction.rotate(
|
||||||
map, view, view2DState.rotation, this.anchor_,
|
map, view2D, view2DState.rotation, this.anchor_,
|
||||||
ol.interaction.ROTATE_ANIMATION_DURATION);
|
ol.interaction.ROTATE_ANIMATION_DURATION);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -148,6 +151,9 @@ ol.interaction.PinchRotate.prototype.handlePointerDown =
|
|||||||
this.lastAngle_ = undefined;
|
this.lastAngle_ = undefined;
|
||||||
this.rotating_ = false;
|
this.rotating_ = false;
|
||||||
this.rotationDelta_ = 0.0;
|
this.rotationDelta_ = 0.0;
|
||||||
|
if (!this.handlingDownUpSequence) {
|
||||||
|
map.getView().setHint(ol.ViewHint.INTERACTING, 1);
|
||||||
|
}
|
||||||
map.render();
|
map.render();
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user