From a5f5acd6d55c8902eecaa64f70816d4dfe091ee8 Mon Sep 17 00:00:00 2001 From: gluap Date: Sun, 19 Dec 2021 12:56:52 +0100 Subject: [PATCH] Make the scale match the map --- frontend/src/mapstyles/index.js | 5 +++-- frontend/src/pages/MapPage/LayerSidebar.tsx | 18 ++++++++++-------- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/frontend/src/mapstyles/index.js b/frontend/src/mapstyles/index.js index 9d61e9e..a38826b 100644 --- a/frontend/src/mapstyles/index.js +++ b/frontend/src/mapstyles/index.js @@ -33,8 +33,9 @@ export function colormapToScale(colormap, value, min, max) { export const viridis = simplifyColormap(viridisBase.map(rgbArrayToColor), 20) export const grayscale = ['#FFFFFF', '#000000'] export const reds = [ - ['rgba', 255, 0, 0, 0], - ['rgba', 255, 0, 0, 1], + 'rgba( 255, 0, 0, 0)', + 'rgba( 255, 0, 0, 255)', +] ] export function colorByCount(attribute = 'event_count', maxCount, colormap = viridis) { diff --git a/frontend/src/pages/MapPage/LayerSidebar.tsx b/frontend/src/pages/MapPage/LayerSidebar.tsx index bf23983..d2657f8 100644 --- a/frontend/src/pages/MapPage/LayerSidebar.tsx +++ b/frontend/src/pages/MapPage/LayerSidebar.tsx @@ -81,6 +81,7 @@ function LayerSidebar({ /> {attribute.endsWith('_count') ? ( + <> Maximum value setMapConfigFlag('obsRoads.maxCount', value)} /> - ) : null} - - )} - {showRoads && ( - <> - - - + + + + ) : + ( + + + + )} )}