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

@@ -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');
}
}