mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
Fix traffic sign rendering and geometry conversion
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user