ElectronicHorizonEngine (API Reference)
Class ElectronicHorizonEngine
Provides an electronic horizon engine that continuously predicts
the road network ahead of the vehicle by using detailed map data, including road topography that is
currently out of sight.
You can subscribe to electronic horizon updates based on position updates by using ElectronicHorizonListener.
For more information about sub path levels, see ElectronicHorizonOptions.lookAheadDistancesInMeters.
The electronic horizon engine uses map-matched locations and can optionally use a Route
to improve the most-preferred path (MPP).
Note: This is a beta release of this feature, so there could be a few bugs and unexpected behaviors. Related APIs may change for new releases without a deprecation process.
-
Constructor Summary
ConstructorsConstructorDescriptionElectronicHorizonEngine(SDKNativeEngine sdkEngine, ElectronicHorizonOptions options, TransportMode transportMode, Route route) Creates a new instance ofElectronicHorizonEngine. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddElectronicHorizonListener(ElectronicHorizonListener electronicHorizonListener) Adds anElectronicHorizonListenerto the subscription list.getRoute()voidremoveElectronicHorizonListener(ElectronicHorizonListener electronicHorizonListener) Removes anElectronicHorizonListenerfrom the subscription list.voidSets the instance ofRouteto be used byElectronicHorizonEngineornullif no route should be used.voidupdate(MapMatchedLocation mapMatchedLocation) Updates the electronic horizon paths based on the provided map-matched location.
-
Constructor Details
-
ElectronicHorizonEngine
public ElectronicHorizonEngine(@NonNull SDKNativeEngine sdkEngine, @NonNull ElectronicHorizonOptions options, @NonNull TransportMode transportMode, @Nullable Route route) throws InstantiationErrorException Creates a new instance of
ElectronicHorizonEngine.- Parameters:
sdkEngine-The
SDKNativeEngineinstance that provides shared services, such as networking and map data.options-The
ElectronicHorizonOptionsinstance that configures how the electronic horizon is calculated, including look-ahead distances.transportMode-The
TransportModethat is used when building the electronic horizon paths.route-The
Routethat improves the calculation of the most-preferred path (MPP). Ifnullis passed, the most-preferred path can deviate from the route.- Throws:
InstantiationErrorException-InstantiationErrorExceptionIf the electronic horizon engine cannot be created.
-
-
Method Details
-
addElectronicHorizonListener
public void addElectronicHorizonListener(@NonNull ElectronicHorizonListener electronicHorizonListener) Adds an
ElectronicHorizonListenerto the subscription list.- Parameters:
electronicHorizonListener-The listener that receives electronic horizon path updates.
-
removeElectronicHorizonListener
public void removeElectronicHorizonListener(@NonNull ElectronicHorizonListener electronicHorizonListener) Removes an
ElectronicHorizonListenerfrom the subscription list.- Parameters:
electronicHorizonListener-The listener that should no longer receive electronic horizon path updates.
-
getRoute
Gets the instance of
RouteornullifRouteis not set.You can override this property to rebuild the electronic horizon based on a different route.
- Returns:
The instance of
Routethat is being used byElectronicHorizonEngine.
-
setRoute
Sets the instance of
Routeto be used byElectronicHorizonEngineornullif no route should be used.You can override this property to rebuild the electronic horizon based on a different route.
- Parameters:
value-The instance of
Routethat is being used byElectronicHorizonEngine.