@loaders.gl/mvt 4.1.0-alpha.8 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dist.dev.js +3 -3
- package/dist/lib/types.d.ts +1 -3
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/types.js.map +1 -1
- package/dist/mvt-loader.js +1 -1
- package/dist/mvt-loader.js.map +1 -1
- package/dist/mvt-worker.js +1 -1
- package/dist/tilejson-loader.js +1 -1
- package/dist/tilejson-loader.js.map +1 -1
- package/package.json +8 -8
- package/src/lib/types.ts +1 -3
package/dist/dist.dev.js
CHANGED
|
@@ -2349,7 +2349,7 @@ var __exports__ = (() => {
|
|
|
2349
2349
|
}
|
|
2350
2350
|
|
|
2351
2351
|
// src/mvt-loader.ts
|
|
2352
|
-
var VERSION = true ? "4.1.0
|
|
2352
|
+
var VERSION = true ? "4.1.0" : "latest";
|
|
2353
2353
|
var MVTWorkerLoader = {
|
|
2354
2354
|
name: "Mapbox Vector Tile",
|
|
2355
2355
|
id: "mvt",
|
|
@@ -2582,7 +2582,7 @@ var __exports__ = (() => {
|
|
|
2582
2582
|
}
|
|
2583
2583
|
|
|
2584
2584
|
// src/tilejson-loader.ts
|
|
2585
|
-
var VERSION2 = true ? "4.1.0
|
|
2585
|
+
var VERSION2 = true ? "4.1.0" : "latest";
|
|
2586
2586
|
var TileJSONLoader = {
|
|
2587
2587
|
name: "TileJSON",
|
|
2588
2588
|
id: "tilejson",
|
|
@@ -2694,7 +2694,7 @@ var __exports__ = (() => {
|
|
|
2694
2694
|
}
|
|
2695
2695
|
|
|
2696
2696
|
// ../images/src/lib/utils/version.ts
|
|
2697
|
-
var VERSION3 = true ? "4.1.0
|
|
2697
|
+
var VERSION3 = true ? "4.1.0" : "latest";
|
|
2698
2698
|
|
|
2699
2699
|
// ../images/src/lib/category-api/image-type.ts
|
|
2700
2700
|
var parseImageNode = globalThis.loaders?.parseImageNode;
|
package/dist/lib/types.d.ts
CHANGED
|
@@ -57,9 +57,7 @@ export type MVTMapboxCoordinates = {
|
|
|
57
57
|
export type MVTLoaderOptions = LoaderOptions & {
|
|
58
58
|
mvt?: MVTOptions;
|
|
59
59
|
gis?: {
|
|
60
|
-
/**
|
|
61
|
-
* When set to `true`, the parser will output the data in binary format. This is equivalent to loading the data as GeoJSON and then applying [geojsonToBinary](https://loaders.gl/modules/gis/docs/api-reference/geojson-to-binary).
|
|
62
|
-
*/
|
|
60
|
+
/** `true`: parser will output the data in binary format. Equivalent to loading the data as GeoJSON and then applying geojsonToBinary */
|
|
63
61
|
binary?: boolean;
|
|
64
62
|
/** @deprecated. Use options.mvt.shape */
|
|
65
63
|
format?: 'geojson-table' | 'columnar-table' | 'geojson' | 'binary' | 'binary-geometry';
|
package/dist/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAE5D,2DAA2D;AAC3D,KAAK,0BAA0B,GAAG;IAChC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,IAAI,CAAC;CACjB,CAAC;AAEF,sDAAsD;AACtD,KAAK,0BAA0B,GAAG;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,SAAS,CAAC,EAAE;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,0BAA0B,GAAG,0BAA0B,CAAC,GAAG;IACnF,KAAK,CAAC,EAAE,eAAe,GAAG,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,iBAAiB,CAAC;IACtF;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAEhC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,GAAG,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,iBAAiB,CAAC;KAChC,CAAC;IACF,UAAU,EAAE;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;KAAC,CAAC;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,GAAG,CAAC,EAAE;QACJ
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,0BAA0B,CAAC;AAE5D,2DAA2D;AAC3D,KAAK,0BAA0B,GAAG;IAChC;;OAEG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,IAAI,CAAC;CACjB,CAAC;AAEF,sDAAsD;AACtD,KAAK,0BAA0B,GAAG;IAChC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;OAGG;IACH,SAAS,CAAC,EAAE;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;CAC/C,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,CAAC,0BAA0B,GAAG,0BAA0B,CAAC,GAAG;IACnF,KAAK,CAAC,EAAE,eAAe,GAAG,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,iBAAiB,CAAC;IACtF;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAEhC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,GAAG,EAAE,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,WAAW,EAAE,iBAAiB,CAAC;KAChC,CAAC;IACF,UAAU,EAAE;QAAC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;KAAC,CAAC;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,aAAa,GAAG;IAC7C,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,GAAG,CAAC,EAAE;QACJ,wIAAwI;QACxI,MAAM,CAAC,EAAE,OAAO,CAAC;QACjB,yCAAyC;QACzC,MAAM,CAAC,EAAE,eAAe,GAAG,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,iBAAiB,CAAC;KACxF,CAAC;CACH,CAAC"}
|
package/dist/lib/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","names":[],"sources":["../../src/lib/types.ts"],"sourcesContent":["import type {LoaderOptions} from '@loaders.gl/loader-utils';\n\n/** For local coordinates, the tileIndex is not required */\ntype MVTLocalCoordinatesOptions = {\n /**\n * When set to `local`, the parser will return a flat array of GeoJSON objects with local coordinates decoded from tile origin.\n */\n coordinates: 'local';\n tileIndex: null;\n};\n\n/** In WGS84 coordinates, the tileIndex is required */\ntype MVTWgs84CoordinatesOptions = {\n /**\n * When set to `wgs84`, the parser will return a flat array of GeoJSON objects with coordinates in longitude, latitude decoded from the provided tile index.\n */\n coordinates?: 'wgs84';\n\n /**\n * Mandatory with `wgs84` coordinates option. An object containing tile index values (`x`, `y`,\n * `z`) to reproject features' coordinates into WGS84.\n */\n tileIndex?: {x: number; y: number; z: number};\n};\n\nexport type MVTOptions = (MVTLocalCoordinatesOptions | MVTWgs84CoordinatesOptions) & {\n shape?: 'geojson-table' | 'columnar-table' | 'geojson' | 'binary' | 'binary-geometry';\n /**\n * When non-`null`, the layer name of each feature is added to\n * `feature.properties[layerProperty]`. (A `feature.properties` object is created if the feature\n * has no existing properties). If set to `null`, a layer name property will not be added.\n */\n layerProperty?: string | number;\n\n /**\n * Optional list of layer names. If not `null`, only features belonging to the named layers will\n * be included in the output. If `null`, features from all layers are returned.\n */\n layers?: string[];\n};\n\nexport type MVTMapboxGeometry = {\n type?: string;\n id?: number;\n length: number;\n coordinates?: any[];\n};\n\nexport type MVTMapboxCoordinates = {\n type: string;\n geometry: {\n type: string;\n coordinates: MVTMapboxGeometry;\n };\n properties: {[x: string]: string | number | boolean | null};\n id?: number;\n};\n\nexport type MVTLoaderOptions = LoaderOptions & {\n mvt?: MVTOptions;\n gis?: {\n
|
|
1
|
+
{"version":3,"file":"types.js","names":[],"sources":["../../src/lib/types.ts"],"sourcesContent":["import type {LoaderOptions} from '@loaders.gl/loader-utils';\n\n/** For local coordinates, the tileIndex is not required */\ntype MVTLocalCoordinatesOptions = {\n /**\n * When set to `local`, the parser will return a flat array of GeoJSON objects with local coordinates decoded from tile origin.\n */\n coordinates: 'local';\n tileIndex: null;\n};\n\n/** In WGS84 coordinates, the tileIndex is required */\ntype MVTWgs84CoordinatesOptions = {\n /**\n * When set to `wgs84`, the parser will return a flat array of GeoJSON objects with coordinates in longitude, latitude decoded from the provided tile index.\n */\n coordinates?: 'wgs84';\n\n /**\n * Mandatory with `wgs84` coordinates option. An object containing tile index values (`x`, `y`,\n * `z`) to reproject features' coordinates into WGS84.\n */\n tileIndex?: {x: number; y: number; z: number};\n};\n\nexport type MVTOptions = (MVTLocalCoordinatesOptions | MVTWgs84CoordinatesOptions) & {\n shape?: 'geojson-table' | 'columnar-table' | 'geojson' | 'binary' | 'binary-geometry';\n /**\n * When non-`null`, the layer name of each feature is added to\n * `feature.properties[layerProperty]`. (A `feature.properties` object is created if the feature\n * has no existing properties). If set to `null`, a layer name property will not be added.\n */\n layerProperty?: string | number;\n\n /**\n * Optional list of layer names. If not `null`, only features belonging to the named layers will\n * be included in the output. If `null`, features from all layers are returned.\n */\n layers?: string[];\n};\n\nexport type MVTMapboxGeometry = {\n type?: string;\n id?: number;\n length: number;\n coordinates?: any[];\n};\n\nexport type MVTMapboxCoordinates = {\n type: string;\n geometry: {\n type: string;\n coordinates: MVTMapboxGeometry;\n };\n properties: {[x: string]: string | number | boolean | null};\n id?: number;\n};\n\nexport type MVTLoaderOptions = LoaderOptions & {\n mvt?: MVTOptions;\n gis?: {\n /** `true`: parser will output the data in binary format. Equivalent to loading the data as GeoJSON and then applying geojsonToBinary */\n binary?: boolean;\n /** @deprecated. Use options.mvt.shape */\n format?: 'geojson-table' | 'columnar-table' | 'geojson' | 'binary' | 'binary-geometry';\n };\n};\n"],"mappings":""}
|
package/dist/mvt-loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import parseMVT from "./lib/parse-mvt.js";
|
|
2
|
-
const VERSION = typeof "4.1.0
|
|
2
|
+
const VERSION = typeof "4.1.0" !== 'undefined' ? "4.1.0" : 'latest';
|
|
3
3
|
export const MVTWorkerLoader = {
|
|
4
4
|
name: 'Mapbox Vector Tile',
|
|
5
5
|
id: 'mvt',
|
package/dist/mvt-loader.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mvt-loader.js","names":["parseMVT","VERSION","MVTWorkerLoader","name","id","module","version","extensions","mimeTypes","worker","category","options","mvt","shape","coordinates","layerProperty","layers","undefined","tileIndex","MVTLoader","parse","arrayBuffer","parseSync","binary"],"sources":["../src/mvt-loader.ts"],"sourcesContent":["import type {Loader, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {MVTLoaderOptions} from './lib/types';\n// import type {\n// Feature,\n// BinaryFeatureCollection,\n// GeoJSONTable,\n// Geometry,\n// GeoJsonProperties\n// } from '@loaders.gl/schema';\nimport parseMVT from './lib/parse-mvt';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * Worker loader for the Mapbox Vector Tile format\n */\nexport const MVTWorkerLoader: Loader<\n any, // BinaryFeatureCollection | GeoJSONTable | Feature<Geometry, GeoJsonProperties>,\n never,\n MVTLoaderOptions\n> = {\n name: 'Mapbox Vector Tile',\n id: 'mvt',\n module: 'mvt',\n version: VERSION,\n // Note: ArcGIS uses '.pbf' extension and 'application/octet-stream'\n extensions: ['mvt', 'pbf'],\n mimeTypes: [\n // https://www.iana.org/assignments/media-types/application/vnd.mapbox-vector-tile\n 'application/vnd.mapbox-vector-tile',\n 'application/x-protobuf'\n // 'application/octet-stream'\n ],\n worker: true,\n category: 'geometry',\n options: {\n mvt: {\n shape: 'geojson',\n coordinates: 'local',\n layerProperty: 'layerName',\n layers: undefined,\n tileIndex: null\n }\n }\n};\n\n/**\n * Loader for the Mapbox Vector Tile format\n */\nexport const MVTLoader: LoaderWithParser<\n any, // BinaryFeatureCollection | GeoJSONTable | Feature<Geometry, GeoJsonProperties>,\n never,\n MVTLoaderOptions\n> = {\n ...MVTWorkerLoader,\n parse: async (arrayBuffer, options?: MVTLoaderOptions) => parseMVT(arrayBuffer, options),\n parseSync: parseMVT,\n binary: true\n};\n"],"mappings":"OASOA,QAAQ;AAIf,MAAMC,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"mvt-loader.js","names":["parseMVT","VERSION","MVTWorkerLoader","name","id","module","version","extensions","mimeTypes","worker","category","options","mvt","shape","coordinates","layerProperty","layers","undefined","tileIndex","MVTLoader","parse","arrayBuffer","parseSync","binary"],"sources":["../src/mvt-loader.ts"],"sourcesContent":["import type {Loader, LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {MVTLoaderOptions} from './lib/types';\n// import type {\n// Feature,\n// BinaryFeatureCollection,\n// GeoJSONTable,\n// Geometry,\n// GeoJsonProperties\n// } from '@loaders.gl/schema';\nimport parseMVT from './lib/parse-mvt';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/**\n * Worker loader for the Mapbox Vector Tile format\n */\nexport const MVTWorkerLoader: Loader<\n any, // BinaryFeatureCollection | GeoJSONTable | Feature<Geometry, GeoJsonProperties>,\n never,\n MVTLoaderOptions\n> = {\n name: 'Mapbox Vector Tile',\n id: 'mvt',\n module: 'mvt',\n version: VERSION,\n // Note: ArcGIS uses '.pbf' extension and 'application/octet-stream'\n extensions: ['mvt', 'pbf'],\n mimeTypes: [\n // https://www.iana.org/assignments/media-types/application/vnd.mapbox-vector-tile\n 'application/vnd.mapbox-vector-tile',\n 'application/x-protobuf'\n // 'application/octet-stream'\n ],\n worker: true,\n category: 'geometry',\n options: {\n mvt: {\n shape: 'geojson',\n coordinates: 'local',\n layerProperty: 'layerName',\n layers: undefined,\n tileIndex: null\n }\n }\n};\n\n/**\n * Loader for the Mapbox Vector Tile format\n */\nexport const MVTLoader: LoaderWithParser<\n any, // BinaryFeatureCollection | GeoJSONTable | Feature<Geometry, GeoJsonProperties>,\n never,\n MVTLoaderOptions\n> = {\n ...MVTWorkerLoader,\n parse: async (arrayBuffer, options?: MVTLoaderOptions) => parseMVT(arrayBuffer, options),\n parseSync: parseMVT,\n binary: true\n};\n"],"mappings":"OASOA,QAAQ;AAIf,MAAMC,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAK3E,OAAO,MAAMC,eAIZ,GAAG;EACFC,IAAI,EAAE,oBAAoB;EAC1BC,EAAE,EAAE,KAAK;EACTC,MAAM,EAAE,KAAK;EACbC,OAAO,EAAEL,OAAO;EAEhBM,UAAU,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC;EAC1BC,SAAS,EAAE,CAET,oCAAoC,EACpC,wBAAwB,CAEzB;EACDC,MAAM,EAAE,IAAI;EACZC,QAAQ,EAAE,UAAU;EACpBC,OAAO,EAAE;IACPC,GAAG,EAAE;MACHC,KAAK,EAAE,SAAS;MAChBC,WAAW,EAAE,OAAO;MACpBC,aAAa,EAAE,WAAW;MAC1BC,MAAM,EAAEC,SAAS;MACjBC,SAAS,EAAE;IACb;EACF;AACF,CAAC;AAKD,OAAO,MAAMC,SAIZ,GAAG;EACF,GAAGjB,eAAe;EAClBkB,KAAK,EAAE,MAAAA,CAAOC,WAAW,EAAEV,OAA0B,KAAKX,QAAQ,CAACqB,WAAW,EAAEV,OAAO,CAAC;EACxFW,SAAS,EAAEtB,QAAQ;EACnBuB,MAAM,EAAE;AACV,CAAC"}
|
package/dist/mvt-worker.js
CHANGED
package/dist/tilejson-loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { parseTileJSON } from "./lib/parse-tilejson.js";
|
|
2
|
-
const VERSION = typeof "4.1.0
|
|
2
|
+
const VERSION = typeof "4.1.0" !== 'undefined' ? "4.1.0" : 'latest';
|
|
3
3
|
export const TileJSONLoader = {
|
|
4
4
|
name: 'TileJSON',
|
|
5
5
|
id: 'tilejson',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tilejson-loader.js","names":["parseTileJSON","VERSION","TileJSONLoader","name","id","module","version","worker","extensions","mimeTypes","text","options","tilejson","maxValues","undefined","parse","arrayBuffer","jsonString","TextDecoder","decode","json","JSON","tilejsonOptions","parseTextSync"],"sources":["../src/tilejson-loader.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {TileJSON} from './lib/parse-tilejson';\nimport {parseTileJSON} from './lib/parse-tilejson';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type TileJSONLoaderOptions = LoaderOptions & {\n /** Options for the TileJSONLoader */\n tilejson?: {\n /** Max number of unique values */\n maxValues?: number;\n };\n};\n\n/**\n * Loader for TileJSON metadata\n */\nexport const TileJSONLoader: LoaderWithParser<TileJSON, never, TileJSONLoaderOptions> = {\n name: 'TileJSON',\n id: 'tilejson',\n module: 'pmtiles',\n version: VERSION,\n worker: true,\n extensions: ['json'],\n mimeTypes: ['application/json'],\n text: true,\n options: {\n tilejson: {\n maxValues: undefined\n }\n },\n parse: async (arrayBuffer, options?: TileJSONLoaderOptions) => {\n const jsonString = new TextDecoder().decode(arrayBuffer);\n const json = JSON.parse(jsonString);\n const tilejsonOptions = {...TileJSONLoader.options.tilejson, ...options?.tilejson};\n return parseTileJSON(json, tilejsonOptions) as TileJSON;\n },\n parseTextSync: (text, options) => {\n const json = JSON.parse(text);\n const tilejsonOptions = {...TileJSONLoader.options.tilejson, ...options?.tilejson};\n return parseTileJSON(json, tilejsonOptions) as TileJSON;\n }\n};\n"],"mappings":"SAMQA,aAAa;AAIrB,MAAMC,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"tilejson-loader.js","names":["parseTileJSON","VERSION","TileJSONLoader","name","id","module","version","worker","extensions","mimeTypes","text","options","tilejson","maxValues","undefined","parse","arrayBuffer","jsonString","TextDecoder","decode","json","JSON","tilejsonOptions","parseTextSync"],"sources":["../src/tilejson-loader.ts"],"sourcesContent":["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {LoaderWithParser, LoaderOptions} from '@loaders.gl/loader-utils';\nimport type {TileJSON} from './lib/parse-tilejson';\nimport {parseTileJSON} from './lib/parse-tilejson';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\nexport type TileJSONLoaderOptions = LoaderOptions & {\n /** Options for the TileJSONLoader */\n tilejson?: {\n /** Max number of unique values */\n maxValues?: number;\n };\n};\n\n/**\n * Loader for TileJSON metadata\n */\nexport const TileJSONLoader: LoaderWithParser<TileJSON, never, TileJSONLoaderOptions> = {\n name: 'TileJSON',\n id: 'tilejson',\n module: 'pmtiles',\n version: VERSION,\n worker: true,\n extensions: ['json'],\n mimeTypes: ['application/json'],\n text: true,\n options: {\n tilejson: {\n maxValues: undefined\n }\n },\n parse: async (arrayBuffer, options?: TileJSONLoaderOptions) => {\n const jsonString = new TextDecoder().decode(arrayBuffer);\n const json = JSON.parse(jsonString);\n const tilejsonOptions = {...TileJSONLoader.options.tilejson, ...options?.tilejson};\n return parseTileJSON(json, tilejsonOptions) as TileJSON;\n },\n parseTextSync: (text, options) => {\n const json = JSON.parse(text);\n const tilejsonOptions = {...TileJSONLoader.options.tilejson, ...options?.tilejson};\n return parseTileJSON(json, tilejsonOptions) as TileJSON;\n }\n};\n"],"mappings":"SAMQA,aAAa;AAIrB,MAAMC,OAAO,GAAG,cAAkB,KAAK,WAAW,aAAiB,QAAQ;AAa3E,OAAO,MAAMC,cAAwE,GAAG;EACtFC,IAAI,EAAE,UAAU;EAChBC,EAAE,EAAE,UAAU;EACdC,MAAM,EAAE,SAAS;EACjBC,OAAO,EAAEL,OAAO;EAChBM,MAAM,EAAE,IAAI;EACZC,UAAU,EAAE,CAAC,MAAM,CAAC;EACpBC,SAAS,EAAE,CAAC,kBAAkB,CAAC;EAC/BC,IAAI,EAAE,IAAI;EACVC,OAAO,EAAE;IACPC,QAAQ,EAAE;MACRC,SAAS,EAAEC;IACb;EACF,CAAC;EACDC,KAAK,EAAE,MAAAA,CAAOC,WAAW,EAAEL,OAA+B,KAAK;IAC7D,MAAMM,UAAU,GAAG,IAAIC,WAAW,CAAC,CAAC,CAACC,MAAM,CAACH,WAAW,CAAC;IACxD,MAAMI,IAAI,GAAGC,IAAI,CAACN,KAAK,CAACE,UAAU,CAAC;IACnC,MAAMK,eAAe,GAAG;MAAC,GAAGpB,cAAc,CAACS,OAAO,CAACC,QAAQ;MAAE,IAAGD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,QAAQ;IAAA,CAAC;IAClF,OAAOZ,aAAa,CAACoB,IAAI,EAAEE,eAAe,CAAC;EAC7C,CAAC;EACDC,aAAa,EAAEA,CAACb,IAAI,EAAEC,OAAO,KAAK;IAChC,MAAMS,IAAI,GAAGC,IAAI,CAACN,KAAK,CAACL,IAAI,CAAC;IAC7B,MAAMY,eAAe,GAAG;MAAC,GAAGpB,cAAc,CAACS,OAAO,CAACC,QAAQ;MAAE,IAAGD,OAAO,aAAPA,OAAO,uBAAPA,OAAO,CAAEC,QAAQ;IAAA,CAAC;IAClF,OAAOZ,aAAa,CAACoB,IAAI,EAAEE,eAAe,CAAC;EAC7C;AACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/mvt",
|
|
3
3
|
"description": "Loader for Mapbox Vector Tiles",
|
|
4
|
-
"version": "4.1.0
|
|
4
|
+
"version": "4.1.0",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"publishConfig": {
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"module": "dist/index.js",
|
|
24
24
|
"exports": {
|
|
25
25
|
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
26
27
|
"import": "./dist/index.js",
|
|
27
|
-
"require": "./dist/index.cjs"
|
|
28
|
-
"types": "./dist/index.d.ts"
|
|
28
|
+
"require": "./dist/index.cjs"
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"sideEffects": false,
|
|
@@ -40,15 +40,15 @@
|
|
|
40
40
|
"build-worker": "esbuild src/workers/mvt-worker.ts --bundle --outfile=dist/mvt-worker.js --define:__VERSION__=\\\"$npm_package_version\\\""
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@loaders.gl/gis": "4.1.0
|
|
44
|
-
"@loaders.gl/images": "4.1.0
|
|
45
|
-
"@loaders.gl/loader-utils": "4.1.0
|
|
46
|
-
"@loaders.gl/schema": "4.1.0
|
|
43
|
+
"@loaders.gl/gis": "4.1.0",
|
|
44
|
+
"@loaders.gl/images": "4.1.0",
|
|
45
|
+
"@loaders.gl/loader-utils": "4.1.0",
|
|
46
|
+
"@loaders.gl/schema": "4.1.0",
|
|
47
47
|
"@math.gl/polygon": "^4.0.0",
|
|
48
48
|
"pbf": "^3.2.1"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/pbf": "^3.0.2"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "75961cc7a6ed6679018c0e3fb6eb5c3c74d97bdb"
|
|
54
54
|
}
|
package/src/lib/types.ts
CHANGED
|
@@ -59,9 +59,7 @@ export type MVTMapboxCoordinates = {
|
|
|
59
59
|
export type MVTLoaderOptions = LoaderOptions & {
|
|
60
60
|
mvt?: MVTOptions;
|
|
61
61
|
gis?: {
|
|
62
|
-
/**
|
|
63
|
-
* When set to `true`, the parser will output the data in binary format. This is equivalent to loading the data as GeoJSON and then applying [geojsonToBinary](https://loaders.gl/modules/gis/docs/api-reference/geojson-to-binary).
|
|
64
|
-
*/
|
|
62
|
+
/** `true`: parser will output the data in binary format. Equivalent to loading the data as GeoJSON and then applying geojsonToBinary */
|
|
65
63
|
binary?: boolean;
|
|
66
64
|
/** @deprecated. Use options.mvt.shape */
|
|
67
65
|
format?: 'geojson-table' | 'columnar-table' | 'geojson' | 'binary' | 'binary-geometry';
|