// loaders.gl // SPDX-License-Identifier: MIT // Copyright vis.gl contributors // import type {MVTOptions} from './lib/types'; import { parseMVT } from "./lib/parse-mvt.js"; // __VERSION__ is injected by babel-plugin-version-inline // @ts-ignore TS2304: Cannot find name '__VERSION__'. const VERSION = typeof "4.3.1" !== 'undefined' ? "4.3.1" : 'latest'; /** * Worker loader for the Mapbox Vector Tile format */ export const MVTWorkerLoader = { dataType: null, batchType: null, name: 'Mapbox Vector Tile', id: 'mvt', module: 'mvt', version: VERSION, // Note: ArcGIS uses '.pbf' extension and 'application/octet-stream' extensions: ['mvt', 'pbf'], mimeTypes: [ // https://www.iana.org/assignments/media-types/application/vnd.mapbox-vector-tile 'application/vnd.mapbox-vector-tile', 'application/x-protobuf' // 'application/octet-stream' ], worker: true, category: 'geometry', options: { mvt: { shape: 'geojson', coordinates: 'local', layerProperty: 'layerName', layers: undefined, tileIndex: undefined } } }; /** * Loader for the Mapbox Vector Tile format */ export const MVTLoader = { ...MVTWorkerLoader, parse: async (arrayBuffer, options) => parseMVT(arrayBuffer, options), parseSync: parseMVT, binary: true };