Skip to content

Commit

Permalink
fix: Avoid changing initial location after component mounts
Browse files Browse the repository at this point in the history
  • Loading branch information
josebui committed Dec 2, 2024
1 parent cda1847 commit 971d7a9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/gis/components/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ const Map = React.forwardRef((props, ref) => {
id,
mapStyle,
projection,
initialLocation,
initialLocation: propsInitialLocation,
interactive = true,
hash = false,
attributionControl = true,
Expand All @@ -325,6 +325,7 @@ const Map = React.forwardRef((props, ref) => {
const { map, setMap } = useMap();
const mapContainer = useRef(null);
const [bounds] = useState(initialBounds);
const [initialLocation] = useState(propsInitialLocation);

useEffect(() => {
const validBounds = isValidBounds(bounds);
Expand Down

0 comments on commit 971d7a9

Please sign in to comment.