Use union type for source state

This commit is contained in:
Andreas Hocevar
2021-09-04 20:55:13 +02:00
parent 492458a141
commit 57f147988d
24 changed files with 49 additions and 73 deletions
+3 -4
View File
@@ -7,7 +7,6 @@
* See https://mapbox.com/developers/api/.
*/
import SourceState from './State.js';
import TileImage from './TileImage.js';
import {applyTransform, intersects} from '../extent.js';
import {assert} from '../asserts.js';
@@ -89,7 +88,7 @@ class TileJSON extends TileImage {
interpolate: interpolate,
projection: getProjection('EPSG:3857'),
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
state: SourceState.LOADING,
state: 'loading',
tileLoadFunction: options.tileLoadFunction,
wrapX: options.wrapX !== undefined ? options.wrapX : true,
transition: options.transition,
@@ -206,14 +205,14 @@ class TileJSON extends TileImage {
});
}
this.tileJSON_ = tileJSON;
this.setState(SourceState.READY);
this.setState('ready');
}
/**
* @protected
*/
handleTileJSONError() {
this.setState(SourceState.ERROR);
this.setState('error');
}
}