From fac22f8b86bdcd8b26c1239e7b5062b885cd4064 Mon Sep 17 00:00:00 2001 From: Gjore Milevski Date: Sun, 6 Oct 2024 17:23:51 +0200 Subject: [PATCH] Location search bug --- src/components/Map.jsx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/components/Map.jsx b/src/components/Map.jsx index 4ebd4bc..d5239fb 100644 --- a/src/components/Map.jsx +++ b/src/components/Map.jsx @@ -111,10 +111,10 @@ export default function Home() { const middleBufferSymbol = { type: 'simple-fill', color: [150, 50, 0, 0.0], - outline: { color: [255, 255, 255, 1], width: 2, style:"dash"} + outline: { color: [255, 255, 255, 1], width: 2, style: 'dash' } }; - const sideLength = 0.25*scaleFactor; + const sideLength = 0.25 * scaleFactor; const squarePolygon = { type: 'polygon', rings: [ @@ -134,7 +134,6 @@ export default function Home() { symbol: bufferSymbol }); - const middleCircle = await geometryEngineAsync.geodesicBuffer( point, middleRadius, @@ -381,12 +380,14 @@ export default function Home() { view.watch('zoom', () => { if (lastKnownPoint) { - debouncedCreateBuffer( - lastKnownPoint, - pointLayer, - bufferLayer, - view - ); + setTimeout(() => { + debouncedCreateBuffer( + lastKnownPoint, + pointLayer, + bufferLayer, + view + ); + }, 100); } }); }).catch((error) => {