HERE Android SDK Developer's Guide

ElectronicHorizon

The class ElectronicHorizon is a member of com.here.android.mpa.electronic_horizon .

Class Summary

public final class ElectronicHorizon

extends java.lang.Object

ElectronicHorizon is a class that predicts upcoming streets and provides information about them.

[For complete information, see the section Class Details]

Nested Class Summary

Table 1. Nested Classes in ElectronicHorizon
Nested Classes

public static abstract interface ElectronicHorizon.Listener

Represents an interface for responding to electronic horizon events sent by the ElectronicHorizon.

Constructor Summary

Table 2. Constructors in ElectronicHorizon
Constructors

ElectronicHorizon ()

Constructor.

Method Summary

Table 3. Methods in ElectronicHorizon
Methods

public MapAccessor getMapAccessor ()

public void setListener (Listener listener)

Sets the Listener that listens to the events of the ElectronicHorizon.

public void setLookAheadDistancesInCentimeters (int... distancesInCentimeters)

Sets look ahead distances.

public void setRoute (Route route)

Sets route to follow.

public void setTrailingDistanceInCentimeters (int distanceInCentimeters)

Sets trailing distance.

public void update ()

Updates electronic horizon with new position.

Class Details

ElectronicHorizon is a class that predicts upcoming streets and provides information about them.

Constructor Details

ElectronicHorizon ()

Constructor.

Method Details

public MapAccessor getMapAccessor ()

Returns:

An instance of MapAccessor class, which can be used to access the information about any link.

public void setListener (Listener listener)

Sets the Listener that listens to the events of the ElectronicHorizon.

Parameters:

public void setLookAheadDistancesInCentimeters (int... distancesInCentimeters)

Sets look ahead distances. New links and children will be added if distance between them and current position is less than distance on appropriate level.

Parameters:

  • distancesInCentimeters

    Distances in centimeters where distance at index 0 means distance for main path and distance at N index means N level of children Examples: Only main path with length of 7 kilometers from current position: setLookAheadDistancesInCentimeters(new int[] {700000}) Main path with length of 7 kilometers from current position and children with length of 1 kilometer from current position (i.e. children have 1 kilometer length only if it starts at the same point as current position, otherwise it have 1 kilometer minus offset between current position and child's offset at main path): setLookAheadDistancesInCentimeters(new int[] {700000, 100000})

public void setRoute (Route route)

Sets route to follow. Electronic horizon will take route into account to build path tree.

Parameters:

  • route

    Route to follow Note: Only the routes with transport mode RouteOptions.TransportMode#CAR or RouteOptions.TransportMode#TRACK are supported.

Throws:

  • IllegalArgumentException

    if route is null or mode doesn't match.

public void setTrailingDistanceInCentimeters (int distanceInCentimeters)

Sets trailing distance. Old links and children are removed only when they far at this trailing distance from current position.

Parameters:

  • distanceInCentimeters

    Distance in centimeters

public void update ()

Updates electronic horizon with new position. After calling update function the path tree of electronic horizon might be changed.