HERE Android SDK Developer's Guide

MapObject

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

Class Summary

public abstract class MapObject

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

Represents a base class for all map-related objects that users can add to a Map.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in MapObject
Nested Classes

public static final enumeration MapObject.Type

Represents values describing the types of MapObject objects that can be added to a Map.

Method Summary

Table 2. Methods in MapObject
Methods

public boolean equals (Object obj)

public Type getBaseType ()

public MapContainer getParent ()

Returns the parent of this MapObject .

public abstract Type getType ()

Returns the type of object that this MapObject represents.

public BitSet getVisibleMask ()

Returns the visibility bit mask of this MapObject

public int getZIndex ()

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

public int hashCode ()

public boolean isVisible ()

Determines whether this MapObject is visible on the map.

public MapObject resetVisibleMask (boolean set)

Resets this MapObject to be either visible or invisible at all zoom levels.

public MapObject setVisible (boolean isVisible)

Sets whether the visibility of the MapObject on the map is enabled.

public MapObject setVisible (int level, boolean isVisible)

Sets whether this MapObject is visible for the specified zoom level, if enabled.

public MapObject setVisible (int levelStart, int levelEnd, boolean isVisible)

Sets whether this MapObject is visible for the specified range of zoom levels.

public MapObject setVisibleMask (int levelStart, int levelEnd)

Sets this MapObject to be visible at the specified range of zoom levels.

public MapObject setVisibleMask (int level)

Sets this MapObject to be visible at the specified zoom level.

public MapObject setZIndex (int index)

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

public MapObject unsetVisibleMask (int levelStart, int levelEnd)

Sets this MapObject to be invisible at the specified range of zoom levels.

public MapObject unsetVisibleMask (int level)

Sets this MapObject to be invisible at the specified zoom level.

Class Details

Represents a base class for all map-related objects that users can add to a Map.

This abstract class serves as a base for several more specified map object types, bundling their common properties. The types of map objects that you can add to a map include:

Objects extending this class, with the exception of MapRoute but including MapContainer, can be grouped within a MapContainer instance.

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

Method Details

public boolean equals (Object obj)

Parameters:

  • obj

public Type getBaseType ()

public MapContainer getParent ()

Returns the parent of this MapObject .

Returns:

The parent MapContainer. If the current object is the root object, null is returned.

public abstract Type getType ()

Returns the type of object that this MapObject represents.

Returns:

One of the MapObject.Type values

public BitSet getVisibleMask ()

Returns the visibility bit mask of this MapObject

Returns:

BitSet which defines the visibility bit mask of the MapObject

public int getZIndex ()

Returns the current z-index (stacking order) of this MapObject . 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 MapObject is visible on the map.

Returns:

True if this MapObject is visible, false otherwise

public MapObject resetVisibleMask (boolean set)

Resets this MapObject to be either visible or invisible at all zoom levels. This method is equivalent to setVisible(minimumZoom, maximumZoom, false) . It can only be used after the MapObject has been added to the Map. By default, the visibility bit masks for all zoom levels are set to true.

This MapObject visibility mask is only applicable if setVisible(boolean) is also set to true .

Parameters:

  • set

    True to set map object as visible; false otherwise.

Returns:

The updated MapObject itself.

See also:

setVisible(boolean)

public MapObject setVisible (boolean isVisible)

Sets whether the visibility of the MapObject on the map is enabled. Whether the MapObject is actually visible depends on whether the visible mask is set for the desired zoom level.

This setting is independent but takes priority over the per-zoom level settings. For example, you can call setVisible(0, 6, true) and then call setVisible(false) , and the object will not appear on the map. Calling setVisible(false) will then cause the object to be visible in zoom levels 0 to 6.

Parameters:

  • isVisible

    A boolean variable specifying whether this MapObject is visible

Returns:

The updated MapObject itself.

See also:

setVisible(int, boolean)

setVisible(int, int, boolean)

public MapObject setVisible (int level, boolean isVisible)

Sets whether this MapObject is visible for the specified zoom level, if enabled. This method can only be used after the MapObject has been added to the Map. By default, the visibility bit masks for all zoom levels are set to true.

The MapObject is visible/invisible at the specified zoom level only if the setVisible(boolean) is also set to true.

Parameters:

  • level

    A zoom level

  • isVisible

    A boolean variable specifying whether this MapObject is visible

Returns:

The updated MapObject itself.

See also:

setVisible(boolean)

setVisible(int, int, boolean)

public MapObject setVisible (int levelStart, int levelEnd, boolean isVisible)

Sets whether this MapObject is visible for the specified range of zoom levels. This method can only be used after the MapObject has been added to the Map. By default, the visibility bit masks for all zoom levels are set to true.

The MapObject is visible/invisible at the specified zoom levels only if the setVisible(boolean) is also set to true.

Parameters:

  • levelStart

    A starting zoom level of the range to show or hide, inclusive

  • levelEnd

    An ending zoom level of the range to show or hide, inclusive

  • isVisible

    A boolean variable specifying whether this MapObject is visible

Returns:

The updated MapObject itself.

See also:

setVisible(boolean)

setVisible(int, boolean)

public MapObject setVisibleMask (int levelStart, int levelEnd)

Sets this MapObject to be visible at the specified range of zoom levels. This method is equivalent to setVisible(levelStart, levelEnd, true) . It can only be used after the MapObject has been added to the Map. By default, the visibility bit masks for all zoom levels are set to true.

The MapObject is visible at the specified zoom level only if the visibility of the MapObject is also set to true via setVisible(boolean).

Parameters:

  • levelStart

    A starting zoom level of the range

  • levelEnd

    An ending zoom level of the range

Returns:

The updated MapObject itself.

See also:

setVisible(boolean)

setVisibleMask(int, int)

unsetVisibleMask(int)

unsetVisibleMask(int, int)

getVisibleMask()

public MapObject setVisibleMask (int level)

Sets this MapObject to be visible at the specified zoom level. This method is equivalent to setVisible(level, true) . It can only be used after the MapObject has been added to the Map. By default, the visibility bit masks for all zoom levels are set to true.

The MapObject is visible at the specified zoom level only if the visibility of the MapObject is also set to true via setVisible(boolean).

Parameters:

  • level

    A zoom level

Returns:

The updated MapObject itself.

See also:

setVisible(boolean)

setVisibleMask(int, int)

unsetVisibleMask(int)

unsetVisibleMask(int, int)

getVisibleMask()

public MapObject setZIndex (int index)

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

Parameters:

  • index

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

Returns:

The updated MapObject itself.

Throws:

  • IllegalArgumentException

    If index is not within the valid range.

public MapObject unsetVisibleMask (int levelStart, int levelEnd)

Sets this MapObject to be invisible at the specified range of zoom levels. This method is equivalent to setVisible(levelStart, levelEnd, false) . It can only be used after the MapObject has been added to the Map. By default, the visibility bit masks for all zoom levels are set to true.

Parameters:

  • levelStart

    A starting zoom level of the range

  • levelEnd

    An ending zoom level of the range

Returns:

The updated MapObject itself.

See also:

setVisible(boolean)

unsetVisibleMask(int)

setVisibleMask(int)

setVisibleMask(int, int)

getVisibleMask()

public MapObject unsetVisibleMask (int level)

Sets this MapObject to be invisible at the specified zoom level. This method is equivalent to setVisible(level, false) . It can only be used after the MapObject has been added to the Map. By default, the visibility bit masks for all zoom levels are set to true.

Parameters:

  • level

    A zoom level

Returns:

The updated MapObject itself.

See also:

setVisible(boolean)

unsetVisibleMask(int, int)

setVisibleMask(int)

setVisibleMask(int, int)

getVisibleMask()