Closed allthesignals closed 6 years ago
Also please change the buildPaint to this:
function buildPaint({ colors, breaks, opacity }) {
const paint = {
'fill-color': [
'curve',
['step'],
[
'number',
['get', 'value'],
1,
],
],
'fill-opacity': opacity,
};
const colorArray = paint['fill-color'];
colors.forEach((color, i) => {
colorArray.push(colors[i]);
colorArray.push(breaks[i]);
});
colorArray.push('#FFF');
return paint;
}
in the original soruce "break" is a reserved word
It'd be better to separate out the legend stuff and make it more composable so that it's easier to test. So, you might have {{#map-from-id as |breaks|}} {{legend-component breaks=breaks}} {{/map-from-id}}
We can work on this t ogether chris
Moving builtLayers upstream breaks the legends because there is a "builtLayers" format of the layer configurations which is used for the layers, and there is a legend format of the configuration that depends on the format of the layers configuration before it was changed
breaks
,buildPaint
)highlightedFeatureLayer
)