From 06098feaf7de6c7556da0c6b8cef969c5f516517 Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Tue, 16 Nov 2021 15:50:26 +0100 Subject: [PATCH] Fix multilinestring rendering --- .../RenderingMultiPlexerFeatureSource.ts | 40 ++++--------------- assets/layers/gps_track/gps_track.json | 3 +- 2 files changed, 10 insertions(+), 33 deletions(-) diff --git a/Logic/FeatureSource/Sources/RenderingMultiPlexerFeatureSource.ts b/Logic/FeatureSource/Sources/RenderingMultiPlexerFeatureSource.ts index 9971dbc469..5349d8d431 100644 --- a/Logic/FeatureSource/Sources/RenderingMultiPlexerFeatureSource.ts +++ b/Logic/FeatureSource/Sources/RenderingMultiPlexerFeatureSource.ts @@ -60,7 +60,7 @@ export default class RenderingMultiPlexerFeatureSource { } if (feat.geometry.type === "LineString") { - + // Add start- and endpoints const coordinates = feat.geometry.coordinates for (const rendering of startRenderings) { @@ -70,40 +70,16 @@ export default class RenderingMultiPlexerFeatureSource { const coordinate = coordinates[coordinates.length - 1] addAsPoint(feat, rendering, coordinate) } - + } - - if (feat.geometry.type === "MultiLineString") { - // Multilinestrings get a special treatment: we split them into their subparts before rendering - const lineList: [number, number][][] = feat.geometry.coordinates - - for (let i1 = 0; i1 < lineList.length; i1++) { - const coordinates = lineList[i1]; - - for (let i = 0; i < lineRenderObjects.length; i++) { - const orig = { - ...feat, - lineRenderingIndex: i, - multiLineStringIndex: i1 - } - orig.geometry.coordinates = coordinates - orig.geometry.type = "LineString" - withIndex.push(orig) - } - } - - }else{ - - // AT last, add it 'as is' to what we should render - for (let i = 0; i < lineRenderObjects.length; i++) { - withIndex.push({ - ...feat, - lineRenderingIndex: i - }) - } + // AT last, add it 'as is' to what we should render + for (let i = 0; i < lineRenderObjects.length; i++) { + withIndex.push({ + ...feat, + lineRenderingIndex: i + }) } - } } diff --git a/assets/layers/gps_track/gps_track.json b/assets/layers/gps_track/gps_track.json index 75f18e2e15..c052533f11 100644 --- a/assets/layers/gps_track/gps_track.json +++ b/assets/layers/gps_track/gps_track.json @@ -13,7 +13,8 @@ { "id": "Privacy notice", "render": { - "en": "This is the path you've travelled since this website is opened. Don't worry - this is only visible to you and no one else. Your location data is never sent off-device." + "en": "This is the path you've travelled since this website is opened. Don't worry - this is only visible to you and no one else. Your location data is never sent off-device.", + "nl": "Dit is waar je was sinds je deze website hebt geopened. Dit is enkel zichtbaar voor jou en niemand anders, je locatie wordt niet verstuurd" } }, "export_as_gpx"