diff --git a/modules/services/vector_tile.js b/modules/services/vector_tile.js index 99454be99..d4c741803 100644 --- a/modules/services/vector_tile.js +++ b/modules/services/vector_tile.js @@ -6,7 +6,7 @@ import stringify from 'fast-json-stable-stringify'; import polygonClipping from 'polygon-clipping'; import Protobuf from 'pbf'; -import vt from '@mapbox/vector-tile'; +import { VectorTile } from '@mapbox/vector-tile'; import { utilHashcode, utilRebind, utilTiler } from '../util'; @@ -22,7 +22,7 @@ function abortRequest(controller) { function vtToGeoJSON(data, tile, mergeCache) { - var vectorTile = new vt.VectorTile(new Protobuf(data)); + var vectorTile = new VectorTile(new Protobuf(data)); var layers = Object.keys(vectorTile.layers); if (!Array.isArray(layers)) { layers = [layers]; } diff --git a/package-lock.json b/package-lock.json index 7bfce71bd..c89fa25c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@mapbox/geojson-area": "^0.2.2", "@mapbox/sexagesimal": "1.2.0", - "@mapbox/vector-tile": "^1.3.1", + "@mapbox/vector-tile": "^2.0.2", "@rapideditor/country-coder": "~5.2.2", "@rapideditor/location-conflation": "~1.3.0", "@tmcw/togeojson": "^5.8.1", @@ -1333,8 +1333,9 @@ "dev": true }, "node_modules/@mapbox/point-geometry": { - "version": "0.1.0", - "license": "ISC" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-1.0.0.tgz", + "integrity": "sha512-1EPbCrZvs+eBayaMcPeDmwsbgG/b7vQxtYlzLI/5dA2SHctbUxFr13OE4+AdozoF8EtvbaFcfQIzWetOfooz/w==" }, "node_modules/@mapbox/sexagesimal": { "version": "1.2.0", @@ -1347,10 +1348,24 @@ } }, "node_modules/@mapbox/vector-tile": { - "version": "1.3.1", - "license": "BSD-3-Clause", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-2.0.2.tgz", + "integrity": "sha512-DGHWcOU2VzaEEzqR0CxxXaBESwEUpFy8+iLNARxZrHRgu9IoTMZgh0ugRNI67n6xXI08z3ZyrKbcdxDPtAfk8w==", "dependencies": { - "@mapbox/point-geometry": "~0.1.0" + "@mapbox/point-geometry": "~1.0.0", + "@types/geojson": "^7946.0.14", + "pbf": "^4.0.1" + } + }, + "node_modules/@mapbox/vector-tile/node_modules/pbf": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-4.0.1.tgz", + "integrity": "sha512-SuLdBvS42z33m8ejRbInMapQe8n0D3vN/Xd5fmWM3tufNgRQFBpaW2YVJxQZV4iPNqb0vEFvssMEo5w9c6BTIA==", + "dependencies": { + "resolve-protobuf-schema": "^2.1.0" + }, + "bin": { + "pbf": "bin/pbf" } }, "node_modules/@nodelib/fs.scandir": { @@ -1811,9 +1826,9 @@ "license": "MIT" }, "node_modules/@types/geojson": { - "version": "7946.0.10", - "license": "MIT", - "peer": true + "version": "7946.0.14", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.14.tgz", + "integrity": "sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg==" }, "node_modules/@types/node": { "version": "14.18.31", @@ -10221,15 +10236,31 @@ "dev": true }, "@mapbox/point-geometry": { - "version": "0.1.0" + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@mapbox/point-geometry/-/point-geometry-1.0.0.tgz", + "integrity": "sha512-1EPbCrZvs+eBayaMcPeDmwsbgG/b7vQxtYlzLI/5dA2SHctbUxFr13OE4+AdozoF8EtvbaFcfQIzWetOfooz/w==" }, "@mapbox/sexagesimal": { "version": "1.2.0" }, "@mapbox/vector-tile": { - "version": "1.3.1", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@mapbox/vector-tile/-/vector-tile-2.0.2.tgz", + "integrity": "sha512-DGHWcOU2VzaEEzqR0CxxXaBESwEUpFy8+iLNARxZrHRgu9IoTMZgh0ugRNI67n6xXI08z3ZyrKbcdxDPtAfk8w==", "requires": { - "@mapbox/point-geometry": "~0.1.0" + "@mapbox/point-geometry": "~1.0.0", + "@types/geojson": "^7946.0.14", + "pbf": "^4.0.1" + }, + "dependencies": { + "pbf": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pbf/-/pbf-4.0.1.tgz", + "integrity": "sha512-SuLdBvS42z33m8ejRbInMapQe8n0D3vN/Xd5fmWM3tufNgRQFBpaW2YVJxQZV4iPNqb0vEFvssMEo5w9c6BTIA==", + "requires": { + "resolve-protobuf-schema": "^2.1.0" + } + } } }, "@nodelib/fs.scandir": { @@ -10526,8 +10557,9 @@ "dev": true }, "@types/geojson": { - "version": "7946.0.10", - "peer": true + "version": "7946.0.14", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.14.tgz", + "integrity": "sha512-WCfD5Ht3ZesJUsONdhvm84dmzWOiOzOAqOncN0++w0lBw1o8OuDNJF2McvvCef/yBqb/HYRahp1BYtODFQ8bRg==" }, "@types/node": { "version": "14.18.31", diff --git a/package.json b/package.json index e1327a451..7192caabf 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "dependencies": { "@mapbox/geojson-area": "^0.2.2", "@mapbox/sexagesimal": "1.2.0", - "@mapbox/vector-tile": "^1.3.1", + "@mapbox/vector-tile": "^2.0.2", "@rapideditor/country-coder": "~5.2.2", "@rapideditor/location-conflation": "~1.3.0", "@tmcw/togeojson": "^5.8.1",