feat: support marker clustering by Samo8 · Pull Request #593 · googlemaps/flutter-navigation-sdk
Hi @Samo8, thank you for taking the time to create this PR and adding marker clustering support! 🙏
I wanted to share some context: I authored the original clustering support for google_maps_flutter, and adding clustering to this package (based on that implementation) has been on our roadmap; along with Advanced Markers and other features still missing from this package.
However, there are several considerations that make this feature more complex than it might appear:
- Cluster image customization via ImageRegistry — Since this package supports ImageRegistry, our plan was to add support for controlling cluster images by pre-registering images for specific cluster size ranges. See: [google_maps_flutter] Add support for custom cluster icon flutter/flutter#153092
- ClusterManager configuration options — There are additional settings we should support for cluster managers: [google_maps_flutter] Allow changing the minimum cluster size flutter/flutter#173412. Having separate ClusterManager instances would enable this, but it isn't yet supported in google_maps_flutter either.
- Advanced Markers — We need to implement Advanced Marker support in this package, which will significantly impact how clustering should work. Clustering really needs to be designed together with Advanced Markers to ensure a cohesive API. See changes for clustering needed by the Advanced markers per platform here: [google_maps_flutter] Add Advanced Markers support flutter/packages#7882
- Utils library dependency — This PR introduces an (official) utils library dependency that we haven't yet considered adding for clustering purposes.
Given these factors, we need to think through the design more holistically before moving forward with clustering support. I really appreciate your effort here, and we will have an internal discussion about this.
I would appreciate if you could create a Feature Request issue about this topic for further conversation.