Commit e6ae7109 authored by Anne Blankert's avatar Anne Blankert

adjust paint properties for layer type

parent 51a2313b
...@@ -344,20 +344,21 @@ ...@@ -344,20 +344,21 @@
count: rowCount - classValuesRowCount count: rowCount - classValuesRowCount
}) })
const schemes = getColorSchemes(classCount, 'qual'); const schemes = getColorSchemes(classCount, 'qual');
const mapboxPaint = { const mapboxPaint = [
"line-color": [
"match", "match",
["get","bicycle"] ["get","bicycle"]
], ];
"line-width": 1
}
classValues.forEach((value, index) => { classValues.forEach((value, index) => {
addLegendLine(schemes[0].colors[index], value.value); addLegendLine(schemes[0].colors[index], value.value);
mapboxPaint["line-color"].push(value.value); if (value.value !== 'other') {
mapboxPaint["line-color"].push(schemes[0].colors[index]); mapboxPaint.push(value.value);
mapboxPaint.push(schemes[0].colors[index]);
}
}); });
mapboxPaint["line-color"].push(schemes[0].colors[classValues.length -1]); mapboxPaint.push(schemes[0].colors[classValues.length -1]);
map.setPaintProperty('attrlayer', 'line-color', mapboxPaint["line-color"]); const layerType = map.getLayer('attrlayer').type;
const colorprop = `${layerType}-color`;
map.setPaintProperty('attrlayer', colorprop, mapboxPaint);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment