How to render many markers in the most performant way #1497
-
What do you want implemented?Hello people
How can I render so many markers in the most performant way? What other alternatives are available?No response Can you provide any other information?No response Platforms AffectedAndroid, iOS SeverityObtrusive: No workarounds are available, and this is essential to me Requirements
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi there, |
Beta Was this translation helpful? Give feedback.
-
Few different options spring to mind, clustering may make sense, eg https://github.com/rorystephenson/flutter_map_supercluster https://pub.dev/packages/flutter_map_marker_cluster . You could have a look at my alpha geojson thing at https://github.com/ibrierley/geojson_vector_slicer if the markers don't change (not so good for dynamic markers). As @JaffaKetchup says, you could listen to a stream and display a different marker layer when on a different zoom level. |
Beta Was this translation helpful? Give feedback.
Hi there,
Markers are culled automatically - the are not rendered when off screen.
In terms of displaying at a certain zoom level, the
MapController
has a stream that can be listened to for events, such as changes in zooms. You can use this to control whether markers appear or not. You should filter the stream to include only events that you need to worry about, to avoid unnecessary state changes.Also see https://docs.fleaflet.dev/plugins/list#marker-clustering.