100K Clustered Markers with Huawei Map! đŸ˜±

Hunter
Huawei Developers
Published in
3 min readJul 8, 2020

--

A thousand Markers isn’t cool. You know what’s cool?

A hundred thousand Markers.

It is a common practice to use markers to represent points of interest (POI) in Map. The most common usages are stations and restaurants. If the density of markers is too high, the user interface will be exhaustively chaotic (Figure 2); if the density is too low, valuable information will not be sufficiently represented. When zooming in and out, merging and scattering markers at different levels are important for marker density management. Via this Marker Cluster Library, markers can be adaptively merged and scattered.

Motivation

I stumbled upon a question on StackOverflow “HMS Map Kit — Clustering” and decided to provide a high performance Marker Clustering library for Huawei Map. Smooth performance even with 100,000 markers :)

On Huawei P40 Lite, Left (Figure 1): 100,000 Clustered Markers , Right (Figure 2): 5000 Markers and almost ANR.

Why not use Huawei Map built in .clusterable(true)?

As you can see from the feedback of the developer, the built in function does not scale for more than 100 markers.

--

--