Object TrimbleNativeNavigatorImpl

    • Constructor Detail

    • Method Detail

      • resetRideSession

         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.

      • updateSensorData

         Boolean updateSensorData(SensorData sensorData)

        Passes in the current sensor data of the user.

        Parameters:
        sensorData - The current sensor data of user.
      • getStatus

         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

         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

         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 annotations
        routeIndex - Which route to apply the annotation update to
        legIndex - Which leg to apply the annotation update to
      • getRouteGeometryWithBuffer

         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 cells
        bufferDilation - the number of pixels to dilate the initial intersection by it can be thought of as controlling the halo thickness around the route
      • updateLegIndex

         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
      • unpackTiles

         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

         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

         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

         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

         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 event
        eventJsonProperties - the json to attach to the "properties" key of the event