googlemaps / google-maps-ios-utils

Google Maps SDK for iOS Utility Library
https://developers.google.com/maps/documentation/ios-sdk/utility/
Apache License 2.0
712 stars 399 forks source link

Clustering: add setter for clusterDistancePoints in the GMUNonHierarchicalDistanceBasedAlgorithm.m #452

Open vorokami opened 1 year ago

vorokami commented 1 year ago

In googlemaps/android-maps-utils in distance based algorithms we have a method setMaxDistanceBetweenClusteredItems() 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:

        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:

        if (cameraPosition.zoom < 13 ) {
            self.mClusterManager.algorithm.setClusterDistancePoints(CapacitorGoogleMapsPlugin.maxDistanceBetweenClusteredItems)
        } else {
            self.mClusterManager.algorithm.setClusterDistancePoints(UInt(CapacitorGoogleMapsPlugin.SIZE_OF_MARKERS.width)/2)
        }
wangela commented 1 year ago

If you would like to upvote the priority of this issue, please comment below or react on the original post above with :+1: so we can see what is popular when we triage.

@vorokami Thank you for opening this issue. 🙏 Please check out these other resources that might help you get to a resolution in the meantime:

This is an automated message, feel free to ignore.