Use union types
Co-authored-by: Andreas Hocevar <andreas.hocevar@gmail.com>
This commit is contained in:
@@ -13,12 +13,8 @@ import {getIntersection as intersectExtents} from '../extent.js';
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @enum {string}
|
* @typedef {'map' | 'vector'} TileType
|
||||||
*/
|
*/
|
||||||
const TileType = {
|
|
||||||
MAP: 'map',
|
|
||||||
VECTOR: 'vector',
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} TileSet
|
* @typedef {Object} TileSet
|
||||||
@@ -327,12 +323,12 @@ function parseTileSetMetadata(sourceInfo, tileSet) {
|
|||||||
const tileMatrixSetLimits = tileSet.tileMatrixSetLimits;
|
const tileMatrixSetLimits = tileSet.tileMatrixSetLimits;
|
||||||
let tileUrlTemplate;
|
let tileUrlTemplate;
|
||||||
|
|
||||||
if (tileSet.dataType === TileType.MAP) {
|
if (tileSet.dataType === 'map') {
|
||||||
tileUrlTemplate = getMapTileUrlTemplate(
|
tileUrlTemplate = getMapTileUrlTemplate(
|
||||||
tileSet.links,
|
tileSet.links,
|
||||||
sourceInfo.mediaType
|
sourceInfo.mediaType
|
||||||
);
|
);
|
||||||
} else if (tileSet.dataType === TileType.VECTOR) {
|
} else if (tileSet.dataType === 'vector') {
|
||||||
tileUrlTemplate = getVectorTileUrlTemplate(
|
tileUrlTemplate = getVectorTileUrlTemplate(
|
||||||
tileSet.links,
|
tileSet.links,
|
||||||
sourceInfo.mediaType
|
sourceInfo.mediaType
|
||||||
|
|||||||
Reference in New Issue
Block a user