Rename _ol_ViewHint_ to ViewHint
This commit is contained in:
@@ -14,7 +14,7 @@ import _ol_Object_ from './Object.js';
|
|||||||
import ObjectEventType from './ObjectEventType.js';
|
import ObjectEventType from './ObjectEventType.js';
|
||||||
import TileQueue from './TileQueue.js';
|
import TileQueue from './TileQueue.js';
|
||||||
import _ol_View_ from './View.js';
|
import _ol_View_ from './View.js';
|
||||||
import _ol_ViewHint_ from './ViewHint.js';
|
import ViewHint from './ViewHint.js';
|
||||||
import {assert} from './asserts.js';
|
import {assert} from './asserts.js';
|
||||||
import {removeNode} from './dom.js';
|
import {removeNode} from './dom.js';
|
||||||
import _ol_events_ from './events.js';
|
import _ol_events_ from './events.js';
|
||||||
@@ -954,11 +954,11 @@ PluggableMap.prototype.handlePostRender = function() {
|
|||||||
var maxNewLoads = maxTotalLoading;
|
var maxNewLoads = maxTotalLoading;
|
||||||
if (frameState) {
|
if (frameState) {
|
||||||
var hints = frameState.viewHints;
|
var hints = frameState.viewHints;
|
||||||
if (hints[_ol_ViewHint_.ANIMATING]) {
|
if (hints[ViewHint.ANIMATING]) {
|
||||||
maxTotalLoading = this.loadTilesWhileAnimating_ ? 8 : 0;
|
maxTotalLoading = this.loadTilesWhileAnimating_ ? 8 : 0;
|
||||||
maxNewLoads = 2;
|
maxNewLoads = 2;
|
||||||
}
|
}
|
||||||
if (hints[_ol_ViewHint_.INTERACTING]) {
|
if (hints[ViewHint.INTERACTING]) {
|
||||||
maxTotalLoading = this.loadTilesWhileInteracting_ ? 8 : 0;
|
maxTotalLoading = this.loadTilesWhileInteracting_ ? 8 : 0;
|
||||||
maxNewLoads = 2;
|
maxNewLoads = 2;
|
||||||
}
|
}
|
||||||
@@ -1260,8 +1260,8 @@ PluggableMap.prototype.renderFrame_ = function(time) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var idle = this.previousExtent_ &&
|
var idle = this.previousExtent_ &&
|
||||||
!frameState.viewHints[_ol_ViewHint_.ANIMATING] &&
|
!frameState.viewHints[ViewHint.ANIMATING] &&
|
||||||
!frameState.viewHints[_ol_ViewHint_.INTERACTING] &&
|
!frameState.viewHints[ViewHint.INTERACTING] &&
|
||||||
!equals(frameState.extent, this.previousExtent_);
|
!equals(frameState.extent, this.previousExtent_);
|
||||||
|
|
||||||
if (idle) {
|
if (idle) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import CenterConstraint from './CenterConstraint.js';
|
|||||||
import _ol_Object_ from './Object.js';
|
import _ol_Object_ from './Object.js';
|
||||||
import ResolutionConstraint from './ResolutionConstraint.js';
|
import ResolutionConstraint from './ResolutionConstraint.js';
|
||||||
import RotationConstraint from './RotationConstraint.js';
|
import RotationConstraint from './RotationConstraint.js';
|
||||||
import _ol_ViewHint_ from './ViewHint.js';
|
import ViewHint from './ViewHint.js';
|
||||||
import _ol_ViewProperty_ from './ViewProperty.js';
|
import _ol_ViewProperty_ from './ViewProperty.js';
|
||||||
import {linearFindNearest} from './array.js';
|
import {linearFindNearest} from './array.js';
|
||||||
import {assert} from './asserts.js';
|
import {assert} from './asserts.js';
|
||||||
@@ -345,7 +345,7 @@ _ol_View_.prototype.animate = function(var_args) {
|
|||||||
series.push(animation);
|
series.push(animation);
|
||||||
}
|
}
|
||||||
this.animations_.push(series);
|
this.animations_.push(series);
|
||||||
this.setHint(_ol_ViewHint_.ANIMATING, 1);
|
this.setHint(ViewHint.ANIMATING, 1);
|
||||||
this.updateAnimations_();
|
this.updateAnimations_();
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -356,7 +356,7 @@ _ol_View_.prototype.animate = function(var_args) {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_View_.prototype.getAnimating = function() {
|
_ol_View_.prototype.getAnimating = function() {
|
||||||
return this.hints_[_ol_ViewHint_.ANIMATING] > 0;
|
return this.hints_[ViewHint.ANIMATING] > 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -366,7 +366,7 @@ _ol_View_.prototype.getAnimating = function() {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_View_.prototype.getInteracting = function() {
|
_ol_View_.prototype.getInteracting = function() {
|
||||||
return this.hints_[_ol_ViewHint_.INTERACTING] > 0;
|
return this.hints_[ViewHint.INTERACTING] > 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -375,7 +375,7 @@ _ol_View_.prototype.getInteracting = function() {
|
|||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
_ol_View_.prototype.cancelAnimations = function() {
|
_ol_View_.prototype.cancelAnimations = function() {
|
||||||
this.setHint(_ol_ViewHint_.ANIMATING, -this.hints_[_ol_ViewHint_.ANIMATING]);
|
this.setHint(ViewHint.ANIMATING, -this.hints_[ViewHint.ANIMATING]);
|
||||||
for (var i = 0, ii = this.animations_.length; i < ii; ++i) {
|
for (var i = 0, ii = this.animations_.length; i < ii; ++i) {
|
||||||
var series = this.animations_[i];
|
var series = this.animations_[i];
|
||||||
if (series[0].callback) {
|
if (series[0].callback) {
|
||||||
@@ -451,7 +451,7 @@ _ol_View_.prototype.updateAnimations_ = function() {
|
|||||||
}
|
}
|
||||||
if (seriesComplete) {
|
if (seriesComplete) {
|
||||||
this.animations_[i] = null;
|
this.animations_[i] = null;
|
||||||
this.setHint(_ol_ViewHint_.ANIMATING, -1);
|
this.setHint(ViewHint.ANIMATING, -1);
|
||||||
var callback = series[0].callback;
|
var callback = series[0].callback;
|
||||||
if (callback) {
|
if (callback) {
|
||||||
callback(true);
|
callback(true);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
// FIXME should possibly show tooltip when dragging?
|
// FIXME should possibly show tooltip when dragging?
|
||||||
|
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_ViewHint_ from '../ViewHint.js';
|
import ViewHint from '../ViewHint.js';
|
||||||
import Control from '../control/Control.js';
|
import Control from '../control/Control.js';
|
||||||
import {CLASS_CONTROL, CLASS_UNSELECTABLE} from '../css.js';
|
import {CLASS_CONTROL, CLASS_UNSELECTABLE} from '../css.js';
|
||||||
import {easeOut} from '../easing.js';
|
import {easeOut} from '../easing.js';
|
||||||
@@ -251,7 +251,7 @@ ZoomSlider.prototype.handleContainerClick_ = function(event) {
|
|||||||
*/
|
*/
|
||||||
ZoomSlider.prototype.handleDraggerStart_ = function(event) {
|
ZoomSlider.prototype.handleDraggerStart_ = function(event) {
|
||||||
if (!this.dragging_ && event.originalEvent.target === this.element.firstElementChild) {
|
if (!this.dragging_ && event.originalEvent.target === this.element.firstElementChild) {
|
||||||
this.getMap().getView().setHint(_ol_ViewHint_.INTERACTING, 1);
|
this.getMap().getView().setHint(ViewHint.INTERACTING, 1);
|
||||||
this.previousX_ = event.clientX;
|
this.previousX_ = event.clientX;
|
||||||
this.previousY_ = event.clientY;
|
this.previousY_ = event.clientY;
|
||||||
this.dragging_ = true;
|
this.dragging_ = true;
|
||||||
@@ -288,7 +288,7 @@ ZoomSlider.prototype.handleDraggerDrag_ = function(event) {
|
|||||||
ZoomSlider.prototype.handleDraggerEnd_ = function(event) {
|
ZoomSlider.prototype.handleDraggerEnd_ = function(event) {
|
||||||
if (this.dragging_) {
|
if (this.dragging_) {
|
||||||
var view = this.getMap().getView();
|
var view = this.getMap().getView();
|
||||||
view.setHint(_ol_ViewHint_.INTERACTING, -1);
|
view.setHint(ViewHint.INTERACTING, -1);
|
||||||
|
|
||||||
view.animate({
|
view.animate({
|
||||||
resolution: view.constrainResolution(this.currentResolution_),
|
resolution: view.constrainResolution(this.currentResolution_),
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @module ol/interaction/DragPan
|
* @module ol/interaction/DragPan
|
||||||
*/
|
*/
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_ViewHint_ from '../ViewHint.js';
|
import ViewHint from '../ViewHint.js';
|
||||||
import _ol_coordinate_ from '../coordinate.js';
|
import _ol_coordinate_ from '../coordinate.js';
|
||||||
import {easeOut} from '../easing.js';
|
import {easeOut} from '../easing.js';
|
||||||
import _ol_events_condition_ from '../events/condition.js';
|
import _ol_events_condition_ from '../events/condition.js';
|
||||||
@@ -123,7 +123,7 @@ DragPan.handleUpEvent_ = function(mapBrowserEvent) {
|
|||||||
easing: easeOut
|
easing: easeOut
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
view.setHint(_ol_ViewHint_.INTERACTING, -1);
|
view.setHint(ViewHint.INTERACTING, -1);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
if (this.kinetic_) {
|
if (this.kinetic_) {
|
||||||
@@ -149,7 +149,7 @@ DragPan.handleDownEvent_ = function(mapBrowserEvent) {
|
|||||||
var view = map.getView();
|
var view = map.getView();
|
||||||
this.lastCentroid = null;
|
this.lastCentroid = null;
|
||||||
if (!this.handlingDownUpSequence) {
|
if (!this.handlingDownUpSequence) {
|
||||||
view.setHint(_ol_ViewHint_.INTERACTING, 1);
|
view.setHint(ViewHint.INTERACTING, 1);
|
||||||
}
|
}
|
||||||
// stop any current animation
|
// stop any current animation
|
||||||
if (view.getAnimating()) {
|
if (view.getAnimating()) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import RotationConstraint from '../RotationConstraint.js';
|
import RotationConstraint from '../RotationConstraint.js';
|
||||||
import _ol_ViewHint_ from '../ViewHint.js';
|
import ViewHint from '../ViewHint.js';
|
||||||
import _ol_events_condition_ from '../events/condition.js';
|
import _ol_events_condition_ from '../events/condition.js';
|
||||||
import {FALSE} from '../functions.js';
|
import {FALSE} from '../functions.js';
|
||||||
import Interaction from '../interaction/Interaction.js';
|
import Interaction from '../interaction/Interaction.js';
|
||||||
@@ -97,7 +97,7 @@ DragRotate.handleUpEvent_ = function(mapBrowserEvent) {
|
|||||||
|
|
||||||
var map = mapBrowserEvent.map;
|
var map = mapBrowserEvent.map;
|
||||||
var view = map.getView();
|
var view = map.getView();
|
||||||
view.setHint(_ol_ViewHint_.INTERACTING, -1);
|
view.setHint(ViewHint.INTERACTING, -1);
|
||||||
var rotation = view.getRotation();
|
var rotation = view.getRotation();
|
||||||
Interaction.rotate(view, rotation,
|
Interaction.rotate(view, rotation,
|
||||||
undefined, this.duration_);
|
undefined, this.duration_);
|
||||||
@@ -119,7 +119,7 @@ DragRotate.handleDownEvent_ = function(mapBrowserEvent) {
|
|||||||
if (_ol_events_condition_.mouseActionButton(mapBrowserEvent) &&
|
if (_ol_events_condition_.mouseActionButton(mapBrowserEvent) &&
|
||||||
this.condition_(mapBrowserEvent)) {
|
this.condition_(mapBrowserEvent)) {
|
||||||
var map = mapBrowserEvent.map;
|
var map = mapBrowserEvent.map;
|
||||||
map.getView().setHint(_ol_ViewHint_.INTERACTING, 1);
|
map.getView().setHint(ViewHint.INTERACTING, 1);
|
||||||
this.lastAngle_ = undefined;
|
this.lastAngle_ = undefined;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import RotationConstraint from '../RotationConstraint.js';
|
import RotationConstraint from '../RotationConstraint.js';
|
||||||
import _ol_ViewHint_ from '../ViewHint.js';
|
import ViewHint from '../ViewHint.js';
|
||||||
import _ol_events_condition_ from '../events/condition.js';
|
import _ol_events_condition_ from '../events/condition.js';
|
||||||
import Interaction from '../interaction/Interaction.js';
|
import Interaction from '../interaction/Interaction.js';
|
||||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||||
@@ -117,7 +117,7 @@ DragRotateAndZoom.handleUpEvent_ = function(mapBrowserEvent) {
|
|||||||
|
|
||||||
var map = mapBrowserEvent.map;
|
var map = mapBrowserEvent.map;
|
||||||
var view = map.getView();
|
var view = map.getView();
|
||||||
view.setHint(_ol_ViewHint_.INTERACTING, -1);
|
view.setHint(ViewHint.INTERACTING, -1);
|
||||||
var direction = this.lastScaleDelta_ - 1;
|
var direction = this.lastScaleDelta_ - 1;
|
||||||
Interaction.rotate(view, view.getRotation());
|
Interaction.rotate(view, view.getRotation());
|
||||||
Interaction.zoom(view, view.getResolution(),
|
Interaction.zoom(view, view.getResolution(),
|
||||||
@@ -139,7 +139,7 @@ DragRotateAndZoom.handleDownEvent_ = function(mapBrowserEvent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.condition_(mapBrowserEvent)) {
|
if (this.condition_(mapBrowserEvent)) {
|
||||||
mapBrowserEvent.map.getView().setHint(_ol_ViewHint_.INTERACTING, 1);
|
mapBrowserEvent.map.getView().setHint(ViewHint.INTERACTING, 1);
|
||||||
this.lastAngle_ = undefined;
|
this.lastAngle_ = undefined;
|
||||||
this.lastMagnitude_ = undefined;
|
this.lastMagnitude_ = undefined;
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @module ol/interaction/MouseWheelZoom
|
* @module ol/interaction/MouseWheelZoom
|
||||||
*/
|
*/
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_ViewHint_ from '../ViewHint.js';
|
import ViewHint from '../ViewHint.js';
|
||||||
import condition from '../events/condition.js';
|
import condition from '../events/condition.js';
|
||||||
import {easeOut} from '../easing.js';
|
import {easeOut} from '../easing.js';
|
||||||
import EventType from '../events/EventType.js';
|
import EventType from '../events/EventType.js';
|
||||||
@@ -191,7 +191,7 @@ MouseWheelZoom.handleEvent = function(mapBrowserEvent) {
|
|||||||
if (this.trackpadTimeoutId_) {
|
if (this.trackpadTimeoutId_) {
|
||||||
clearTimeout(this.trackpadTimeoutId_);
|
clearTimeout(this.trackpadTimeoutId_);
|
||||||
} else {
|
} else {
|
||||||
view.setHint(_ol_ViewHint_.INTERACTING, 1);
|
view.setHint(ViewHint.INTERACTING, 1);
|
||||||
}
|
}
|
||||||
this.trackpadTimeoutId_ = setTimeout(this.decrementInteractingHint_.bind(this), this.trackpadEventGap_);
|
this.trackpadTimeoutId_ = setTimeout(this.decrementInteractingHint_.bind(this), this.trackpadEventGap_);
|
||||||
var resolution = view.getResolution() * Math.pow(2, delta / this.trackpadDeltaPerZoom_);
|
var resolution = view.getResolution() * Math.pow(2, delta / this.trackpadDeltaPerZoom_);
|
||||||
@@ -256,7 +256,7 @@ MouseWheelZoom.handleEvent = function(mapBrowserEvent) {
|
|||||||
MouseWheelZoom.prototype.decrementInteractingHint_ = function() {
|
MouseWheelZoom.prototype.decrementInteractingHint_ = function() {
|
||||||
this.trackpadTimeoutId_ = undefined;
|
this.trackpadTimeoutId_ = undefined;
|
||||||
var view = this.getMap().getView();
|
var view = this.getMap().getView();
|
||||||
view.setHint(_ol_ViewHint_.INTERACTING, -1);
|
view.setHint(ViewHint.INTERACTING, -1);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @module ol/interaction/PinchRotate
|
* @module ol/interaction/PinchRotate
|
||||||
*/
|
*/
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_ViewHint_ from '../ViewHint.js';
|
import ViewHint from '../ViewHint.js';
|
||||||
import {FALSE} from '../functions.js';
|
import {FALSE} from '../functions.js';
|
||||||
import Interaction from '../interaction/Interaction.js';
|
import Interaction from '../interaction/Interaction.js';
|
||||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||||
@@ -131,7 +131,7 @@ _ol_interaction_PinchRotate_.handleUpEvent_ = function(mapBrowserEvent) {
|
|||||||
if (this.targetPointers.length < 2) {
|
if (this.targetPointers.length < 2) {
|
||||||
var map = mapBrowserEvent.map;
|
var map = mapBrowserEvent.map;
|
||||||
var view = map.getView();
|
var view = map.getView();
|
||||||
view.setHint(_ol_ViewHint_.INTERACTING, -1);
|
view.setHint(ViewHint.INTERACTING, -1);
|
||||||
if (this.rotating_) {
|
if (this.rotating_) {
|
||||||
var rotation = view.getRotation();
|
var rotation = view.getRotation();
|
||||||
Interaction.rotate(
|
Interaction.rotate(
|
||||||
@@ -158,7 +158,7 @@ _ol_interaction_PinchRotate_.handleDownEvent_ = function(mapBrowserEvent) {
|
|||||||
this.rotating_ = false;
|
this.rotating_ = false;
|
||||||
this.rotationDelta_ = 0.0;
|
this.rotationDelta_ = 0.0;
|
||||||
if (!this.handlingDownUpSequence) {
|
if (!this.handlingDownUpSequence) {
|
||||||
map.getView().setHint(_ol_ViewHint_.INTERACTING, 1);
|
map.getView().setHint(ViewHint.INTERACTING, 1);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @module ol/interaction/PinchZoom
|
* @module ol/interaction/PinchZoom
|
||||||
*/
|
*/
|
||||||
import {inherits} from '../index.js';
|
import {inherits} from '../index.js';
|
||||||
import _ol_ViewHint_ from '../ViewHint.js';
|
import ViewHint from '../ViewHint.js';
|
||||||
import {FALSE} from '../functions.js';
|
import {FALSE} from '../functions.js';
|
||||||
import Interaction from '../interaction/Interaction.js';
|
import Interaction from '../interaction/Interaction.js';
|
||||||
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
import _ol_interaction_Pointer_ from '../interaction/Pointer.js';
|
||||||
@@ -125,7 +125,7 @@ _ol_interaction_PinchZoom_.handleUpEvent_ = function(mapBrowserEvent) {
|
|||||||
if (this.targetPointers.length < 2) {
|
if (this.targetPointers.length < 2) {
|
||||||
var map = mapBrowserEvent.map;
|
var map = mapBrowserEvent.map;
|
||||||
var view = map.getView();
|
var view = map.getView();
|
||||||
view.setHint(_ol_ViewHint_.INTERACTING, -1);
|
view.setHint(ViewHint.INTERACTING, -1);
|
||||||
var resolution = view.getResolution();
|
var resolution = view.getResolution();
|
||||||
if (this.constrainResolution_ ||
|
if (this.constrainResolution_ ||
|
||||||
resolution < view.getMinResolution() ||
|
resolution < view.getMinResolution() ||
|
||||||
@@ -157,7 +157,7 @@ _ol_interaction_PinchZoom_.handleDownEvent_ = function(mapBrowserEvent) {
|
|||||||
this.lastDistance_ = undefined;
|
this.lastDistance_ = undefined;
|
||||||
this.lastScaleDelta_ = 1;
|
this.lastScaleDelta_ = 1;
|
||||||
if (!this.handlingDownUpSequence) {
|
if (!this.handlingDownUpSequence) {
|
||||||
map.getView().setHint(_ol_ViewHint_.INTERACTING, 1);
|
map.getView().setHint(ViewHint.INTERACTING, 1);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {ENABLE_RASTER_REPROJECTION} from '../../reproj/common.js';
|
|||||||
import {inherits} from '../../index.js';
|
import {inherits} from '../../index.js';
|
||||||
import _ol_ImageCanvas_ from '../../ImageCanvas.js';
|
import _ol_ImageCanvas_ from '../../ImageCanvas.js';
|
||||||
import LayerType from '../../LayerType.js';
|
import LayerType from '../../LayerType.js';
|
||||||
import _ol_ViewHint_ from '../../ViewHint.js';
|
import ViewHint from '../../ViewHint.js';
|
||||||
import {equals} from '../../array.js';
|
import {equals} from '../../array.js';
|
||||||
import {getHeight, getIntersection, getWidth, isEmpty} from '../../extent.js';
|
import {getHeight, getIntersection, getWidth, isEmpty} from '../../extent.js';
|
||||||
import _ol_layer_VectorRenderType_ from '../../layer/VectorRenderType.js';
|
import _ol_layer_VectorRenderType_ from '../../layer/VectorRenderType.js';
|
||||||
@@ -125,7 +125,7 @@ CanvasImageLayerRenderer.prototype.prepareFrame = function(frameState, layerStat
|
|||||||
renderedExtent = getIntersection(renderedExtent, layerState.extent);
|
renderedExtent = getIntersection(renderedExtent, layerState.extent);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hints[_ol_ViewHint_.ANIMATING] && !hints[_ol_ViewHint_.INTERACTING] &&
|
if (!hints[ViewHint.ANIMATING] && !hints[ViewHint.INTERACTING] &&
|
||||||
!isEmpty(renderedExtent)) {
|
!isEmpty(renderedExtent)) {
|
||||||
var projection = viewState.projection;
|
var projection = viewState.projection;
|
||||||
if (!ENABLE_RASTER_REPROJECTION) {
|
if (!ENABLE_RASTER_REPROJECTION) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import {getUid, inherits} from '../../index.js';
|
|||||||
import LayerType from '../../LayerType.js';
|
import LayerType from '../../LayerType.js';
|
||||||
import TileRange from '../../TileRange.js';
|
import TileRange from '../../TileRange.js';
|
||||||
import TileState from '../../TileState.js';
|
import TileState from '../../TileState.js';
|
||||||
import _ol_ViewHint_ from '../../ViewHint.js';
|
import ViewHint from '../../ViewHint.js';
|
||||||
import {createCanvasContext2D} from '../../dom.js';
|
import {createCanvasContext2D} from '../../dom.js';
|
||||||
import {containsExtent, createEmpty, equals, getIntersection, isEmpty} from '../../extent.js';
|
import {containsExtent, createEmpty, equals, getIntersection, isEmpty} from '../../extent.js';
|
||||||
import RendererType from '../Type.js';
|
import RendererType from '../Type.js';
|
||||||
@@ -209,7 +209,7 @@ CanvasTileLayerRenderer.prototype.prepareFrame = function(frameState, layerState
|
|||||||
|
|
||||||
var renderedResolution = tileResolution * pixelRatio / tilePixelRatio * oversampling;
|
var renderedResolution = tileResolution * pixelRatio / tilePixelRatio * oversampling;
|
||||||
var hints = frameState.viewHints;
|
var hints = frameState.viewHints;
|
||||||
var animatingOrInteracting = hints[_ol_ViewHint_.ANIMATING] || hints[_ol_ViewHint_.INTERACTING];
|
var animatingOrInteracting = hints[ViewHint.ANIMATING] || hints[ViewHint.INTERACTING];
|
||||||
if (!(this.renderedResolution && Date.now() - frameState.time > 16 && animatingOrInteracting) && (
|
if (!(this.renderedResolution && Date.now() - frameState.time > 16 && animatingOrInteracting) && (
|
||||||
newTiles ||
|
newTiles ||
|
||||||
!(this.renderedExtent_ && containsExtent(this.renderedExtent_, extent)) ||
|
!(this.renderedExtent_ && containsExtent(this.renderedExtent_, extent)) ||
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
import {getUid, inherits} from '../../index.js';
|
import {getUid, inherits} from '../../index.js';
|
||||||
import LayerType from '../../LayerType.js';
|
import LayerType from '../../LayerType.js';
|
||||||
import _ol_ViewHint_ from '../../ViewHint.js';
|
import ViewHint from '../../ViewHint.js';
|
||||||
import {createCanvasContext2D} from '../../dom.js';
|
import {createCanvasContext2D} from '../../dom.js';
|
||||||
import _ol_events_ from '../../events.js';
|
import _ol_events_ from '../../events.js';
|
||||||
import EventType from '../../events/EventType.js';
|
import EventType from '../../events/EventType.js';
|
||||||
@@ -301,8 +301,8 @@ CanvasVectorLayerRenderer.prototype.prepareFrame = function(frameState, layerSta
|
|||||||
var vectorLayer = /** @type {ol.layer.Vector} */ (this.getLayer());
|
var vectorLayer = /** @type {ol.layer.Vector} */ (this.getLayer());
|
||||||
var vectorSource = vectorLayer.getSource();
|
var vectorSource = vectorLayer.getSource();
|
||||||
|
|
||||||
var animating = frameState.viewHints[_ol_ViewHint_.ANIMATING];
|
var animating = frameState.viewHints[ViewHint.ANIMATING];
|
||||||
var interacting = frameState.viewHints[_ol_ViewHint_.INTERACTING];
|
var interacting = frameState.viewHints[ViewHint.INTERACTING];
|
||||||
var updateWhileAnimating = vectorLayer.getUpdateWhileAnimating();
|
var updateWhileAnimating = vectorLayer.getUpdateWhileAnimating();
|
||||||
var updateWhileInteracting = vectorLayer.getUpdateWhileInteracting();
|
var updateWhileInteracting = vectorLayer.getUpdateWhileInteracting();
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
import {ENABLE_RASTER_REPROJECTION} from '../../reproj/common.js';
|
import {ENABLE_RASTER_REPROJECTION} from '../../reproj/common.js';
|
||||||
import {inherits, nullFunction} from '../../index.js';
|
import {inherits, nullFunction} from '../../index.js';
|
||||||
import LayerType from '../../LayerType.js';
|
import LayerType from '../../LayerType.js';
|
||||||
import _ol_ViewHint_ from '../../ViewHint.js';
|
import ViewHint from '../../ViewHint.js';
|
||||||
import {createCanvasContext2D} from '../../dom.js';
|
import {createCanvasContext2D} from '../../dom.js';
|
||||||
import {getIntersection, isEmpty} from '../../extent.js';
|
import {getIntersection, isEmpty} from '../../extent.js';
|
||||||
import {TRUE} from '../../functions.js';
|
import {TRUE} from '../../functions.js';
|
||||||
@@ -139,7 +139,7 @@ WebGLImageLayerRenderer.prototype.prepareFrame = function(frameState, layerState
|
|||||||
if (layerState.extent !== undefined) {
|
if (layerState.extent !== undefined) {
|
||||||
renderedExtent = getIntersection(renderedExtent, layerState.extent);
|
renderedExtent = getIntersection(renderedExtent, layerState.extent);
|
||||||
}
|
}
|
||||||
if (!hints[_ol_ViewHint_.ANIMATING] && !hints[_ol_ViewHint_.INTERACTING] &&
|
if (!hints[ViewHint.ANIMATING] && !hints[ViewHint.INTERACTING] &&
|
||||||
!isEmpty(renderedExtent)) {
|
!isEmpty(renderedExtent)) {
|
||||||
var projection = viewState.projection;
|
var projection = viewState.projection;
|
||||||
if (!ENABLE_RASTER_REPROJECTION) {
|
if (!ENABLE_RASTER_REPROJECTION) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
import {getUid, inherits} from '../../index.js';
|
import {getUid, inherits} from '../../index.js';
|
||||||
import LayerType from '../../LayerType.js';
|
import LayerType from '../../LayerType.js';
|
||||||
import _ol_ViewHint_ from '../../ViewHint.js';
|
import ViewHint from '../../ViewHint.js';
|
||||||
import {buffer, containsExtent, createEmpty} from '../../extent.js';
|
import {buffer, containsExtent, createEmpty} from '../../extent.js';
|
||||||
import _ol_render_webgl_ReplayGroup_ from '../../render/webgl/ReplayGroup.js';
|
import _ol_render_webgl_ReplayGroup_ from '../../render/webgl/ReplayGroup.js';
|
||||||
import RendererType from '../Type.js';
|
import RendererType from '../Type.js';
|
||||||
@@ -215,8 +215,8 @@ WebGLVectorLayerRenderer.prototype.prepareFrame = function(frameState, layerStat
|
|||||||
var vectorLayer = /** @type {ol.layer.Vector} */ (this.getLayer());
|
var vectorLayer = /** @type {ol.layer.Vector} */ (this.getLayer());
|
||||||
var vectorSource = vectorLayer.getSource();
|
var vectorSource = vectorLayer.getSource();
|
||||||
|
|
||||||
var animating = frameState.viewHints[_ol_ViewHint_.ANIMATING];
|
var animating = frameState.viewHints[ViewHint.ANIMATING];
|
||||||
var interacting = frameState.viewHints[_ol_ViewHint_.INTERACTING];
|
var interacting = frameState.viewHints[ViewHint.INTERACTING];
|
||||||
var updateWhileAnimating = vectorLayer.getUpdateWhileAnimating();
|
var updateWhileAnimating = vectorLayer.getUpdateWhileAnimating();
|
||||||
var updateWhileInteracting = vectorLayer.getUpdateWhileInteracting();
|
var updateWhileInteracting = vectorLayer.getUpdateWhileInteracting();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import Map from '../../../src/ol/Map.js';
|
import Map from '../../../src/ol/Map.js';
|
||||||
import _ol_View_ from '../../../src/ol/View.js';
|
import _ol_View_ from '../../../src/ol/View.js';
|
||||||
import _ol_ViewHint_ from '../../../src/ol/ViewHint.js';
|
import ViewHint from '../../../src/ol/ViewHint.js';
|
||||||
import * as _ol_extent_ from '../../../src/ol/extent.js';
|
import * as _ol_extent_ from '../../../src/ol/extent.js';
|
||||||
import Circle from '../../../src/ol/geom/Circle.js';
|
import Circle from '../../../src/ol/geom/Circle.js';
|
||||||
import LineString from '../../../src/ol/geom/LineString.js';
|
import LineString from '../../../src/ol/geom/LineString.js';
|
||||||
@@ -311,7 +311,7 @@ describe('ol.View', function() {
|
|||||||
expect(view.getHints()).to.eql([0, 0]);
|
expect(view.getHints()).to.eql([0, 0]);
|
||||||
expect(view.getInteracting()).to.eql(false);
|
expect(view.getInteracting()).to.eql(false);
|
||||||
|
|
||||||
view.setHint(_ol_ViewHint_.INTERACTING, 1);
|
view.setHint(ViewHint.INTERACTING, 1);
|
||||||
expect(view.getHints()).to.eql([0, 1]);
|
expect(view.getHints()).to.eql([0, 1]);
|
||||||
expect(view.getInteracting()).to.eql(true);
|
expect(view.getInteracting()).to.eql(true);
|
||||||
});
|
});
|
||||||
@@ -327,7 +327,7 @@ describe('ol.View', function() {
|
|||||||
expect(view.getInteracting()).to.eql(true);
|
expect(view.getInteracting()).to.eql(true);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
view.setHint(_ol_ViewHint_.INTERACTING, 1);
|
view.setHint(ViewHint.INTERACTING, 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -680,7 +680,7 @@ describe('ol.View', function() {
|
|||||||
function decrement() {
|
function decrement() {
|
||||||
--count;
|
--count;
|
||||||
if (count === 0) {
|
if (count === 0) {
|
||||||
expect(view.getHints()[_ol_ViewHint_.ANIMATING]).to.be(0);
|
expect(view.getHints()[ViewHint.ANIMATING]).to.be(0);
|
||||||
done();
|
done();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -688,19 +688,19 @@ describe('ol.View', function() {
|
|||||||
center: [1, 2],
|
center: [1, 2],
|
||||||
duration: 25
|
duration: 25
|
||||||
}, decrement);
|
}, decrement);
|
||||||
expect(view.getHints()[_ol_ViewHint_.ANIMATING]).to.be(1);
|
expect(view.getHints()[ViewHint.ANIMATING]).to.be(1);
|
||||||
|
|
||||||
view.animate({
|
view.animate({
|
||||||
zoom: 1,
|
zoom: 1,
|
||||||
duration: 25
|
duration: 25
|
||||||
}, decrement);
|
}, decrement);
|
||||||
expect(view.getHints()[_ol_ViewHint_.ANIMATING]).to.be(2);
|
expect(view.getHints()[ViewHint.ANIMATING]).to.be(2);
|
||||||
|
|
||||||
view.animate({
|
view.animate({
|
||||||
rotation: Math.PI,
|
rotation: Math.PI,
|
||||||
duration: 25
|
duration: 25
|
||||||
}, decrement);
|
}, decrement);
|
||||||
expect(view.getHints()[_ol_ViewHint_.ANIMATING]).to.be(3);
|
expect(view.getHints()[ViewHint.ANIMATING]).to.be(3);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -715,23 +715,23 @@ describe('ol.View', function() {
|
|||||||
center: [1, 2],
|
center: [1, 2],
|
||||||
duration: 25
|
duration: 25
|
||||||
});
|
});
|
||||||
expect(view.getHints()[_ol_ViewHint_.ANIMATING]).to.be(1);
|
expect(view.getHints()[ViewHint.ANIMATING]).to.be(1);
|
||||||
|
|
||||||
view.animate({
|
view.animate({
|
||||||
zoom: 1,
|
zoom: 1,
|
||||||
duration: 25
|
duration: 25
|
||||||
});
|
});
|
||||||
expect(view.getHints()[_ol_ViewHint_.ANIMATING]).to.be(2);
|
expect(view.getHints()[ViewHint.ANIMATING]).to.be(2);
|
||||||
|
|
||||||
view.animate({
|
view.animate({
|
||||||
rotation: Math.PI,
|
rotation: Math.PI,
|
||||||
duration: 25
|
duration: 25
|
||||||
});
|
});
|
||||||
expect(view.getHints()[_ol_ViewHint_.ANIMATING]).to.be(3);
|
expect(view.getHints()[ViewHint.ANIMATING]).to.be(3);
|
||||||
|
|
||||||
// cancel animations
|
// cancel animations
|
||||||
view.setCenter([10, 20]);
|
view.setCenter([10, 20]);
|
||||||
expect(view.getHints()[_ol_ViewHint_.ANIMATING]).to.be(0);
|
expect(view.getHints()[ViewHint.ANIMATING]).to.be(0);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user