Additional uses of new source state type

This commit is contained in:
Tim Schaub
2021-09-04 16:50:09 -06:00
committed by Andreas Hocevar
parent 57f147988d
commit 04ad0e0c5a
5 changed files with 10 additions and 15 deletions

View File

@@ -1,7 +1,6 @@
/**
* @module ol/source/OGCMapTile
*/
import SourceState from './State.js';
import TileImage from './TileImage.js';
import {getTileSetInfo} from './ogcTileUtil.js';
@@ -60,7 +59,7 @@ class OGCMapTile extends TileImage {
interpolate: interpolate,
projection: options.projection,
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
state: SourceState.LOADING,
state: 'loading',
tileLoadFunction: options.tileLoadFunction,
wrapX: options.wrapX !== undefined ? options.wrapX : true,
transition: options.transition,
@@ -85,7 +84,7 @@ class OGCMapTile extends TileImage {
handleTileSetInfo_(tileSetInfo) {
this.tileGrid = tileSetInfo.grid;
this.setTileUrlFunction(tileSetInfo.urlFunction, tileSetInfo.urlTemplate);
this.setState(SourceState.READY);
this.setState('ready');
}
/**
@@ -94,7 +93,7 @@ class OGCMapTile extends TileImage {
*/
handleError_(error) {
console.error(error); // eslint-disable-line no-console
this.setState(SourceState.ERROR);
this.setState('error');
}
}

View File

@@ -2,7 +2,6 @@
* @module ol/source/OGCVectorTile
*/
import SourceState from './State.js';
import VectorTile from './VectorTile.js';
import {getTileSetInfo} from './ogcTileUtil.js';
@@ -61,7 +60,7 @@ class OGCVectorTile extends VectorTile {
transition: options.transition,
wrapX: options.wrapX,
zDirection: options.zDirection,
state: SourceState.LOADING,
state: 'loading',
});
const sourceInfo = {
@@ -84,7 +83,7 @@ class OGCVectorTile extends VectorTile {
handleTileSetInfo_(tileSetInfo) {
this.tileGrid = tileSetInfo.grid;
this.setTileUrlFunction(tileSetInfo.urlFunction, tileSetInfo.urlTemplate);
this.setState(SourceState.READY);
this.setState('ready');
}
/**
@@ -93,7 +92,7 @@ class OGCVectorTile extends VectorTile {
*/
handleError_(error) {
console.error(error); // eslint-disable-line no-console
this.setState(SourceState.ERROR);
this.setState('error');
}
}