I want to migrate Google Maps functionality to HMS. Most of the parts were easily migrated to Huawei, but I have functionality of Clustering and I'm using ClusterItem
and ClusterManager
with DefaultClusterRenderer
for my GoogleMap to show clusters of markers as one marker if there is alot of them on map.
This functionality is lacking in HMS. I found Marker
and HWMarkerCluster
but its completely different system and HWMarkerCluster
is not even found in option of imported classes for Android. It was found only for Javascript API.
Any suggestions if there is any alternative in HMS? Because I'm reading Map Kit documentation for hour and I cant find anything.
Here is the documentation for marker cluster. https://developer.huawei.com/consumer/en/doc/development/HMS-Guides/hms-map-drawonthemap#h2-1586915875534
It works perfectly fine for a small amount of markers.
Simply add .clusterable(true)
Alternatively, you could use the library I have created for clustering where it can render 10,000 markers without any lag.
https://github.com/hunterxxx/huawei-map-clustering
For functionality of Clustering, you can refer to @Hunter’s documentation. I also want to add a useful tool, which is based on Google's open-source tool and adapts to the Huawei Map cluster manager. You are advised to integrate the tool to cluster markers.
Usage:
allprojects {
repositories {
...
flatDir {
dirs 'libs'
}
}
}
dependencies {
implementation(name: '3rd-maps-utils-2.1.0-yyyyMMdd', ext: 'aar')
...
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With