flutter_map_marker_cluster
flutter_map_marker_cluster copied to clipboard
Map is not updated after markers added dynamically
I am using riverpod change notifier as a view model for the flutter map, but the map always display the initial set of markers. Any change in this list of markers is not reflected in map. I have debugged the code and list itself is updated but map UI is not.
Same issue here. The markers are not updated in the map, when changed in the array. Without clustering it is working as expected.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
This issue was closed because it has been stalled for 5 days with no activity.
Same issue, did anyone fix it?
I found the solution. In the markerClusterLayerWidget instead of passing just markers to the markers propetry, use List.from(markers), so you create a new instance of a list with markers and it work's perfectly fine!
Well, not perfectly fine. It redraws markers, indeed, but it doesn't maintain it's state. In fact, when a cluster is spiderfied (open), and update happens, it collapses back, which makes it unusable (in case your markers are located on the same spot). So, currently one has to choose between 'spiderfy' and 'update your markers properly' functionality). @lpongetti, any thoughts on this?