flutter_map_marker_cluster icon indicating copy to clipboard operation
flutter_map_marker_cluster copied to clipboard

Map is not updated after markers added dynamically

Open kevinZartek opened this issue 1 year ago • 1 comments

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.

kevinZartek avatar Sep 05 '22 10:09 kevinZartek

Same issue here. The markers are not updated in the map, when changed in the array. Without clustering it is working as expected.

kamami avatar Sep 30 '22 11:09 kamami

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.

github-actions[bot] avatar Oct 31 '22 03:10 github-actions[bot]

This issue was closed because it has been stalled for 5 days with no activity.

github-actions[bot] avatar Nov 06 '22 03:11 github-actions[bot]

Same issue, did anyone fix it?

blablabla123-cell avatar Dec 02 '22 08:12 blablabla123-cell

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!

blablabla123-cell avatar Dec 02 '22 08:12 blablabla123-cell

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? image

Apollo108 avatar Jan 11 '23 10:01 Apollo108