diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 5c29c35b..71239280 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -31,7 +31,7 @@ "react-icons": "^4.6.0", "react-leaflet": "^4.2.1", "react-oidc-context": "^2.2.0", - "react-parcelmap-bc": "^1.1.3", + "react-parcelmap-bc": "^1.1.4", "react-redux": "^8.0.2", "react-router-dom": "^6.4.1", "react-scripts": "5.0.1", @@ -15849,9 +15849,9 @@ } }, "node_modules/react-parcelmap-bc": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/react-parcelmap-bc/-/react-parcelmap-bc-1.1.3.tgz", - "integrity": "sha512-Ccg81iI6muy9Y/CfznYhAOXIwhcfZVbZChONZCA59Nitc8fBtVHCybKZ4cWac9Kf3fpRHG87MpdS4kjrNmxSWw==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/react-parcelmap-bc/-/react-parcelmap-bc-1.1.4.tgz", + "integrity": "sha512-0coDLoe/0lJyL/+Y/eMUn7z0wEhCgfiiWmgHj/dhYAWhAvPDImvvSLFPy8lQIv/dR1Mtanwffn3ULUbJnOFYoQ==", "dependencies": { "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", diff --git a/frontend/package.json b/frontend/package.json index 315cc1f1..970bf29d 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -29,7 +29,7 @@ "react-icons": "^4.6.0", "react-leaflet": "^4.2.1", "react-oidc-context": "^2.2.0", - "react-parcelmap-bc": "^1.1.3", + "react-parcelmap-bc": "^1.1.4", "react-redux": "^8.0.2", "react-router-dom": "^6.4.1", "react-scripts": "5.0.1", diff --git a/map-package/src/map/Map.js b/map-package/src/map/Map.js index 60854887..42d6061a 100644 --- a/map-package/src/map/Map.js +++ b/map-package/src/map/Map.js @@ -16,20 +16,29 @@ const Map = (props) => { const [address, setAddress] = useState(""); const [location, setLocation] = useState([ 48.46762, -123.25458 ]); const [zoom, setZoom] = useState(13); - const [searchTrue, setSerachTrue] = useState(false); + const [searchTrue, setSerachTrue] = useState(true); //const [info, setInfo] = useState({}); let info; useEffect(() => { if (props.initLocation.length > 0 && props.initLocation !== null && props.initLocation !== undefined && ( location[0] !== props.initLocation[0] || location[1] !== props.initLocation[1] )) { - setSerachTrue(false); - setZoom(18); - setLocation(props.initLocation); - if(!props.readOnly) - { - setShow(true); - } + + + const timeoutId = setTimeout(()=>{ + //setSerachTrue(false); + setZoom(18); + setLocation(props.initLocation); + if(!props.readOnly) + { + setShow(true); + } + + },1000); + + return () => { + clearTimeout(timeoutId); + }; } }, [props]);