HERE Android SDK Developer's Guide

MapContainer

The class MapContainer is a member of com.here.android.mpa.mapping .

Class Summary

public final class MapContainer

extends com.here.android.mpa.mapping.MapObject, com.here.android.mpa.common.ViewObject, java.lang.Object

Represents a container that determines the stacking order of objects on a Map.

[For complete information, see the section Class Details]

Constructor Summary

Table 1. Constructors in MapContainer
Constructors

MapContainer ()

Creates an empty MapContainer .

Method Summary

Table 2. Methods in MapContainer
Methods

public boolean addMapObject (MapObject object)

Adds a MapObject to this MapContainer .

public boolean equals (Object obj)

public java.util.List <MapObject> getAllMapObjects ()

Returns the list of all MapObject objects within this MapContainer.

public Type getType ()

public int getZIndex ()

Returns the current z-index (stacking order) of this MapContainer .

public int hashCode ()

public boolean isVisible ()

Determines whether this MapContainer is visible on the map.

public boolean removeAllMapObjects ()

Removes all MapObject objects currently within this MapContainer.

public boolean removeMapObject (MapObject object)

Removes the specified MapObject from this MapContainer.

public MapContainer setVisible (boolean isVisible)

Sets whether this MapContainer is visible.

public MapContainer setZIndex (int index)

Sets a z-index (stacking order) value for this MapContainer .

Class Details

Represents a container that determines the stacking order of objects on a Map. Applications can add certain types of MapObject objects into a MapContainer. For more details, refer to addMapObject(MapObject).

You can use MapContainer.setVisible(boolean) to control whether the objects in the container are visible. If MapContainer.setVisible(true) , then the visibility settings of each map object in the container are used.

Unlike other map objects, MapContainer does not support the use of visibility masks, so you cannot set container visibility on a zoom level basis.

Constructor Details

MapContainer ()

Creates an empty MapContainer .

Method Details

public boolean addMapObject (MapObject object)

Adds a MapObject to this MapContainer . Only the following types of MapObject objects can be added:

For a complete enumeration of available MapObject types, refer to MapObject.Type.

Parameters:

Returns:

True if the MapObject was added successfully to this MapContainer, false otherwise (nesting MapContainer is not supported).

See also:

removeMapObject(MapObject)

public boolean equals (Object obj)

Parameters:

  • obj

public java.util.List <MapObject> getAllMapObjects ()

Returns the list of all MapObject objects within this MapContainer. Modifications to objects returned from the array are not guaranteed to be reflected properly in the MapContainer. Use addMapObject(MapObject) and removeMapObject(MapObject) to modify individual array elements.

Note: the order of the MapObjects returned in the List is arbitrary. There is no guarantee the list is sorted in the order the MapObjects were added to the MapContainer.

Returns:

A list containing all MapObject objects within the MapContainer. If the MapContainer contains no map object, an empty array will be returned.

public Type getType ()

public int getZIndex ()

Returns the current z-index (stacking order) of this MapContainer . A higher z-index indicates that the object is positioned more in front.

Returns:

The current ordinal z-index number

public int hashCode ()

public boolean isVisible ()

Determines whether this MapContainer is visible on the map.

Returns:

True if this MapContainer is visible, false otherwise

public boolean removeAllMapObjects ()

Removes all MapObject objects currently within this MapContainer.

Returns:

True if all MapObject objects were removed successfully from this MapContainer, false otherwise

See also:

removeMapObject(MapObject)

public boolean removeMapObject (MapObject object)

Removes the specified MapObject from this MapContainer. If the specified MapObject is not contained within the MapContainer, the container will be unchanged.

Parameters:

Returns:

True if the MapObject was removed successfully from this MapContainer , false otherwise

See also:

removeAllMapObjects()

public MapContainer setVisible (boolean isVisible)

Sets whether this MapContainer is visible.

Parameters:

  • isVisible

    A boolean variable specifying whether this MapContainer is visible

Returns:

The updated MapContainer itself.

public MapContainer setZIndex (int index)

Sets a z-index (stacking order) value for this MapContainer .

Parameters:

  • index

    A new z-index value for this MapContainer, a 16-bit int within the range of [0..65535]

Returns:

The updated MapContainer itself.

Throws:

  • IllegalArgumentException

    If index is not within the valid range.