diff --git a/Logic/FeatureSource/Sources/RenderingMultiPlexerFeatureSource.ts b/Logic/FeatureSource/Sources/RenderingMultiPlexerFeatureSource.ts index 8c5cb5c2ff..9971dbc469 100644 --- a/Logic/FeatureSource/Sources/RenderingMultiPlexerFeatureSource.ts +++ b/Logic/FeatureSource/Sources/RenderingMultiPlexerFeatureSource.ts @@ -54,12 +54,14 @@ export default class RenderingMultiPlexerFeatureSource { }) } } else { - // This is a a line + // This is a a line: add the centroids for (const rendering of centroidRenderings) { addAsPoint(feat, rendering, GeoOperations.centerpointCoordinates(feat)) } - if (feat.geometry.type === "LineString" || feat.geometry.type==="Polygon" || feat.geometry.type === "MultiPolygon") { + if (feat.geometry.type === "LineString") { + + // Add start- and endpoints const coordinates = feat.geometry.coordinates for (const rendering of startRenderings) { addAsPoint(feat, rendering, coordinates[0]) @@ -68,29 +70,17 @@ export default class RenderingMultiPlexerFeatureSource { const coordinate = coordinates[coordinates.length - 1] addAsPoint(feat, rendering, coordinate) } - for (let i = 0; i < lineRenderObjects.length; i++) { - withIndex.push({ - ...feat, - lineRenderingIndex: i - }) - } + } + 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 (const rendering of startRenderings) { - const coordinate = coordinates[0] - addAsPoint(feat, rendering, coordinate) - } - for (const rendering of endRenderings) { - const coordinate = coordinates[coordinates.length - 1] - addAsPoint(feat, rendering, coordinate) - } - - for (let i = 0; i < lineRenderObjects.length; i++) { const orig = { ...feat, @@ -102,7 +92,18 @@ export default class RenderingMultiPlexerFeatureSource { 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 + }) + } } + } } diff --git a/UI/ShowDataLayer/ShowDataLayer.ts b/UI/ShowDataLayer/ShowDataLayer.ts index 6b700e79aa..f306cadf23 100644 --- a/UI/ShowDataLayer/ShowDataLayer.ts +++ b/UI/ShowDataLayer/ShowDataLayer.ts @@ -157,7 +157,6 @@ export default class ShowDataLayer { const coords = L.GeoJSON.coordsToLatLngs(feat.geometry.coordinates) const tagsSource = this.allElements?.addOrGetElement(feat) ?? new UIEventSource(feat.properties); let offsettedLine; - console.log("Rendering ", feat) tagsSource .map(tags => this._layerToShow.lineRendering[feat.lineRenderingIndex].GenerateLeafletStyle(tags)) .withEqualityStabilized((a, b) => { @@ -170,7 +169,6 @@ export default class ShowDataLayer { return a.offset === b.offset && a.color === b.color && a.weight === b.weight && a.dashArray === b.dashArray }) .addCallbackAndRunD(lineStyle => { - console.log("Linestyle is ", lineStyle) if (offsettedLine !== undefined) { self.geoLayer.removeLayer(offsettedLine) }