Remove hint enum from view constructor

This commit is contained in:
Tim Schaub
2016-12-27 09:40:53 -07:00
parent 62a0dd5b5b
commit 3852c0da83
18 changed files with 75 additions and 72 deletions
+3 -3
View File
@@ -1,7 +1,7 @@
goog.provide('ol.interaction.DragPan');
goog.require('ol');
goog.require('ol.View');
goog.require('ol.ViewHint');
goog.require('ol.coordinate');
goog.require('ol.easing');
goog.require('ol.events.condition');
@@ -111,7 +111,7 @@ ol.interaction.DragPan.handleUpEvent_ = function(mapBrowserEvent) {
easing: ol.easing.easeOut
});
}
view.setHint(ol.View.Hint.INTERACTING, -1);
view.setHint(ol.ViewHint.INTERACTING, -1);
return false;
} else {
this.lastCentroid = null;
@@ -132,7 +132,7 @@ ol.interaction.DragPan.handleDownEvent_ = function(mapBrowserEvent) {
var view = map.getView();
this.lastCentroid = null;
if (!this.handlingDownUpSequence) {
view.setHint(ol.View.Hint.INTERACTING, 1);
view.setHint(ol.ViewHint.INTERACTING, 1);
}
// stop any current animation
view.setCenter(mapBrowserEvent.frameState.viewState.center);
+3 -3
View File
@@ -1,7 +1,7 @@
goog.provide('ol.interaction.DragRotate');
goog.require('ol');
goog.require('ol.View');
goog.require('ol.ViewHint');
goog.require('ol.events.condition');
goog.require('ol.functions');
goog.require('ol.interaction.Interaction');
@@ -92,7 +92,7 @@ ol.interaction.DragRotate.handleUpEvent_ = function(mapBrowserEvent) {
var map = mapBrowserEvent.map;
var view = map.getView();
view.setHint(ol.View.Hint.INTERACTING, -1);
view.setHint(ol.ViewHint.INTERACTING, -1);
var rotation = view.getRotation();
ol.interaction.Interaction.rotate(map, view, rotation,
undefined, this.duration_);
@@ -114,7 +114,7 @@ ol.interaction.DragRotate.handleDownEvent_ = function(mapBrowserEvent) {
if (ol.events.condition.mouseActionButton(mapBrowserEvent) &&
this.condition_(mapBrowserEvent)) {
var map = mapBrowserEvent.map;
map.getView().setHint(ol.View.Hint.INTERACTING, 1);
map.getView().setHint(ol.ViewHint.INTERACTING, 1);
this.lastAngle_ = undefined;
return true;
} else {
+3 -3
View File
@@ -1,7 +1,7 @@
goog.provide('ol.interaction.DragRotateAndZoom');
goog.require('ol');
goog.require('ol.View');
goog.require('ol.ViewHint');
goog.require('ol.events.condition');
goog.require('ol.interaction.Interaction');
goog.require('ol.interaction.Pointer');
@@ -115,7 +115,7 @@ ol.interaction.DragRotateAndZoom.handleUpEvent_ = function(mapBrowserEvent) {
var map = mapBrowserEvent.map;
var view = map.getView();
view.setHint(ol.View.Hint.INTERACTING, -1);
view.setHint(ol.ViewHint.INTERACTING, -1);
var direction = this.lastScaleDelta_ - 1;
ol.interaction.Interaction.rotate(map, view, view.getRotation());
ol.interaction.Interaction.zoom(map, view, view.getResolution(),
@@ -137,7 +137,7 @@ ol.interaction.DragRotateAndZoom.handleDownEvent_ = function(mapBrowserEvent) {
}
if (this.condition_(mapBrowserEvent)) {
mapBrowserEvent.map.getView().setHint(ol.View.Hint.INTERACTING, 1);
mapBrowserEvent.map.getView().setHint(ol.ViewHint.INTERACTING, 1);
this.lastAngle_ = undefined;
this.lastMagnitude_ = undefined;
return true;
+2 -2
View File
@@ -5,7 +5,7 @@ goog.require('ol.Collection');
goog.require('ol.Feature');
goog.require('ol.MapBrowserEvent');
goog.require('ol.MapBrowserPointerEvent');
goog.require('ol.View');
goog.require('ol.ViewHint');
goog.require('ol.array');
goog.require('ol.coordinate');
goog.require('ol.events');
@@ -655,7 +655,7 @@ ol.interaction.Modify.handleEvent = function(mapBrowserEvent) {
this.lastPointerEvent_ = mapBrowserEvent;
var handled;
if (!mapBrowserEvent.map.getView().getHints()[ol.View.Hint.INTERACTING] &&
if (!mapBrowserEvent.map.getView().getHints()[ol.ViewHint.INTERACTING] &&
mapBrowserEvent.type == ol.MapBrowserEvent.EventType.POINTERMOVE &&
!this.handlingDownUpSequence) {
this.handlePointerMove_(mapBrowserEvent);
+3 -3
View File
@@ -1,7 +1,7 @@
goog.provide('ol.interaction.MouseWheelZoom');
goog.require('ol');
goog.require('ol.View');
goog.require('ol.ViewHint');
goog.require('ol.easing');
goog.require('ol.events.EventType');
goog.require('ol.has');
@@ -167,7 +167,7 @@ ol.interaction.MouseWheelZoom.handleEvent = function(mapBrowserEvent) {
if (this.trackpadTimeoutId_) {
clearTimeout(this.trackpadTimeoutId_);
} else {
view.setHint(ol.View.Hint.INTERACTING, 1);
view.setHint(ol.ViewHint.INTERACTING, 1);
}
this.trackpadTimeoutId_ = setTimeout(this.decrementInteractingHint_.bind(this), this.trackpadEventGap_);
var resolution = view.getResolution() * Math.pow(2, delta / this.trackpadDeltaPerZoom_);
@@ -222,7 +222,7 @@ ol.interaction.MouseWheelZoom.handleEvent = function(mapBrowserEvent) {
ol.interaction.MouseWheelZoom.prototype.decrementInteractingHint_ = function() {
this.trackpadTimeoutId_ = undefined;
var view = this.getMap().getView();
view.setHint(ol.View.Hint.INTERACTING, -1);
view.setHint(ol.ViewHint.INTERACTING, -1);
};
+3 -3
View File
@@ -1,7 +1,7 @@
goog.provide('ol.interaction.PinchRotate');
goog.require('ol');
goog.require('ol.View');
goog.require('ol.ViewHint');
goog.require('ol.functions');
goog.require('ol.interaction.Interaction');
goog.require('ol.interaction.Pointer');
@@ -128,7 +128,7 @@ ol.interaction.PinchRotate.handleUpEvent_ = function(mapBrowserEvent) {
if (this.targetPointers.length < 2) {
var map = mapBrowserEvent.map;
var view = map.getView();
view.setHint(ol.View.Hint.INTERACTING, -1);
view.setHint(ol.ViewHint.INTERACTING, -1);
if (this.rotating_) {
var rotation = view.getRotation();
ol.interaction.Interaction.rotate(
@@ -155,7 +155,7 @@ ol.interaction.PinchRotate.handleDownEvent_ = function(mapBrowserEvent) {
this.rotating_ = false;
this.rotationDelta_ = 0.0;
if (!this.handlingDownUpSequence) {
map.getView().setHint(ol.View.Hint.INTERACTING, 1);
map.getView().setHint(ol.ViewHint.INTERACTING, 1);
}
return true;
} else {
+3 -3
View File
@@ -1,7 +1,7 @@
goog.provide('ol.interaction.PinchZoom');
goog.require('ol');
goog.require('ol.View');
goog.require('ol.ViewHint');
goog.require('ol.functions');
goog.require('ol.interaction.Interaction');
goog.require('ol.interaction.Pointer');
@@ -116,7 +116,7 @@ ol.interaction.PinchZoom.handleUpEvent_ = function(mapBrowserEvent) {
if (this.targetPointers.length < 2) {
var map = mapBrowserEvent.map;
var view = map.getView();
view.setHint(ol.View.Hint.INTERACTING, -1);
view.setHint(ol.ViewHint.INTERACTING, -1);
if (this.constrainResolution_) {
var resolution = view.getResolution();
// Zoom to final resolution, with an animation, and provide a
@@ -146,7 +146,7 @@ ol.interaction.PinchZoom.handleDownEvent_ = function(mapBrowserEvent) {
this.lastDistance_ = undefined;
this.lastScaleDelta_ = 1;
if (!this.handlingDownUpSequence) {
map.getView().setHint(ol.View.Hint.INTERACTING, 1);
map.getView().setHint(ol.ViewHint.INTERACTING, 1);
}
return true;
} else {