Fix error in showdataLayer

This commit is contained in:
Pieter Vander Vennet 2024-04-01 22:17:46 +02:00
parent 1cf71197f5
commit cb8efe0e81

View file

@ -343,7 +343,7 @@ class LineRenderingLayer {
promoteId: "id"
})
const linelayer = this._layername + "_line"
map.addLayer({
const layer: AddLayerObject = {
source: this._layername,
id: linelayer,
type: "line",
@ -351,13 +351,17 @@ class LineRenderingLayer {
"line-color": ["feature-state", "color"],
"line-opacity": ["feature-state", "color-opacity"],
"line-width": ["feature-state", "width"],
"line-offset": ["feature-state", "offset"],
"line-dasharray": this._config.dashArray?.split(" ")?.map(s => Number(s))
"line-offset": ["feature-state", "offset"]
},
layout: {
"line-cap": "round"
}
})
}
if (this._config.dashArray) {
layer.paint["line-dasharray"] = this._config.dashArray?.split(" ")?.map(s => Number(s)) ?? null
}
map.addLayer(layer)
if (this._config.imageAlongWay) {
this.addSymbolLayer(this._layername, this._config.imageAlongWay)