Add Hint and Property as ol.View properties

This commit is contained in:
Tim Schaub
2016-08-12 06:42:58 -06:00
parent 9cbbdc9242
commit 3afb42828f
19 changed files with 105 additions and 106 deletions

View File

@@ -1,9 +1,9 @@
goog.provide('ol.interaction.DragPan');
goog.require('ol.ViewHint');
goog.require('ol.View');
goog.require('ol.coordinate');
goog.require('ol.functions');
goog.require('ol.events.condition');
goog.require('ol.functions');
goog.require('ol.interaction.Pointer');
@@ -115,7 +115,7 @@ ol.interaction.DragPan.handleUpEvent_ = function(mapBrowserEvent) {
dest = view.constrainCenter(dest);
view.setCenter(dest);
}
view.setHint(ol.ViewHint.INTERACTING, -1);
view.setHint(ol.View.Hint.INTERACTING, -1);
map.render();
return false;
} else {
@@ -137,7 +137,7 @@ ol.interaction.DragPan.handleDownEvent_ = function(mapBrowserEvent) {
var view = map.getView();
this.lastCentroid = null;
if (!this.handlingDownUpSequence) {
view.setHint(ol.ViewHint.INTERACTING, 1);
view.setHint(ol.View.Hint.INTERACTING, 1);
}
map.render();
if (this.kineticPreRenderFn_ &&

View File

@@ -1,9 +1,9 @@
goog.provide('ol.interaction.DragRotate');
goog.require('ol');
goog.require('ol.ViewHint');
goog.require('ol.functions');
goog.require('ol.View');
goog.require('ol.events.condition');
goog.require('ol.functions');
goog.require('ol.interaction.Interaction');
goog.require('ol.interaction.Pointer');
@@ -93,7 +93,7 @@ ol.interaction.DragRotate.handleUpEvent_ = function(mapBrowserEvent) {
var map = mapBrowserEvent.map;
var view = map.getView();
view.setHint(ol.ViewHint.INTERACTING, -1);
view.setHint(ol.View.Hint.INTERACTING, -1);
var rotation = view.getRotation();
ol.interaction.Interaction.rotate(map, view, rotation,
undefined, this.duration_);
@@ -115,7 +115,7 @@ ol.interaction.DragRotate.handleDownEvent_ = function(mapBrowserEvent) {
if (ol.events.condition.mouseActionButton(mapBrowserEvent) &&
this.condition_(mapBrowserEvent)) {
var map = mapBrowserEvent.map;
map.getView().setHint(ol.ViewHint.INTERACTING, 1);
map.getView().setHint(ol.View.Hint.INTERACTING, 1);
map.render();
this.lastAngle_ = undefined;
return true;

View File

@@ -1,7 +1,7 @@
goog.provide('ol.interaction.DragRotateAndZoom');
goog.require('ol');
goog.require('ol.ViewHint');
goog.require('ol.View');
goog.require('ol.events.condition');
goog.require('ol.interaction.Interaction');
goog.require('ol.interaction.Pointer');
@@ -116,7 +116,7 @@ ol.interaction.DragRotateAndZoom.handleUpEvent_ = function(mapBrowserEvent) {
var map = mapBrowserEvent.map;
var view = map.getView();
view.setHint(ol.ViewHint.INTERACTING, -1);
view.setHint(ol.View.Hint.INTERACTING, -1);
var direction = this.lastScaleDelta_ - 1;
ol.interaction.Interaction.rotate(map, view, view.getRotation());
ol.interaction.Interaction.zoom(map, view, view.getResolution(),
@@ -138,7 +138,7 @@ ol.interaction.DragRotateAndZoom.handleDownEvent_ = function(mapBrowserEvent) {
}
if (this.condition_(mapBrowserEvent)) {
mapBrowserEvent.map.getView().setHint(ol.ViewHint.INTERACTING, 1);
mapBrowserEvent.map.getView().setHint(ol.View.Hint.INTERACTING, 1);
this.lastAngle_ = undefined;
this.lastMagnitude_ = undefined;
return true;

View File

@@ -1,17 +1,17 @@
goog.provide('ol.interaction.Modify');
goog.provide('ol.interaction.ModifyEvent');
goog.require('ol.events');
goog.require('ol.events.Event');
goog.require('ol.events.EventType');
goog.require('ol');
goog.require('ol.Collection');
goog.require('ol.Feature');
goog.require('ol.MapBrowserEvent.EventType');
goog.require('ol.MapBrowserPointerEvent');
goog.require('ol.ViewHint');
goog.require('ol.View');
goog.require('ol.array');
goog.require('ol.coordinate');
goog.require('ol.events');
goog.require('ol.events.Event');
goog.require('ol.events.EventType');
goog.require('ol.events.condition');
goog.require('ol.extent');
goog.require('ol.geom.GeometryType');
@@ -696,7 +696,7 @@ ol.interaction.Modify.handleEvent = function(mapBrowserEvent) {
this.lastPointerEvent_ = mapBrowserEvent;
var handled;
if (!mapBrowserEvent.map.getView().getHints()[ol.ViewHint.INTERACTING] &&
if (!mapBrowserEvent.map.getView().getHints()[ol.View.Hint.INTERACTING] &&
mapBrowserEvent.type == ol.MapBrowserEvent.EventType.POINTERMOVE &&
!this.handlingDownUpSequence) {
this.handlePointerMove_(mapBrowserEvent);

View File

@@ -1,8 +1,8 @@
goog.provide('ol.interaction.PinchRotate');
goog.require('ol');
goog.require('ol.View');
goog.require('ol.functions');
goog.require('ol.ViewHint');
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.ViewHint.INTERACTING, -1);
view.setHint(ol.View.Hint.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.ViewHint.INTERACTING, 1);
map.getView().setHint(ol.View.Hint.INTERACTING, 1);
}
map.render();
return true;

View File

@@ -1,8 +1,8 @@
goog.provide('ol.interaction.PinchZoom');
goog.require('ol');
goog.require('ol.View');
goog.require('ol.functions');
goog.require('ol.ViewHint');
goog.require('ol.interaction.Interaction');
goog.require('ol.interaction.Pointer');
@@ -110,7 +110,7 @@ ol.interaction.PinchZoom.handleUpEvent_ = function(mapBrowserEvent) {
if (this.targetPointers.length < 2) {
var map = mapBrowserEvent.map;
var view = map.getView();
view.setHint(ol.ViewHint.INTERACTING, -1);
view.setHint(ol.View.Hint.INTERACTING, -1);
var resolution = view.getResolution();
// Zoom to final resolution, with an animation, and provide a
// direction not to zoom out/in if user was pinching in/out.
@@ -138,7 +138,7 @@ ol.interaction.PinchZoom.handleDownEvent_ = function(mapBrowserEvent) {
this.lastDistance_ = undefined;
this.lastScaleDelta_ = 1;
if (!this.handlingDownUpSequence) {
map.getView().setHint(ol.ViewHint.INTERACTING, 1);
map.getView().setHint(ol.View.Hint.INTERACTING, 1);
}
map.render();
return true;