googlemaps / googlemaps/google-maps-ios-utils
Clustering: add setter for clusterDistancePoints in the GMUNonHierarchicalDistanceBasedAlgorithm.m
- Dominant language
- Objective-C
- Stars
- 778
- Forks
- 441
- PR merge metrics
- No merged PRs in 30d
Description
In [googlemaps/android-maps-utils](https://github.com/googlemaps/android-maps-utils) in distance based algorithms we have a method [setMaxDistanceBetweenClusteredItems()](https://github.com/googlemaps/android-maps-utils/blob/46bca380e930ff9723d3a5266e2e3c81fb9a20c4/library/src/main/java/com/google/maps/android/clustering/algo/NonHierarchicalDistanceBasedAlgorithm.java#L240) to change the distance between markes when clustering is active. It will be great if we have this functionality for iOS too.
---
Example of using this variable in Android:
```Java
if (this.googleMap.getCameraPosition().zoom < 13) {
mClusterManager.getAlgorithm().setMaxDistanceBetweenClusteredItems(CapacitorGoogleMaps.maxDistanceBetweenClusteredItems);
} else {
mClusterManager.getAlgorithm().setMaxDistanceBetweenClusteredItems((int) (thisDeviceIconSize / 2));
}
```
Example of possible using this method in iOS:
```Swift
if (cameraPosition.zoom < 13 ) {
self.mClusterManager.algorithm.setClusterDistancePoints(CapacitorGoogleMapsPlugin.maxDistanceBetweenClusteredItems)
} else {
self.mClusterManager.algorithm.setClusterDistancePoints(UInt(CapacitorGoogleMapsPlugin.SIZE_OF_MARKERS.width)/2)
}
```
Contributor guide
Assessment
This issue has not been assessed yet.