From fb3e8bf7012ab5a447254798038425fc259744c7 Mon Sep 17 00:00:00 2001 From: gluap Date: Mon, 10 Apr 2023 13:10:03 +0200 Subject: [PATCH] log10(0) is not defined - also: make region borders less intrusive for depending on number of events. As it was, it was hard to see the underlying geography. --- frontend/src/mapstyles/index.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/frontend/src/mapstyles/index.js b/frontend/src/mapstyles/index.js index ee86032..e484359 100644 --- a/frontend/src/mapstyles/index.js +++ b/frontend/src/mapstyles/index.js @@ -163,7 +163,7 @@ export const getRegionLayers = ( "fill-opacity": [ "interpolate", ["linear"], - ["log10", ["get", "overtaking_event_count"]], + ["log10", ["max",["get", "overtaking_event_count"],1]], 0, 0, Math.log10(maxValue), @@ -180,7 +180,15 @@ export const getRegionLayers = ( maxzoom: 10, // filter: [">", "overtaking_event_count", 0], paint: { - "line-width": 1, + "line-width": [ + "interpolate", + ["linear"], + ["log10", ["max",["get", "overtaking_event_count"],1]], + 0, + 0.2, + Math.log10(maxValue), + 1.5, + ], "line-color": baseColor, }, layout: {