@loaders.gl/mvt 4.2.1 → 4.3.0-alpha.2
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 +1784 -847
- package/dist/dist.min.js +1 -1
- package/dist/index.cjs +713 -640
- package/dist/index.cjs.map +4 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/parse-mvt.d.ts +2 -1
- package/dist/lib/parse-mvt.d.ts.map +1 -1
- package/dist/lib/parse-mvt.js +15 -45
- package/dist/lib/parse-tilejson.d.ts +4 -4
- package/dist/lib/parse-tilejson.d.ts.map +1 -1
- package/dist/lib/types.d.ts +1 -39
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/lib/utils/geometry-utils.d.ts +83 -0
- package/dist/lib/utils/geometry-utils.d.ts.map +1 -0
- package/dist/lib/utils/geometry-utils.js +206 -0
- package/dist/lib/vector-tile/vector-tile-feature.d.ts +72 -0
- package/dist/lib/vector-tile/vector-tile-feature.d.ts.map +1 -0
- package/dist/lib/vector-tile/vector-tile-feature.js +342 -0
- package/dist/lib/{mapbox-vector-tile → vector-tile}/vector-tile-layer.d.ts +10 -1
- package/dist/lib/vector-tile/vector-tile-layer.d.ts.map +1 -0
- package/dist/lib/{mapbox-vector-tile → vector-tile}/vector-tile-layer.js +16 -1
- package/dist/lib/vector-tile/vector-tile.d.ts.map +1 -0
- package/dist/lib/{geojson-tiler → vector-tiler}/clip.d.ts +3 -3
- package/dist/lib/vector-tiler/clip.d.ts.map +1 -0
- package/dist/lib/vector-tiler/convert.d.ts +18 -0
- package/dist/lib/vector-tiler/convert.d.ts.map +1 -0
- package/dist/lib/{geojson-tiler → vector-tiler}/convert.js +8 -1
- package/dist/lib/vector-tiler/feature.d.ts +3 -0
- package/dist/lib/vector-tiler/feature.d.ts.map +1 -0
- package/dist/lib/vector-tiler/simplify.d.ts.map +1 -0
- package/dist/lib/{geojson-tiler → vector-tiler}/tile.d.ts +4 -4
- package/dist/lib/vector-tiler/tile.d.ts.map +1 -0
- package/dist/lib/vector-tiler/transform.d.ts +7 -0
- package/dist/lib/vector-tiler/transform.d.ts.map +1 -0
- package/dist/lib/{geojson-tiler → vector-tiler}/wrap.d.ts +2 -2
- package/dist/lib/vector-tiler/wrap.d.ts.map +1 -0
- package/dist/mvt-loader.d.ts +19 -8
- package/dist/mvt-loader.d.ts.map +1 -1
- package/dist/mvt-loader.js +3 -2
- package/dist/mvt-source.d.ts +4 -4
- package/dist/mvt-source.d.ts.map +1 -1
- package/dist/mvt-source.js +7 -7
- package/dist/mvt-worker.js +1244 -762
- package/dist/table-tile-source.d.ts +118 -0
- package/dist/table-tile-source.d.ts.map +1 -0
- package/dist/table-tile-source.js +370 -0
- package/dist/tilejson-loader.js +1 -1
- package/package.json +7 -6
- package/src/index.ts +3 -3
- package/src/lib/parse-mvt.ts +28 -66
- package/src/lib/parse-tilejson.ts +5 -5
- package/src/lib/types.ts +1 -39
- package/src/lib/utils/geometry-utils.ts +234 -0
- package/src/lib/vector-tile/vector-tile-feature.ts +416 -0
- package/src/lib/{mapbox-vector-tile → vector-tile}/vector-tile-layer.ts +28 -2
- package/src/lib/{geojson-tiler → vector-tiler}/clip.ts +4 -4
- package/src/lib/{geojson-tiler → vector-tiler}/convert.ts +19 -9
- package/src/lib/{geojson-tiler → vector-tiler}/feature.ts +3 -3
- package/src/lib/{geojson-tiler → vector-tiler}/tile.ts +10 -10
- package/src/lib/{geojson-tiler → vector-tiler}/transform.ts +2 -2
- package/src/lib/{geojson-tiler → vector-tiler}/wrap.ts +5 -5
- package/src/mvt-loader.ts +14 -6
- package/src/mvt-source.ts +9 -10
- package/src/table-tile-source.ts +508 -0
- package/dist/helpers/binary-util-functions.d.ts +0 -35
- package/dist/helpers/binary-util-functions.d.ts.map +0 -1
- package/dist/helpers/binary-util-functions.js +0 -114
- package/dist/helpers/mapbox-util-functions.d.ts +0 -29
- package/dist/helpers/mapbox-util-functions.d.ts.map +0 -1
- package/dist/helpers/mapbox-util-functions.js +0 -78
- package/dist/lib/binary-vector-tile/vector-tile-feature.d.ts +0 -41
- package/dist/lib/binary-vector-tile/vector-tile-feature.d.ts.map +0 -1
- package/dist/lib/binary-vector-tile/vector-tile-feature.js +0 -163
- package/dist/lib/binary-vector-tile/vector-tile-layer.d.ts +0 -23
- package/dist/lib/binary-vector-tile/vector-tile-layer.d.ts.map +0 -1
- package/dist/lib/binary-vector-tile/vector-tile-layer.js +0 -96
- package/dist/lib/binary-vector-tile/vector-tile.d.ts +0 -9
- package/dist/lib/binary-vector-tile/vector-tile.d.ts.map +0 -1
- package/dist/lib/binary-vector-tile/vector-tile.js +0 -27
- package/dist/lib/geojson-tiler/clip.d.ts.map +0 -1
- package/dist/lib/geojson-tiler/convert.d.ts +0 -10
- package/dist/lib/geojson-tiler/convert.d.ts.map +0 -1
- package/dist/lib/geojson-tiler/feature.d.ts +0 -3
- package/dist/lib/geojson-tiler/feature.d.ts.map +0 -1
- package/dist/lib/geojson-tiler/geojson-tiler.d.ts +0 -44
- package/dist/lib/geojson-tiler/geojson-tiler.d.ts.map +0 -1
- package/dist/lib/geojson-tiler/geojson-tiler.js +0 -209
- package/dist/lib/geojson-tiler/simplify.d.ts.map +0 -1
- package/dist/lib/geojson-tiler/tile.d.ts.map +0 -1
- package/dist/lib/geojson-tiler/transform.d.ts +0 -7
- package/dist/lib/geojson-tiler/transform.d.ts.map +0 -1
- package/dist/lib/geojson-tiler/wrap.d.ts.map +0 -1
- package/dist/lib/mapbox-vector-tile/vector-tile-feature.d.ts +0 -27
- package/dist/lib/mapbox-vector-tile/vector-tile-feature.d.ts.map +0 -1
- package/dist/lib/mapbox-vector-tile/vector-tile-feature.js +0 -178
- package/dist/lib/mapbox-vector-tile/vector-tile-layer.d.ts.map +0 -1
- package/dist/lib/mapbox-vector-tile/vector-tile.d.ts.map +0 -1
- package/src/helpers/binary-util-functions.ts +0 -125
- package/src/helpers/mapbox-util-functions.ts +0 -82
- package/src/lib/binary-vector-tile/vector-tile-feature.ts +0 -203
- package/src/lib/binary-vector-tile/vector-tile-layer.ts +0 -113
- package/src/lib/binary-vector-tile/vector-tile.ts +0 -36
- package/src/lib/geojson-tiler/geojson-tiler.ts +0 -283
- package/src/lib/mapbox-vector-tile/LICENSE.txt +0 -31
- package/src/lib/mapbox-vector-tile/vector-tile-feature.ts +0 -207
- /package/dist/lib/{mapbox-vector-tile → vector-tile}/vector-tile.d.ts +0 -0
- /package/dist/lib/{mapbox-vector-tile → vector-tile}/vector-tile.js +0 -0
- /package/dist/lib/{geojson-tiler → vector-tiler}/clip.js +0 -0
- /package/dist/lib/{geojson-tiler → vector-tiler}/feature.js +0 -0
- /package/dist/lib/{geojson-tiler → vector-tiler}/simplify.d.ts +0 -0
- /package/dist/lib/{geojson-tiler → vector-tiler}/simplify.js +0 -0
- /package/dist/lib/{geojson-tiler → vector-tiler}/tile.js +0 -0
- /package/dist/lib/{geojson-tiler → vector-tiler}/transform.js +0 -0
- /package/dist/lib/{geojson-tiler → vector-tiler}/wrap.js +0 -0
- /package/src/lib/{binary-vector-tile → vector-tile}/LICENSE.txt +0 -0
- /package/src/lib/{mapbox-vector-tile → vector-tile}/vector-tile.ts +0 -0
- /package/src/lib/{geojson-tiler → vector-tiler}/LICENSE +0 -0
- /package/src/lib/{geojson-tiler → vector-tiler}/simplify.ts +0 -0
package/dist/mvt-source.js
CHANGED
|
@@ -67,8 +67,8 @@ export class MVTSource extends DataSource {
|
|
|
67
67
|
getTileMIMEType() {
|
|
68
68
|
return this.mimeType;
|
|
69
69
|
}
|
|
70
|
-
async getTile(
|
|
71
|
-
const { x, y,
|
|
70
|
+
async getTile(parameters) {
|
|
71
|
+
const { x, y, z } = parameters;
|
|
72
72
|
const tileUrl = this.getTileURL(x, y, z);
|
|
73
73
|
const response = await this.fetch(tileUrl);
|
|
74
74
|
if (!response.ok) {
|
|
@@ -79,11 +79,11 @@ export class MVTSource extends DataSource {
|
|
|
79
79
|
}
|
|
80
80
|
// Tile Source interface implementation: deck.gl compatible API
|
|
81
81
|
// TODO - currently only handles image tiles, not vector tiles
|
|
82
|
-
async getTileData(
|
|
83
|
-
const { x, y, z } =
|
|
82
|
+
async getTileData(parameters) {
|
|
83
|
+
const { x, y, z } = parameters.index;
|
|
84
84
|
// const metadata = await this.metadata;
|
|
85
85
|
// mimeType = metadata?.tileMIMEType || 'application/vnd.mapbox-vector-tile';
|
|
86
|
-
const arrayBuffer = await this.getTile({ x, y,
|
|
86
|
+
const arrayBuffer = await this.getTile({ x, y, z, layers: [] });
|
|
87
87
|
if (arrayBuffer === null) {
|
|
88
88
|
return null;
|
|
89
89
|
}
|
|
@@ -92,7 +92,7 @@ export class MVTSource extends DataSource {
|
|
|
92
92
|
this.mimeType || imageMetadata?.mimeType || 'application/vnd.mapbox-vector-tile';
|
|
93
93
|
switch (this.mimeType) {
|
|
94
94
|
case 'application/vnd.mapbox-vector-tile':
|
|
95
|
-
return await this._parseVectorTile(arrayBuffer, { x, y,
|
|
95
|
+
return await this._parseVectorTile(arrayBuffer, { x, y, z, layers: [] });
|
|
96
96
|
default:
|
|
97
97
|
return await this._parseImageTile(arrayBuffer);
|
|
98
98
|
}
|
|
@@ -115,7 +115,7 @@ export class MVTSource extends DataSource {
|
|
|
115
115
|
shape: 'geojson-table',
|
|
116
116
|
mvt: {
|
|
117
117
|
coordinates: 'wgs84',
|
|
118
|
-
tileIndex: { x: tileParams.x, y: tileParams.y, z: tileParams.
|
|
118
|
+
tileIndex: { x: tileParams.x, y: tileParams.y, z: tileParams.z },
|
|
119
119
|
...this.loadOptions?.mvt
|
|
120
120
|
},
|
|
121
121
|
...this.loadOptions
|