HERE Android SDK Developer's Guide

ClusterLayer

The class ClusterLayer is a member of com.here.android.mpa.cluster .

Class Summary

public class ClusterLayer

extends java.lang.Object

ClusterLayer is a container of MapMarker instances.

[For complete information, see the section Class Details]

Constructor Summary

Table 1. Constructors in ClusterLayer
Constructors

ClusterLayer ()

Creates new cluster layer with a default theme.

Method Summary

Table 2. Methods in ClusterLayer
Methods

public void addMarker (MapMarker marker)

Adds a MapMarker to this layer.

public void addMarkers (java.util.Collection <MapMarker> markers)

Adds a collection of MapMarker to this layer.

public java.util.Collection <MapMarker> getMarkers ()

Retrieves all MapMarker instances added to this layer.

public boolean removeMarker (MapMarker marker)

Removes the given MapMarker from this layer.

public boolean removeMarkers (java.util.Collection <MapMarker> markers)

Removes a collection of MapMarker from this layer.

public void setTheme (ClusterTheme theme)

Sets the theme to be used during cluster marker rendering.

public String toString ()

For documentation, see java.lang.Object

Class Details

ClusterLayer is a container of MapMarker instances.

A newly created layer must be attached to the map before clustering begins. There is no restriction on calling the methods of this class when it is removed from (not added to) the map.

Once added to the layer, markers will start to cluster when the layer is attached to the map.

Constructor Details

ClusterLayer ()

Creates new cluster layer with a default theme.

Method Details

public void addMarker (MapMarker marker)

Adds a MapMarker to this layer.

The marker is also added to the Map if the layer is added to it.

Parameters:

  • marker

    The MapMarker to be added.

Throws:

  • NullPointerException

    If the marker is null.

See also:

addMarkers(Collection<MapMarker>)

public void addMarkers (java.util.Collection <MapMarker> markers)

Adds a collection of MapMarker to this layer.

The markers are also added to the Map if the layer is added to it.

Parameters:

  • markers

    A collection of MapMarker instances to be added

Throws:

  • NullPointerException

    If the any marker in the collection is null.

See also:

addMarker(MapMarker)

public java.util.Collection <MapMarker> getMarkers ()

Retrieves all MapMarker instances added to this layer.

Returns:

a collection of all markers added to this layer

public boolean removeMarker (MapMarker marker)

Removes the given MapMarker from this layer.

The marker is also removed from the Map if the layer is already added to it.

Use removeMarkers(Collection) to remove a batch of map markers.

Parameters:

  • marker

    A MapMarker to remove

Returns:

true if this layer was modified by this operation, false otherwise.

See also:

removeMarkers(Collection<MapMarker>)

public boolean removeMarkers (java.util.Collection <MapMarker> markers)

Removes a collection of MapMarker from this layer.

The markers are also removed from the Map if the layer already added to it.

Parameters:

  • markers

Returns:

true if this layer was modified by this operation, false otherwise.

public void setTheme (ClusterTheme theme)

Sets the theme to be used during cluster marker rendering.

If no theme is set using this method, a default theme is used.

Parameters:

  • theme

    theme to be used

Throws:

  • NullPointerException

    if null is passed

public String toString ()

For documentation, see java.lang.Object

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.