HERE Android SDK Developer's Guide

MapBuildingLayer

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

Class Summary

public final class MapBuildingLayer

extends java.lang.Object

Represents a map layer that enables interactions with extruded buildings.

[For complete information, see the section Class Details]

See also:

getMapBuildingLayer()

Nested Class Summary

Table 1. Nested Classes in MapBuildingLayer
Nested Classes

public static final class MapBuildingLayer.BuildingSearchResult

Represents search results information for a building search

public static final enumeration MapBuildingLayer.DefaultBuildingColor

A set of pre-defined colors to change a MapBuildingGroup's color property

public static final enumeration MapBuildingLayer.DefaultBuildingGroups

Default groups of buildings on the Map.

Method Summary

Table 2. Methods in MapBuildingLayer
Methods

public MapBuildingGroup createNewBuildingGroup ()

Create a new MapBuildingGroup for custom building selection.

public MapBuildingGroup createNewBuildingGroup (DefaultBuildingColor color)

Create a new MapBuildingGroup with the given color for custom building selection.

public MapBuildingObject getBuilding (Identifier buildingId, GeoCoordinate positionHint)

Find a particular building on the Map around the given position.

public MapBuildingObject getBuilding (Identifier buildingId)

Find a particular building on the Map

public BuildingSearchResult getBuildingsInside (GeoBoundingBox boundingBox)

Find all buildings located inside a GeoBoundingBox.

public MapBuildingGroup getDefaultBuildingGroup (DefaultBuildingGroups group)

Get a building group of a MapBuildingLayer.DefaultBuildingGroups type.

public java.util.HashMap <Identifier, java.lang.Float> getTransparency (java.util.List <Identifier> buildingIds)

Retrieve the transparency (alpha) [0,1] factor of a list of buildings.

public java.util.HashMap <Identifier, java.lang.Float> getVerticalScale (java.util.List <Identifier> buildingIds)

Retrieve the vertical scale [0,1] factor of a list of buildings.

public void releaseBuildingGroup (MapBuildingGroup group)

Release the MapBuildingGroup created for custom building selection.

Class Details

Represents a map layer that enables interactions with extruded buildings.

This class can be used to find MapBuildingObject and create MapBuildingGroup instances.

See also:

getMapBuildingLayer()

Method Details

public MapBuildingGroup createNewBuildingGroup ()

Create a new MapBuildingGroup for custom building selection.

At run time, there can only be a maximum number of MapBuildingGroup s, when the limit is reached, no new MapBuildingGroup can be created unless some are being freed up by calling releaseBuildingGroup(MapBuildingGroup).

Returns:

MapBuildingGroup. By default, a new MapBuildingGroup has the MapBuildingGroup with color SELECTED.

See also:

releaseBuildingGroup(MapBuildingGroup)

public MapBuildingGroup createNewBuildingGroup (DefaultBuildingColor color)

Create a new MapBuildingGroup with the given color for custom building selection.

At run time, there can only be a maximum number of MapBuildingGroup s, when the limit is reached, no new MapBuildingGroup can be created unless some are being freed up by calling releaseBuildingGroup(MapBuildingGroup).

Parameters:

  • color

    Color of buildings in the new MapBuildingGroup

Returns:

MapBuildingGroup. Returns null if no more new MapBuildingGroup can be created. At run time, there is a maximum number of MapBuildingGroups created. When the limit is reached, no new MapBuildingGroup can be created unless some are being freed up by calling releaseBuildingGroup(MapBuildingGroup).

See also:

releaseBuildingGroup(MapBuildingGroup)

public MapBuildingObject getBuilding (Identifier buildingId, GeoCoordinate positionHint)

Find a particular building on the Map around the given position.

Parameters:

  • buildingId

    Identifier of the building. Obtainable from PlaceLink. This parameter can be null, if it is null it will try to find the building located at positionHint.

  • positionHint

    A GeoCoordinate of the approximate location of the building.

Returns:

MapBuildingObject

public MapBuildingObject getBuilding (Identifier buildingId)

Find a particular building on the Map

Parameters:

Returns:

MapBuildingObject

public BuildingSearchResult getBuildingsInside (GeoBoundingBox boundingBox)

Find all buildings located inside a GeoBoundingBox. This API will return all buildings located inside a bounding box area. Map data for this area must be downloaded. If the search result returns java.lang.Error#NEEDS_DATA, retry the request after some delay. Map data download request will be triggered.

Parameters:

  • boundingBox

    A GeoBoundingBox representing the bounding box area.

Returns:

MapBuildingLayer.BuildingSearchResult. Use the method getResultCode() to determine success of the operation. Building results can be retrieved via getResults()

public MapBuildingGroup getDefaultBuildingGroup (DefaultBuildingGroups group)

Get a building group of a MapBuildingLayer.DefaultBuildingGroups type. The default building group is a generic group that represents all possible buildings of that type in the entire world.

Parameters:

  • group

    One of the values in the enum DefaultBuildingGroups

Returns:

MapBuildingGroup

public java.util.HashMap <Identifier, java.lang.Float> getTransparency (java.util.List <Identifier> buildingIds)

Retrieve the transparency (alpha) [0,1] factor of a list of buildings. This is useful to animate any markers that are anchored to specific buildings.

This API can be used in conjunction with getVerticalScale(List) to perform custom animations of MapMarker. This API should be called from onPostDraw(boolean, long) to synchronize with rendering.

Parameters:

  • buildingIds

    A List of identifiers for the buildings of which the current transparency are to be retrieved

Returns:

A HashMap of Identifier-to-transparency mappings.

public java.util.HashMap <Identifier, java.lang.Float> getVerticalScale (java.util.List <Identifier> buildingIds)

Retrieve the vertical scale [0,1] factor of a list of buildings. This is useful to animate any markers that are anchored to specific buildings.

This API can be used in conjunction with getTransparency(List) to perform custom animations of MapMarker. This API should be called from onPostDraw(boolean, long) to synchronize with rendering.

Parameters:

  • buildingIds

    A List of identifiers identifiers for the buildings of which the current vertical scale are to be retrieved.

Returns:

A HashMap of the Identifier-to-scaling factor mappings.

public void releaseBuildingGroup (MapBuildingGroup group)

Release the MapBuildingGroup created for custom building selection.

Parameters:

  • group

    The MapBuildingGroup to be released. The MapBuildingGroup instance becomes invalid and unusable again. To create a new MapBuildingGroup, use createNewBuildingGroup().

Throws: