I have a React Leaflet map that needs to change its center and zoom when given a set of markers. The zoom should be changed such that all the markers are visible. This change of view is currently being attempted using the function ChangeView. Using my code below, I am able to move the map view, but not able to
Tag: react-leaflet
How do I clear a leaflet map in react so I can map fresh data?
I am attempting to clear a leaflet map in react when fetching new data to map, and i am unsure how to approach this. I saw this post but not sure how exactly to apply it. Right now I have a function that fetches 1 of 2 geojsons I have loaded. App.js This is merely a test to get the
React-Leaflet/React-Routing-Machine: Remove route and waypoints
I am using the following packages for my map: Essentially I have a Routing machine component which I’ve integrated with my Map and Markers i.e. (upon clicking two points on the map you get the route) you can drag each and the route updates! However at this point I have a button which resets everything, clears the markers, the associated
React-Leaflet Map doesn’t update
My issue is that react-leaflet <MapContainer> doesn’t center on a position that I set dynamically. The basic logic is that I have a form where I enter Street and House Number, then I make call for Nominatim and get some JSON format data, from where I extract latitude and longitude of a building. These lat and long I pass to