Interface TrimbleMapsNativeNavigator
-
- All Implemented Interfaces:
public interface TrimbleMapsNativeNavigatorProvides API to work with native Navigator class. Exposed for internal usage only.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classTrimbleMapsNativeNavigator.Companion
-
Method Summary
Modifier and Type Method Description abstract TrimbleMapsNativeNavigatorcreate(DeviceProfile deviceProfile, NavigatorConfig navigatorConfig)Initialize the navigator with a device profile abstract UnitresetRideSession()Reset the navigator state with the same configuration. abstract BooleanupdateLocation(Location rawLocation)Passes in the current raw location of the user. abstract BooleanupdateSensorData(SensorData sensorData)Passes in the current sensor data of the user. abstract BooleancheckInDataGrid(Location rawLocation)abstract UnitonNetworkStatusChanged(Boolean network)abstract UnitretryMapDownload()abstract UnitsetRetryMapDownload(Boolean retry)abstract UnitsetAvailableStorageMB(Double storageSpaceMB)abstract TripStatusgetStatus(Long navigatorPredictionMillis)Gets the status as an offset in time from the last fixed location. abstract RouteInitInfosetRoute(DirectionsRoute route, Integer legIndex)Sets the route path for the navigator to process. abstract BooleanupdateAnnotations(String legAnnotationJson, Integer routeIndex, Integer legIndex, Integer geometryStartIndex, ArrayList<String> fasterAlternates, NavigatorCallback cb)Updates annotations so that subsequent calls to getStatus will reflect the most current annotations for the route. abstract BannerInstructiongetBannerInstruction(Integer index)Gets the banner at a specific step index in the route. abstract StringgetRouteGeometryWithBuffer(Float gridSize, Short bufferDilation)Gets a polygon around the currently loaded route. abstract BooleanupdateLegIndex(Integer legIndex)Follows a new leg of the already loaded directions. abstract UnitcacheLastRoute()Caches tiles around the last set route abstract LongunpackTiles(String tarPath, String destinationPath)Passes in an input path to the tar file and output path. abstract LongremoveTiles(String tilePath, Point southwest, Point northeast)Removes tiles wholly within the supplied bounding box. abstract StringgetHistory()Gets the history of state-changing calls to the navigator. abstract UnittoggleHistory(Boolean isEnabled)Toggles the recording of history on or off. abstract UnitaddHistoryEvent(String eventType, String eventJsonProperties)Adds a custom event to the navigator's history. abstract VoiceInstructiongetVoiceInstruction(Integer index)Gets the voice instruction at a specific step index in the route. abstract UnitsetElectronicHorizonObserver(ElectronicHorizonObserver eHorizonObserver)Sets the Electronic Horizon observer
-
-
-
Method Detail
-
create
abstract TrimbleMapsNativeNavigator create(DeviceProfile deviceProfile, NavigatorConfig navigatorConfig)
Initialize the navigator with a device profile
-
resetRideSession
abstract Unit resetRideSession()
Reset the navigator state with the same configuration. The location becomes unknown, but the NavigatorConfig stays the same. This can be used to transport the navigator to a new location.
-
updateLocation
abstract Boolean updateLocation(Location rawLocation)
Passes in the current raw location of the user.
- Parameters:
rawLocation- The current raw Location of user.
-
updateSensorData
abstract Boolean updateSensorData(SensorData sensorData)
Passes in the current sensor data of the user.
- Parameters:
sensorData- The current sensor data of user.
-
checkInDataGrid
abstract Boolean checkInDataGrid(Location rawLocation)
-
onNetworkStatusChanged
abstract Unit onNetworkStatusChanged(Boolean network)
-
retryMapDownload
abstract Unit retryMapDownload()
-
setRetryMapDownload
abstract Unit setRetryMapDownload(Boolean retry)
-
setAvailableStorageMB
abstract Unit setAvailableStorageMB(Double storageSpaceMB)
-
getStatus
abstract TripStatus getStatus(Long navigatorPredictionMillis)
Gets the status as an offset in time from the last fixed location. This allows the caller to get predicted statuses in the future along the route if the device is unable to get fixed locations. Poor reception would be one reason.
This method uses previous fixes to snap the user's location to the route and verify that the user is still on the route. This method also determines if an instruction needs to be called out for the user.
- Parameters:
navigatorPredictionMillis- millis for navigation status predictions.
-
setRoute
abstract RouteInitInfo setRoute(DirectionsRoute route, Integer legIndex)
Sets the route path for the navigator to process. Returns initialized route state if no errors occurred. Otherwise, it returns a invalid route state.
- Parameters:
route- DirectionsRoute to follow.legIndex- Which leg to follow
-
updateAnnotations
abstract Boolean updateAnnotations(String legAnnotationJson, Integer routeIndex, Integer legIndex, Integer geometryStartIndex, ArrayList<String> fasterAlternates, NavigatorCallback cb)
Updates annotations so that subsequent calls to getStatus will reflect the most current annotations for the route.
- Parameters:
legAnnotationJson- A string containing the json/pbf annotationsrouteIndex- Which route to apply the annotation update tolegIndex- Which leg to apply the annotation update to
-
getBannerInstruction
abstract BannerInstruction getBannerInstruction(Integer index)
Gets the banner at a specific step index in the route. If there is no banner at the specified index method return null.
- Parameters:
index- Which step you want to get BannerInstruction for
-
getRouteGeometryWithBuffer
abstract String getRouteGeometryWithBuffer(Float gridSize, Short bufferDilation)
Gets a polygon around the currently loaded route. The method uses a bitmap approach in which you specify a grid size (pixel size) and a dilation (how many pixels) to expand the initial grid cells that are intersected by the route.
- Parameters:
gridSize- the size of the individual grid cellsbufferDilation- the number of pixels to dilate the initial intersection by it can be thought of as controlling the halo thickness around the route
-
updateLegIndex
abstract Boolean updateLegIndex(Integer legIndex)
Follows a new leg of the already loaded directions. Returns an initialized navigation status if no errors occurred otherwise, it returns an invalid navigation status state.
- Parameters:
legIndex- new leg index
-
cacheLastRoute
abstract Unit cacheLastRoute()
Caches tiles around the last set route
-
unpackTiles
abstract Long unpackTiles(String tarPath, String destinationPath)
Passes in an input path to the tar file and output path.
- Parameters:
tarPath- The path to the packed tiles.destinationPath- The path to the unpacked files.
-
removeTiles
abstract Long removeTiles(String tilePath, Point southwest, Point northeast)
Removes tiles wholly within the supplied bounding box. If the tile is not contained completely within the bounding box, it will remain in the cache. After removing files from the cache, any routers should be reconfigured to synchronize their in-memory cache with the disk.
- Parameters:
tilePath- The path to the tiles.southwest- The lower left coord of the bounding box.northeast- The upper right coord of the bounding box.
-
getHistory
abstract String getHistory()
Gets the history of state-changing calls to the navigator. This can be used to replay a sequence of events for the purpose of bug fixing.
-
toggleHistory
abstract Unit toggleHistory(Boolean isEnabled)
Toggles the recording of history on or off. Toggling will reset all history calls getHistory first before toggling to retain a copy.
- Parameters:
isEnabled- set this to true to turn on history recording and false to turn it off
-
addHistoryEvent
abstract Unit addHistoryEvent(String eventType, String eventJsonProperties)
Adds a custom event to the navigator's history. This can be useful to log things that happen during navigation that are specific to your application.
- Parameters:
eventType- the event type in the events log for your custom eventeventJsonProperties- the json to attach to the "properties" key of the event
-
getVoiceInstruction
abstract VoiceInstruction getVoiceInstruction(Integer index)
Gets the voice instruction at a specific step index in the route. If there is no voice instruction at the specified index, null is returned.
- Parameters:
index- Which step you want to get VoiceInstruction for
-
setElectronicHorizonObserver
abstract Unit setElectronicHorizonObserver(ElectronicHorizonObserver eHorizonObserver)
Sets the Electronic Horizon observer
-
-