@loaders.gl/mvt
Version:
Loader for Mapbox Vector Tiles
32 lines • 896 B
JavaScript
// loaders.gl
// SPDX-License-Identifier: MIT
// Copyright (c) vis.gl contributors
import { MVTFormat } from "./mvt-format.js";
import { encodeMVT } from "./lib/encode-mvt.js";
// __VERSION__ is injected by babel-plugin-version-inline
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
const VERSION = typeof "4.4.2" !== 'undefined' ? "4.4.2" : 'latest';
/**
* Writer for the Mapbox Vector Tile format
*
* Experimental: The API may change in minor/patch releases.
*/
export const MVTWriter = {
...MVTFormat,
version: VERSION,
binary: true,
options: {
mvt: {
layerName: 'geojsonLayer',
version: 1,
extent: 4096
}
},
async encode(data, options) {
return encodeMVT(data, options);
},
encodeSync(data, options) {
return encodeMVT(data, options);
}
};
//# sourceMappingURL=mvt-writer.js.map