From 57361dcbdc9b3b97f8d20dc4513443c04e801e13 Mon Sep 17 00:00:00 2001 From: Mateusz Konieczny Date: Tue, 6 Dec 2022 19:06:03 +0100 Subject: [PATCH] remove dead code --- .../map/layers/flood-boundary-layer.tsx | 8 ----- app/src/frontend/map/map.tsx | 30 ------------------- 2 files changed, 38 deletions(-) diff --git a/app/src/frontend/map/layers/flood-boundary-layer.tsx b/app/src/frontend/map/layers/flood-boundary-layer.tsx index b0d33ec8..2f5f98de 100644 --- a/app/src/frontend/map/layers/flood-boundary-layer.tsx +++ b/app/src/frontend/map/layers/flood-boundary-layer.tsx @@ -22,14 +22,6 @@ export function FloodBoundaryLayer() { />; } else if (flood == "disabled") { return
- // do not display anything - return boundaryGeojson && - - } else { - return boundaryGeojson && - ; } } diff --git a/app/src/frontend/map/map.tsx b/app/src/frontend/map/map.tsx index 7e3d73b9..8c632481 100644 --- a/app/src/frontend/map/map.tsx +++ b/app/src/frontend/map/map.tsx @@ -62,11 +62,8 @@ export const ColouringMap : FC = ({ {/* TODO start change remaining ones */} const [borough, setBorough] = useState('enabled'); const [parcel, setParcel] = useState('disabled'); - const [flood, setFlood] = useState('disabled'); const [conservation, setConservation] = useState('disabled'); const [historicData, setHistoricData] = useState('disabled'); - const [creative, setCreative] = useState('disabled'); - const [housing, setHousing] = useState('disabled'); {/* TODO end */} const [position, setPosition] = useState(initialMapViewport.position); const [zoom, setZoom] = useState(initialMapViewport.zoom); @@ -128,15 +125,6 @@ export const ColouringMap : FC = ({ [parcel], ) - const floodSwitch = useCallback( - (e) => { - e.preventDefault(); - const newFlood = (flood === 'enabled')? 'disabled' : 'enabled'; - setFlood(newFlood); - }, - [flood], - ) - const conservationSwitch = useCallback( (e) => { e.preventDefault(); @@ -154,24 +142,6 @@ export const ColouringMap : FC = ({ }, [historicData], ) - - const housingSwitch = useCallback( - (e) => { - e.preventDefault(); - const newHousing = (housing === 'enabled')? 'disabled' : 'enabled'; - setHousing(newHousing); - }, - [housing], - ) - - const creativeSwitch = useCallback( - (e) => { - e.preventDefault(); - const newCreative = (creative === 'enabled')? 'disabled' : 'enabled'; - setCreative(newCreative); - }, - [creative], - ) {/* TODO end */} const categoryMapDefinitions = useMemo(() => categoryMapsConfig[category], [category]);