Robustify code

This commit is contained in:
Pieter Vander Vennet 2021-11-09 23:44:20 +01:00
parent 1dbe167e4e
commit 15a1ab19cd
2 changed files with 19 additions and 20 deletions

View file

@ -157,7 +157,6 @@ export default class ShowDataLayer {
const coords = L.GeoJSON.coordsToLatLngs(feat.geometry.coordinates)
const tagsSource = this.allElements?.addOrGetElement(feat) ?? new UIEventSource<any>(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)
}