HMS Map Kit - Clustering

Viewed 1696

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.

2 Answers

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:

  1. Open Gradle, click library->Tasks->build->assemble.
  2. After Run, find 3rd-maps-utils-2.1.0-yyyyMMdd.aar file from Github in library/build/outputs/aar/ path.
  3. Copy 3rd-maps-utils-2.1.0-yyyyMMdd.aar file to your own app/libs/ path.
  4. Add codes below in project build.gradle file.
allprojects {
       repositories {
              ...
              flatDir {
                     dirs 'libs'
              }
       }
}
  1. Add codes below in app build.gradle file.
dependencies {
    implementation(name: '3rd-maps-utils-2.1.0-yyyyMMdd', ext: 'aar')
    ...
}
Related