Use union types

Co-authored-by: Andreas Hocevar <andreas.hocevar@gmail.com>
This commit is contained in:
Tim Schaub
2021-09-04 10:16:28 -06:00
committed by Tim Schaub
parent 12795e3923
commit 7168a26cab

View File

@@ -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
@@ -327,12 +323,12 @@ function parseTileSetMetadata(sourceInfo, tileSet) {
const tileMatrixSetLimits = tileSet.tileMatrixSetLimits;
let tileUrlTemplate;
if (tileSet.dataType === TileType.MAP) {
if (tileSet.dataType === 'map') {
tileUrlTemplate = getMapTileUrlTemplate(
tileSet.links,
sourceInfo.mediaType
);
} else if (tileSet.dataType === TileType.VECTOR) {
} else if (tileSet.dataType === 'vector') {
tileUrlTemplate = getVectorTileUrlTemplate(
tileSet.links,
sourceInfo.mediaType