From 240017f39c2768d16d2750cef0b29f9dec2b8fa5 Mon Sep 17 00:00:00 2001 From: Erik Escoffier Date: Wed, 27 Sep 2023 13:01:22 +0200 Subject: [PATCH] Revert "Initialize the map with North America AoI" This reverts commit f9ae022c4782c65f6341cd1e54e4fd2a3c8e0d65. --- .../components/analysis/define/aoi-selector.tsx | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/app/scripts/components/analysis/define/aoi-selector.tsx b/app/scripts/components/analysis/define/aoi-selector.tsx index 6964dcde8..4ba1a3d87 100644 --- a/app/scripts/components/analysis/define/aoi-selector.tsx +++ b/app/scripts/components/analysis/define/aoi-selector.tsx @@ -3,7 +3,6 @@ import React, { useCallback, useEffect, useMemo, - useRef, useState } from 'react'; import styled from 'styled-components'; @@ -43,7 +42,6 @@ import { import DropMenuItemButton from '$styles/drop-menu-item-button'; import { makeFeatureCollection } from '$components/common/aoi/utils'; import { variableGlsp } from '$styles/variable-utils'; -import { useEffectPrevious } from '$utils/use-effect-previous'; const MapContainer = styled.div` position: relative; @@ -77,19 +75,6 @@ export default function AoiSelector({ }: AoiSelectorProps) { const { drawing, featureCollection } = aoiDrawState; - // TODO revise this. This is not a great hack aimed at initializing the AoI with North America when - // no qs AoI is set. Ideally this would be set in use-analysis-params initialState. - const timeOutRef = useRef | null>(null); - useEffect(() => { - if (!qsAoi) { - timeOutRef.current = setTimeout(() => { - setFeatureCollection(FeatureByRegionPreset['north-america']); - }, 100); - } else { - if (timeOutRef.current) clearTimeout(timeOutRef.current); - } - }, [qsAoi]); - // For the drawing tool, the features need an id. const qsFc: FeatureCollection | null = useMemo(() => { return qsAoi @@ -188,7 +173,7 @@ export default function AoiSelector({ )} > - Select a region + Select a region (BETA)