HorizonOptions
Horizon configuration options.
Horizon options define the extent of the paths in the horizon and the map attributes to be collected for these paths. A set of horizon options consists of the following:
The set of horizon element types the client is interested in.
The path search options for the main path.
The path search options for sub-paths.
The maximum number of paths the client can receive.
To specify horizon options, create an instance of this class:
val mainPathSearchOptions = MainPathSearchOptions(
searchTime = 10.minutes,
searchDistancePolicy = ExplicitDistancePolicy(
searchDistance = PathSearchDistance(
maxHorizonLength = Distance.kilometers(5)
)
)
)
val subPathSearchOptionsLevel1 = SubPathSearchOptions(
searchTime = 5.minutes,
searchDistance = PathSearchDistance(
maxHorizonLength = Distance.kilometers(2)
)
)
val subPathSearchOptionsLevel2 = SubPathSearchOptions(
searchTime = 3.minutes,
searchDistance = PathSearchDistance(
maxHorizonLength = Distance.kilometers(1)
)
)
val horizonOptions = HorizonOptions(
elementTypes = listOf(SpeedLimitsElementType, StreetElementType),
mainPathSearchOptions = mainPathSearchOptions,
subPathSearchOptions = listOf(subPathSearchOptionsLevel1, subPathSearchOptionsLevel2),
numberOfPaths = 4
)
For more information on horizon element types and horizon paths see HorizonEngine.
A client application can register multiple sets of horizon options and request the engine to provide data for all or only some of the registered option sets. The engine generates a separate horizon result for each set of options in the request. The client can also update horizon configuration by registering a new set of options or unregistering a previously registered set.
To register a set of horizon options, call the HorizonEngine.registerHorizonOptions function.
To unregister a set of horizon options, call the HorizonEngine.unregisterHorizonOptions function.
Important: This is a Public Preview API. It may be changed or removed at any time.
Throws
if elementTypes is empty.
Constructors
Properties
Types of horizon elements of interest.
Search options for the main path. The default value is an instance of MainPathSearchOptions created with default values for all constructor parameters.
Maximum number of paths the client can receive. The default value is DEFAULT_NUMBER_OF_PATHS.
Search options for sub-paths, specified per path level. The list element at index i encodes search options for path level i + 1. The horizon is extended to the deepest path level, as determined by this parameter. The default value is an empty list.