diff --git a/modules/services/mapillary.js b/modules/services/mapillary.js index af0a1ee4b..fb64e1eab 100644 --- a/modules/services/mapillary.js +++ b/modules/services/mapillary.js @@ -2,7 +2,6 @@ import { dispatch as d3_dispatch } from 'd3-dispatch'; import { select as d3_select } from 'd3-selection'; -import base64 from 'base64-js'; import Protobuf from 'pbf'; import RBush from 'rbush'; import { VectorTile } from '@mapbox/vector-tile'; @@ -165,7 +164,7 @@ function loadTileDataToCache(data, tile, which) { if (vectorTile.layers.hasOwnProperty('traffic_sign')) { features = []; cache = _mlyCache[which]; - layer = vectorTile.layers.point; + layer = vectorTile.layers.traffic_sign; for (i = 0; i < layer.length; i++) { feature = layer.feature(i).toGeoJSON(tile.xyz[0], tile.xyz[1], tile.xyz[2]); @@ -719,8 +718,12 @@ export default { _mlyHighlightedDetection = null; } - const geometry = base64.toByteArray(data.geometry); - const tile = new VectorTile(new Protobuf(geometry)); + var decodedGeometry = window.atob(data.geometry); + var uintArray = new Uint8Array(decodedGeometry.length); + for (var i = 0; i < decodedGeometry.length; i++) { + uintArray[i] = decodedGeometry.charCodeAt(i); + } + const tile = new VectorTile(new Protobuf(uintArray.buffer)); const layer = tile.layers['mpy-or']; const geometries = layer.feature(0).loadGeometry(); diff --git a/package.json b/package.json index 691f4350c..7e58dd70f 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,6 @@ "abortcontroller-polyfill": "^1.4.0", "aes-js": "^3.1.2", "alif-toolkit": "^1.2.9", - "base64-js": "1.5.1", "core-js": "^3.6.5", "diacritics": "1.3.0", "fast-deep-equal": "~3.1.1",