@loaders.gl/mvt 4.3.0-alpha.7 → 4.3.0-beta.1
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 +284 -436
- package/dist/dist.min.js +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +2 -2
- package/dist/lib/parse-mvt.d.ts +1 -2
- package/dist/lib/parse-mvt.d.ts.map +1 -1
- package/dist/lib/vector-tile/vector-tile-feature.d.ts +1 -2
- package/dist/lib/vector-tile/vector-tile-feature.d.ts.map +1 -1
- package/dist/lib/vector-tile/vector-tile-feature.js +1 -3
- package/dist/lib/vector-tiler/tile-to-geojson.d.ts.map +1 -1
- package/dist/lib/vector-tiler/tile-to-geojson.js +1 -2
- package/dist/mvt-loader.d.ts.map +1 -1
- package/dist/mvt-loader.js +1 -1
- package/dist/mvt-source.d.ts +1 -3
- package/dist/mvt-source.d.ts.map +1 -1
- package/dist/mvt-worker.js +93 -245
- package/dist/table-tile-source.d.ts +1 -1
- package/dist/table-tile-source.d.ts.map +1 -1
- package/dist/tilejson-loader.js +1 -1
- package/package.json +7 -7
- package/src/lib/parse-mvt.ts +7 -2
- package/src/lib/vector-tile/vector-tile-feature.ts +15 -5
- package/src/lib/vector-tile/vector-tile-layer.ts +12 -12
- package/src/lib/vector-tiler/tile-to-geojson.ts +1 -2
- package/src/mvt-source.ts +9 -4
- package/src/table-tile-source.ts +8 -4
package/src/lib/parse-mvt.ts
CHANGED
|
@@ -2,8 +2,13 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {
|
|
6
|
-
|
|
5
|
+
import type {
|
|
6
|
+
FlatFeature,
|
|
7
|
+
Feature,
|
|
8
|
+
GeojsonGeometryInfo,
|
|
9
|
+
GeoJSONTable,
|
|
10
|
+
BinaryFeatureCollection
|
|
11
|
+
} from '@loaders.gl/schema';
|
|
7
12
|
import {flatGeojsonToBinary} from '@loaders.gl/gis';
|
|
8
13
|
import {log} from '@loaders.gl/loader-utils';
|
|
9
14
|
import Protobuf from 'pbf';
|
|
@@ -3,12 +3,22 @@
|
|
|
3
3
|
// Copyright vis.gl contributors
|
|
4
4
|
|
|
5
5
|
// This code is forked from https://github.com/mapbox/vector-tile-js under BSD 3-clause license.
|
|
6
|
-
|
|
7
|
-
import {
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
Feature,
|
|
9
|
+
FlatFeature,
|
|
10
|
+
FlatIndexedGeometry,
|
|
11
|
+
GeojsonGeometryInfo
|
|
12
|
+
} from '@loaders.gl/schema';
|
|
8
13
|
import Protobuf from 'pbf';
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
import {
|
|
15
|
+
classifyRings,
|
|
16
|
+
classifyRingsFlat,
|
|
17
|
+
projectToLngLat,
|
|
18
|
+
projectToLngLatFlat,
|
|
19
|
+
convertToLocalCoordinates,
|
|
20
|
+
convertToLocalCoordinatesFlat
|
|
21
|
+
} from '../utils/geometry-utils';
|
|
12
22
|
|
|
13
23
|
export class VectorTileFeature {
|
|
14
24
|
properties: {[x: string]: string | number | boolean | null};
|
|
@@ -112,18 +112,18 @@ function readValueMessage(pbf: Protobuf) {
|
|
|
112
112
|
tag === 1
|
|
113
113
|
? pbf.readString()
|
|
114
114
|
: tag === 2
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
115
|
+
? pbf.readFloat()
|
|
116
|
+
: tag === 3
|
|
117
|
+
? pbf.readDouble()
|
|
118
|
+
: tag === 4
|
|
119
|
+
? pbf.readVarint64()
|
|
120
|
+
: tag === 5
|
|
121
|
+
? pbf.readVarint()
|
|
122
|
+
: tag === 6
|
|
123
|
+
? pbf.readSVarint()
|
|
124
|
+
: tag === 7
|
|
125
|
+
? pbf.readBoolean()
|
|
126
|
+
: null;
|
|
127
127
|
}
|
|
128
128
|
|
|
129
129
|
return value;
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
import {ProtoTile} from './proto-tile';
|
|
7
7
|
import {Feature, GeoJSONTable} from '@loaders.gl/schema';
|
|
8
8
|
|
|
9
|
-
import {projectToLngLat} from '../utils/geometry-utils';
|
|
10
|
-
import {convertToLocalCoordinates} from '../utils/geometry-utils';
|
|
9
|
+
import {projectToLngLat, convertToLocalCoordinates} from '../utils/geometry-utils';
|
|
11
10
|
|
|
12
11
|
// eslint-disable-next-line max-statements, complexity
|
|
13
12
|
export function convertTileToGeoJSON(
|
package/src/mvt-source.ts
CHANGED
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
import type {
|
|
6
|
+
Source,
|
|
7
|
+
ImageType,
|
|
8
|
+
DataSourceProps,
|
|
9
|
+
ImageTileSource,
|
|
10
|
+
VectorTileSource,
|
|
11
|
+
GetTileParameters,
|
|
12
|
+
GetTileDataParameters
|
|
13
|
+
} from '@loaders.gl/loader-utils';
|
|
9
14
|
import {DataSource, resolvePath} from '@loaders.gl/loader-utils';
|
|
10
15
|
import {ImageLoader, ImageLoaderOptions, getBinaryImageMetadata} from '@loaders.gl/images';
|
|
11
16
|
import {
|
package/src/table-tile-source.ts
CHANGED
|
@@ -3,16 +3,20 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
// Based on https://github.com/mapbox/geojson-vt under compatible ISC license
|
|
5
5
|
|
|
6
|
-
import {Source} from '@loaders.gl/loader-utils';
|
|
6
|
+
import {Source, VectorTileSource, TileSourceMetadata, log} from '@loaders.gl/loader-utils';
|
|
7
7
|
import type {
|
|
8
8
|
VectorTileSourceProps,
|
|
9
9
|
GetTileDataParameters,
|
|
10
10
|
GetTileParameters,
|
|
11
11
|
LoaderWithParser
|
|
12
12
|
} from '@loaders.gl/loader-utils';
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
import {
|
|
14
|
+
Schema,
|
|
15
|
+
GeoJSONTable,
|
|
16
|
+
Feature,
|
|
17
|
+
BinaryFeatureCollection,
|
|
18
|
+
deduceTableSchema
|
|
19
|
+
} from '@loaders.gl/schema';
|
|
16
20
|
import {Stats, Stat} from '@probe.gl/stats';
|
|
17
21
|
|
|
18
22
|
import type {ProtoFeature} from './lib/vector-tiler/features/proto-feature';
|