Open manodupont opened 1 month ago
I also want to dynamically add lines between markers. Markers can be added dynamically, as data changes, but changing the lines causes the error sourceID has changed
. I even tried unmounting the map first manually.
@brecistoptal can't say for sure what is happening with your app but it's unlikely the same issue as the original poster's.
Make sure you are following the Source docs recommendation:
If add/remove multiple JSX sources dynamically, make sure you use React's key prop to give each element a stable identity.
If you have any more questions, I suggest you open your own Discussion thread and share your code.
@manodupont Please specify the map library you are using (e.g. mapbox-gl@3.0.0)
@Pessimistress mapbox-gl@3.6.0
Description
Hi.
I still have issue with react-map-gl to update the Source dynamically. It may be super silly but I can't figure out whats wrong with this approach. Let's say I have multiple "tilesets" that are referenced by an id named
tileName
Expected Behavior
No response
Steps to Reproduce
Environment
Logs
No response