From 2f3a66f2eef864dc3275864f329c7278133ff546 Mon Sep 17 00:00:00 2001 From: Paul Bienkowski Date: Mon, 12 Sep 2022 17:21:28 +0200 Subject: [PATCH] Do not click on road when toggling sidebar (fixes #274) --- frontend/src/pages/MapPage/index.tsx | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/frontend/src/pages/MapPage/index.tsx b/frontend/src/pages/MapPage/index.tsx index a763de4..cdad0ea 100644 --- a/frontend/src/pages/MapPage/index.tsx +++ b/frontend/src/pages/MapPage/index.tsx @@ -7,10 +7,16 @@ import produce from "immer"; import classNames from "classnames"; import type { Location } from "types"; -import {Page, Map} from 'components' -import {useConfig} from 'config' -import {colorByDistance, colorByCount, borderByZone, reds, isValidAttribute} from 'mapstyles' -import {useMapConfig} from 'reducers/mapConfig' +import { Page, Map } from "components"; +import { useConfig } from "config"; +import { + colorByDistance, + colorByCount, + borderByZone, + reds, + isValidAttribute, +} from "mapstyles"; +import { useMapConfig } from "reducers/mapConfig"; import RoadInfo from "./RoadInfo"; import RegionInfo from "./RegionInfo"; @@ -47,9 +53,8 @@ const untaggedRoadsLayer = { const getUntaggedRoadsLayer = (colorAttribute, maxCount) => produce(untaggedRoadsLayer, (draft) => { - draft.filter = ['!', isValidAttribute(colorAttribute)] - }) - + draft.filter = ["!", isValidAttribute(colorAttribute)]; + }); const getRoadsLayer = (colorAttribute, maxCount) => produce(untaggedRoadsLayer, (draft) => { @@ -61,7 +66,7 @@ const getRoadsLayer = (colorAttribute, maxCount) => ? colorByDistance(colorAttribute) : colorAttribute.endsWith("_count") ? colorByCount(colorAttribute, maxCount) - : colorAttribute.endsWith('zone') + : colorAttribute.endsWith("zone") ? borderByZone() : "#DDD"; draft.paint["line-opacity"][3] = 12;