@StowCode
Posted
First of all, love what you did with the animations. Super cool. I had some issues with Leaflet as well, and although I didn't get the flyTo method to work, I was able to re-center the map and get a similar effect.
Changing the map view, map center, focus, and locations, were all working on the initial render, but not changing properly with state. When I revisited the docs, I disovered the children of the map container are immutable! By adding the function below, I was able to take in props and update the map properties.
const ChangeMap = ({center, zoom}) => {
const map = useMap();
map.setView(center, zoom, {duration: 5});
return null;
}