Skip to content

Commit 3b022a3

Browse files
committed
update units in legend
1 parent ffa8ac4 commit 3b022a3

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

src/components/VMapboxLegend.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ export default {
5454
},
5555
methods: {
5656
layerMessage(layer) {
57-
return `${layer.name} ${this.layerStatus[_.get(layer, 'data[0].id')]}`
57+
const unit = layer.unit ? ` [${layer.unit}]` : ''
58+
const message = `${layer.name}${unit} ${this.layerStatus[_.get(layer, 'data[0].id')] || ''}`
59+
return message
5860
},
5961
setActiveLayers() {
6062
this.activeLayers = this.layers.filter(layer => layer.active && (layer.barlegend || layer.legendlabels))

static/data/datalayers.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
}
4747
}],
4848
"barlegend": "background: linear-gradient(to left, #A49018, #B89E21, #E2B247, #F3CA89, #D9E0A3, #D7F1FF, #A1DBFF, #86D0FF, #6BC5FF, #35AFFF, #1AA4FF, #0099FF, #2176FF, #3265FF, #4354FF, #6532FF, #7621FF, #8810FF, #9900FF, #9900FF);",
49-
"bartext": "-30 -20 -10 0 10"
49+
"bartext": "-30 -20 -10 0 10",
50+
"unit": "m"
5051
},
5152
{
5253
"name": "Vaklodingen",
@@ -75,7 +76,8 @@
7576
}
7677
}],
7778
"barlegend": "background: linear-gradient(to left, #A49018, #B89E21, #E2B247, #F3CA89, #D9E0A3, #D7F1FF, #A1DBFF, #86D0FF, #6BC5FF, #35AFFF, #1AA4FF, #0099FF, #2176FF, #3265FF, #4354FF, #6532FF, #7621FF, #8810FF, #9900FF, #9900FF);",
78-
"bartext": "-30 -20 -10 0 10"
79+
"bartext": "-30 -20 -10 0 10",
80+
"unit": "m"
7981
},
8082
{
8183
"name": "Achtergrond laag 2018",
@@ -90,7 +92,6 @@
9092
"begindate": "01-01-2011",
9193
"enddate": "01-01-2019"
9294
},
93-
"barlegend": false,
9495
"data": [{
9596
"id": "ahn",
9697
"type": "raster",
@@ -106,7 +107,8 @@
106107
}
107108
}],
108109
"barlegend": "background: linear-gradient(to left, #A49018, #B89E21, #E2B247, #F3CA89, #D9E0A3, #D7F1FF, #A1DBFF, #86D0FF, #6BC5FF, #35AFFF, #1AA4FF, #0099FF, #2176FF, #3265FF, #4354FF, #6532FF, #7621FF, #8810FF, #9900FF, #9900FF);",
109-
"bartext": "-30 -20 -10 0 10"
110+
"bartext": "-30 -20 -10 0 10",
111+
"unit": "m"
110112
},
111113
{
112114
"name": "-20m lijn en kustfundament",
@@ -1013,6 +1015,7 @@
10131015
"static": true,
10141016
"barlegend": "background: linear-gradient(to right, #CDCDCD 0%, #CDCDCD 8.3%, #FF2B00 8.3%, #FF2B00 16.6%, #FF5D00 16.6%, #FF5D00 25%, #FF8C00 25%, #FF8C00 33.2%, #FFBB00 33.3%, #FFBB00 41.6%, #FFEA00 41.6%, #FFEA00 50%, #E9F500 50%, #E9F500 58.3%, #BFE600 58.3%, #BFE600 66.6%, #96D600 66.6%, #96D600 75%, #74C700 75%, #74C700 83.3%, #56B800 83.3%, #56B800 91.6%, #37A800 91.6%) ",
10151017
"bartext": "0 3 6 9 12",
1018+
"unit": "m",
10161019
"data": [{
10171020
"id": "zanddikte",
10181021
"type": "fill",

0 commit comments

Comments
 (0)