@loaders.gl/mvt 3.1.0-alpha.4 → 3.1.0-beta.3
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/bundle.d.ts +2 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +2277 -0
- package/dist/es5/bundle.js +1 -1
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/helpers/binary-util-functions.js +18 -18
- package/dist/es5/helpers/binary-util-functions.js.map +1 -1
- package/dist/es5/helpers/mapbox-util-functions.js +11 -11
- package/dist/es5/helpers/mapbox-util-functions.js.map +1 -1
- package/dist/es5/index.js +2 -2
- package/dist/es5/lib/binary-vector-tile/features-to-binary.js +130 -177
- package/dist/es5/lib/binary-vector-tile/features-to-binary.js.map +1 -1
- package/dist/es5/lib/binary-vector-tile/vector-tile-feature.js +104 -131
- package/dist/es5/lib/binary-vector-tile/vector-tile-feature.js.map +1 -1
- package/dist/es5/lib/binary-vector-tile/vector-tile-layer.js +15 -23
- package/dist/es5/lib/binary-vector-tile/vector-tile-layer.js.map +1 -1
- package/dist/es5/lib/binary-vector-tile/vector-tile.js +8 -8
- package/dist/es5/lib/binary-vector-tile/vector-tile.js.map +1 -1
- package/dist/es5/lib/mapbox-vector-tile/vector-tile-feature.js +147 -157
- package/dist/es5/lib/mapbox-vector-tile/vector-tile-feature.js.map +1 -1
- package/dist/es5/lib/mapbox-vector-tile/vector-tile-layer.js +15 -23
- package/dist/es5/lib/mapbox-vector-tile/vector-tile-layer.js.map +1 -1
- package/dist/es5/lib/mapbox-vector-tile/vector-tile.js +8 -8
- package/dist/es5/lib/mapbox-vector-tile/vector-tile.js.map +1 -1
- package/dist/es5/lib/parse-mvt.js +33 -35
- package/dist/es5/lib/parse-mvt.js.map +1 -1
- package/dist/es5/mvt-loader.js +5 -38
- package/dist/es5/mvt-loader.js.map +1 -1
- package/dist/esm/lib/binary-vector-tile/vector-tile-feature.js +2 -2
- package/dist/esm/lib/binary-vector-tile/vector-tile-feature.js.map +1 -1
- package/dist/esm/lib/mapbox-vector-tile/vector-tile-feature.js +3 -3
- package/dist/esm/lib/mapbox-vector-tile/vector-tile-feature.js.map +1 -1
- package/dist/esm/lib/parse-mvt.js.map +1 -1
- package/dist/esm/mvt-loader.js +1 -1
- package/dist/esm/mvt-loader.js.map +1 -1
- package/dist/helpers/binary-util-functions.d.ts +39 -0
- package/dist/helpers/binary-util-functions.d.ts.map +1 -0
- package/dist/helpers/binary-util-functions.js +116 -0
- package/dist/helpers/mapbox-util-functions.d.ts +29 -0
- package/dist/helpers/mapbox-util-functions.d.ts.map +1 -0
- package/dist/helpers/mapbox-util-functions.js +82 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/lib/binary-vector-tile/features-to-binary.d.ts +185 -0
- package/dist/lib/binary-vector-tile/features-to-binary.d.ts.map +1 -0
- package/dist/lib/binary-vector-tile/features-to-binary.js +353 -0
- package/dist/lib/binary-vector-tile/vector-tile-feature.d.ts +36 -0
- package/dist/lib/binary-vector-tile/vector-tile-feature.d.ts.map +1 -0
- package/dist/lib/binary-vector-tile/vector-tile-feature.js +159 -0
- package/dist/lib/binary-vector-tile/vector-tile-layer.d.ts +23 -0
- package/dist/lib/binary-vector-tile/vector-tile-layer.d.ts.map +1 -0
- package/dist/lib/binary-vector-tile/vector-tile-layer.js +91 -0
- package/dist/lib/binary-vector-tile/vector-tile.d.ts +9 -0
- package/dist/lib/binary-vector-tile/vector-tile.d.ts.map +1 -0
- package/dist/lib/binary-vector-tile/vector-tile.js +29 -0
- package/dist/lib/mapbox-vector-tile/vector-tile-feature.d.ts +27 -0
- package/dist/lib/mapbox-vector-tile/vector-tile-feature.d.ts.map +1 -0
- package/dist/lib/mapbox-vector-tile/vector-tile-feature.js +170 -0
- package/dist/lib/mapbox-vector-tile/vector-tile-layer.d.ts +20 -0
- package/dist/lib/mapbox-vector-tile/vector-tile-layer.d.ts.map +1 -0
- package/dist/lib/mapbox-vector-tile/vector-tile-layer.js +89 -0
- package/dist/lib/mapbox-vector-tile/vector-tile.d.ts +9 -0
- package/dist/lib/mapbox-vector-tile/vector-tile.d.ts.map +1 -0
- package/dist/lib/mapbox-vector-tile/vector-tile.js +29 -0
- package/dist/lib/parse-mvt.d.ts +85 -0
- package/dist/lib/parse-mvt.d.ts.map +1 -0
- package/dist/lib/parse-mvt.js +142 -0
- package/dist/lib/types.d.ts +92 -0
- package/dist/lib/types.d.ts.map +1 -0
- package/dist/lib/types.js +2 -0
- package/dist/mvt-loader.d.ts +10 -0
- package/dist/mvt-loader.d.ts.map +1 -0
- package/dist/mvt-loader.js +45 -0
- package/dist/mvt-worker.js +2286 -3
- package/dist/workers/mvt-worker.d.ts +2 -0
- package/dist/workers/mvt-worker.d.ts.map +1 -0
- package/dist/workers/mvt-worker.js +5 -0
- package/package.json +7 -7
- package/src/lib/parse-mvt.ts +1 -1
- package/dist/dist.min.js +0 -4
- package/dist/dist.min.js.map +0 -1
- package/dist/mvt-worker.js.map +0 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
export declare type MvtOptions = {
|
|
2
|
+
coordinates: string | number[];
|
|
3
|
+
tileIndex: {
|
|
4
|
+
x: number;
|
|
5
|
+
y: number;
|
|
6
|
+
z: number;
|
|
7
|
+
};
|
|
8
|
+
layerProperty: string | number;
|
|
9
|
+
layerName: string;
|
|
10
|
+
};
|
|
11
|
+
export declare type MvtBinaryGeometry = {
|
|
12
|
+
data: number[];
|
|
13
|
+
lines: any[];
|
|
14
|
+
areas?: number[];
|
|
15
|
+
type?: string;
|
|
16
|
+
id?: number;
|
|
17
|
+
};
|
|
18
|
+
export declare type MvtMapboxGeometry = {
|
|
19
|
+
type?: string;
|
|
20
|
+
id?: number;
|
|
21
|
+
length: number;
|
|
22
|
+
coordinates?: any[];
|
|
23
|
+
};
|
|
24
|
+
export declare type MvtBinaryCoordinates = {
|
|
25
|
+
type: string;
|
|
26
|
+
geometry: MvtBinaryGeometry;
|
|
27
|
+
properties: {
|
|
28
|
+
[x: string]: string | number | boolean | null;
|
|
29
|
+
};
|
|
30
|
+
id?: number;
|
|
31
|
+
};
|
|
32
|
+
export declare type MvtMapboxCoordinates = {
|
|
33
|
+
type: string;
|
|
34
|
+
geometry: {
|
|
35
|
+
type: string;
|
|
36
|
+
coordinates: MvtMapboxGeometry;
|
|
37
|
+
};
|
|
38
|
+
properties: {
|
|
39
|
+
[x: string]: string | number | boolean | null;
|
|
40
|
+
};
|
|
41
|
+
id?: number;
|
|
42
|
+
};
|
|
43
|
+
export declare type MvtBinaryOptions = {
|
|
44
|
+
numericPropKeys: string[];
|
|
45
|
+
PositionDataType: Float32ArrayConstructor;
|
|
46
|
+
};
|
|
47
|
+
export declare type MvtFirstPassedData = {
|
|
48
|
+
pointPositionsCount: number;
|
|
49
|
+
pointFeaturesCount: number;
|
|
50
|
+
linePositionsCount: number;
|
|
51
|
+
linePathsCount: number;
|
|
52
|
+
lineFeaturesCount: number;
|
|
53
|
+
polygonPositionsCount: number;
|
|
54
|
+
polygonObjectsCount: number;
|
|
55
|
+
polygonRingsCount: number;
|
|
56
|
+
polygonFeaturesCount: number;
|
|
57
|
+
};
|
|
58
|
+
export declare type MvtPoints = {
|
|
59
|
+
positions: Float32Array;
|
|
60
|
+
globalFeatureIds: Uint16Array | Uint32Array;
|
|
61
|
+
featureIds: Uint16Array | Uint32Array;
|
|
62
|
+
numericProps: object;
|
|
63
|
+
properties: {}[];
|
|
64
|
+
fields: {
|
|
65
|
+
id?: number;
|
|
66
|
+
}[];
|
|
67
|
+
};
|
|
68
|
+
export declare type MvtLines = {
|
|
69
|
+
pathIndices: Uint16Array | Uint32Array;
|
|
70
|
+
positions: Float32Array;
|
|
71
|
+
globalFeatureIds: Uint16Array | Uint32Array;
|
|
72
|
+
featureIds: Uint16Array | Uint32Array;
|
|
73
|
+
numericProps: object;
|
|
74
|
+
properties: {}[];
|
|
75
|
+
fields: {
|
|
76
|
+
id?: number;
|
|
77
|
+
}[];
|
|
78
|
+
};
|
|
79
|
+
export declare type MvtPolygons = {
|
|
80
|
+
polygonIndices: Uint16Array | Uint32Array;
|
|
81
|
+
primitivePolygonIndices: Uint16Array | Uint32Array;
|
|
82
|
+
positions: Float32Array;
|
|
83
|
+
triangles: number[];
|
|
84
|
+
globalFeatureIds: Uint16Array | Uint32Array;
|
|
85
|
+
featureIds: Uint16Array | Uint32Array;
|
|
86
|
+
numericProps: object;
|
|
87
|
+
properties: {}[];
|
|
88
|
+
fields: {
|
|
89
|
+
id?: number;
|
|
90
|
+
}[];
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU,GAAG;IACvB,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,SAAS,EAAE;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAC,CAAC;IAC7C,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC9B,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,KAAK,EAAE,GAAG,EAAE,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,oBAAY,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,oBAAY,oBAAoB,GAA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AAC,EAAE,MAAM,CAAC;KACb,EAAE,CAAC;CACL,CAAC;AAEF,oBAAY,QAAQ,GAAG;IACrB,WAAW,EAAE,WAAW,GAAG,WAAW,CAAC;IACvC,SAAS,EAAE,YAAY,CAAC;IACxB,gBAAgB,EAAE,WAAW,GAAG,WAAW,CAAC;IAC5C,UAAU,EAAE,WAAW,GAAG,WAAW,CAAC;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,EAAE,EAAE,CAAC;IACjB,MAAM,EAAE;QACN,EAAE,CAAC,EAAE,MAAM,CAAC;KACb,EAAE,CAAC;CACL,CAAC;AAEF,oBAAY,WAAW,GAAG;IACxB,cAAc,EAAE,WAAW,GAAG,WAAW,CAAC;IAC1C,uBAAuB,EAAE,WAAW,GAAG,WAAW,CAAC;IACnD,SAAS,EAAE,YAAY,CAAC;IACxB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,gBAAgB,EAAE,WAAW,GAAG,WAAW,CAAC;IAC5C,UAAU,EAAE,WAAW,GAAG,WAAW,CAAC;IACtC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,EAAE,EAAE,CAAC;IACjB,MAAM,EAAE;QACN,EAAE,CAAC,EAAE,MAAM,CAAC;KACb,EAAE,CAAC;CACL,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Loader, LoaderWithParser } from '@loaders.gl/loader-utils';
|
|
2
|
+
/**
|
|
3
|
+
* Worker loader for the Mapbox Vector Tile format
|
|
4
|
+
*/
|
|
5
|
+
export declare const MVTWorkerLoader: Loader;
|
|
6
|
+
/**
|
|
7
|
+
* Loader for the Mapbox Vector Tile format
|
|
8
|
+
*/
|
|
9
|
+
export declare const MVTLoader: LoaderWithParser;
|
|
10
|
+
//# sourceMappingURL=mvt-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mvt-loader.d.ts","sourceRoot":"","sources":["../src/mvt-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,MAAM,EAAE,gBAAgB,EAAC,MAAM,0BAA0B,CAAC;AAOvE;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,MAsB7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,gBAKvB,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.MVTLoader = exports.MVTWorkerLoader = void 0;
|
|
7
|
+
const parse_mvt_1 = __importDefault(require("./lib/parse-mvt"));
|
|
8
|
+
// __VERSION__ is injected by babel-plugin-version-inline
|
|
9
|
+
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
10
|
+
const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';
|
|
11
|
+
/**
|
|
12
|
+
* Worker loader for the Mapbox Vector Tile format
|
|
13
|
+
*/
|
|
14
|
+
exports.MVTWorkerLoader = {
|
|
15
|
+
name: 'Mapbox Vector Tile',
|
|
16
|
+
id: 'mvt',
|
|
17
|
+
module: 'mvt',
|
|
18
|
+
version: VERSION,
|
|
19
|
+
// Note: ArcGIS uses '.pbf' extension and 'application/octet-stream'
|
|
20
|
+
extensions: ['mvt', 'pbf'],
|
|
21
|
+
mimeTypes: [
|
|
22
|
+
'application/vnd.mapbox-vector-tile',
|
|
23
|
+
'application/x-protobuf'
|
|
24
|
+
// 'application/octet-stream'
|
|
25
|
+
],
|
|
26
|
+
worker: true,
|
|
27
|
+
category: 'geometry',
|
|
28
|
+
options: {
|
|
29
|
+
mvt: {
|
|
30
|
+
coordinates: 'local',
|
|
31
|
+
layerProperty: 'layerName',
|
|
32
|
+
layers: null,
|
|
33
|
+
tileIndex: null
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Loader for the Mapbox Vector Tile format
|
|
39
|
+
*/
|
|
40
|
+
exports.MVTLoader = {
|
|
41
|
+
...exports.MVTWorkerLoader,
|
|
42
|
+
parse: async (arrayBuffer, options) => (0, parse_mvt_1.default)(arrayBuffer, options),
|
|
43
|
+
parseSync: parse_mvt_1.default,
|
|
44
|
+
binary: true
|
|
45
|
+
};
|