Always load tiles while animating and interacting

This commit is contained in:
ahocevar
2019-01-06 20:45:18 +01:00
parent 3e1fce0e22
commit 2e21b9f975
6 changed files with 12 additions and 44 deletions

View File

@@ -2,11 +2,6 @@
### Next version
##### Removal of the AtlasManager
Following the removal of the experimental WebGL renderer, the AtlasManager has been removed as well. The atlas was only used by this renderer.
The non API `getChecksum` functions of the style is also removed.
#### Backwards incompatible changes
##### New internal tile coordinates
@@ -113,6 +108,16 @@ The removed classes and components are:
* `WebGLMap`
* The shader build process using `mustache` and the `Makefile` at the root
##### Removal of the AtlasManager
Following the removal of the experimental WebGL renderer, the AtlasManager has been removed as well. The atlas was only used by this renderer.
The non API `getChecksum` functions of the style is also removed.
#### Other changes
##### Always load tiles while animating or interacting
`ol/PluggableMap` and subclasses no longer support the `loadTilesWhileAnimating` and `loadTilesWhileInteracting` options. These options were used to enable tile loading during animations and interactions. With the new DOM composition render strategy, it is no longer necessary to postpone tile loading until after animations or interactions.
### v5.3.0

View File

@@ -24,9 +24,6 @@ const map = new Map({
source: new OSM()
})
],
// Improve user experience by loading tiles while animating. Will make
// animations stutter on mobile or slow devices.
loadTilesWhileAnimating: true,
view: view
});

View File

@@ -29,9 +29,6 @@ for (i = 0, ii = styles.length; i < ii; ++i) {
}
const map = new Map({
layers: layers,
// Improve user experience by loading tiles while dragging/zooming. Will make
// zooming choppy on mobile or slow devices.
loadTilesWhileInteracting: true,
target: 'map',
view: new View({
center: [-6655.5402445057125, 6709968.258934638],

View File

@@ -124,7 +124,6 @@ const vectorLayer = new VectorLayer({
const center = [-5639523.95, -3501274.52];
const map = new Map({
target: document.getElementById('map'),
loadTilesWhileAnimating: true,
view: new View({
center: center,
zoom: 10,

View File

@@ -69,9 +69,6 @@ for (i = 0, ii = hereLayers.length; i < ii; ++i) {
const map = new Map({
layers: layers,
// Improve user experience by loading tiles while dragging/zooming. Will make
// zooming choppy on mobile or slow devices.
loadTilesWhileInteracting: true,
target: 'map',
view: new View({
center: [921371.9389, 6358337.7609],

View File

@@ -107,13 +107,6 @@ import {create as createTransform, apply as applyTransform} from './transform.js
* layer.
* @property {number} [maxTilesLoading=16] Maximum number tiles to load
* simultaneously.
* @property {boolean} [loadTilesWhileAnimating=false] When set to `true`, tiles
* will be loaded during animations. This may improve the user experience, but
* can also make animations stutter on devices with slow memory.
* @property {boolean} [loadTilesWhileInteracting=false] When set to `true`,
* tiles will be loaded while interacting with the map. This may improve the
* user experience, but can also make map panning and zooming choppy on devices
* with slow memory.
* @property {number} [moveTolerance=1] The minimum distance in pixels the
* cursor must move to be detected as a map move event instead of a click.
* Increasing this value can make it easier to click on the map.
@@ -154,22 +147,6 @@ class PluggableMap extends BaseObject {
*/
this.maxTilesLoading_ = options.maxTilesLoading !== undefined ? options.maxTilesLoading : 16;
/**
* @type {boolean}
* @private
*/
this.loadTilesWhileAnimating_ =
options.loadTilesWhileAnimating !== undefined ?
options.loadTilesWhileAnimating : false;
/**
* @type {boolean}
* @private
*/
this.loadTilesWhileInteracting_ =
options.loadTilesWhileInteracting !== undefined ?
options.loadTilesWhileInteracting : false;
/**
* @private
* @type {number}
@@ -957,12 +934,8 @@ class PluggableMap extends BaseObject {
let maxNewLoads = maxTotalLoading;
if (frameState) {
const hints = frameState.viewHints;
if (hints[ViewHint.ANIMATING]) {
maxTotalLoading = this.loadTilesWhileAnimating_ ? 8 : 0;
maxNewLoads = 2;
}
if (hints[ViewHint.INTERACTING]) {
maxTotalLoading = this.loadTilesWhileInteracting_ ? 8 : 0;
if (hints[ViewHint.ANIMATING] || hints[ViewHint.INTERACTING]) {
maxTotalLoading = 8;
maxNewLoads = 2;
}
}