Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

0.22.0 Migration Guide

Pablo Guardiola edited this pageDec 21, 2018 ·2 revisions

PRs that broke SEMVER:


The deprecatedInstructionView#update(RouteProgress)was removed.

To update theInstructionView (used outside of theNavigationView as its own component), you need to implement two methods now to ensure theView is properly updated with the correct data.

BothProgressChangeListener andMilestoneEventListener must be implemented. The reason behind this is because we provide banner instruction updates via theMilestoneEventListener (which happens ~2 times a step). TheProgressChangeListener must be implemented as well because it provides the distance remaining data, which is updated every second. Ultimately, this helps with the amount of updates to theTextView andImageViews in theInstructionView, increasing the UI efficiency.

Code example:

@Overridepublic void onProgressChange(Location location, RouteProgress routeProgress) {  instructionView.updateDistanceWith(routeProgress);}@Overridepublic void onMilestoneEvent(RouteProgress routeProgress, String instruction, Milestone milestone) {  instructionView.updateBannerInstructionsWith(milestone);}

NavigationCamera#updateCameraTrackingEnabled(boolean isEnabled) wasreplaced withupdateCameraTrackingMode(@NavigationCamera.TrackingMode int trackingMode)

This changes the way you enable and disable theNavigationCamera. To do so now, you can alternate between differentTrackingModes:

  • NAVIGATION_TRACKING_MODE_NONE: camera does not tack the user location (replaces disabled behavior)
  • NAVIGATION_TRACKING_MODE_GPS: camera tracks the user location, with bearing provided by the location update
  • NAVIGATION_TRACKING_MODE_NORTH: camera tracks the user location, with bearing always set to north (0)

Code example:

// Tracking disabledcamera.updateCameraTrackingMode(NavigationCamera.NAVIGATION_TRACKING_MODE_NONE)// Tracking enabled camera.updateCameraTrackingMode(NavigationCamera.NAVIGATION_TRACKING_MODE_GPS)

NavigationCamera#resetCameraPosition()was replaced withNavigationCamera#resetCameraPositionWith(@TrackingMode int trackingMode):

This change was made so that you can not only reset the camera to its last known position, but also begin tracking again with the mode specified in the param passed.

Code example:

// Moves camera to last known position and begins tracking with bearing 0camera.resetCameraPositionWith(NavigationCamera.NAVIGATION_TRACKING_MODE_GPS_NORTH)

As a result of these API changes, we also updatedNavigationMapboxMap which can be used withNavigationView#retrieveNavigationMap() or by itself as shown inComponentNavigationActivity. The changes mirror the changes to theNavigationCamera API itself.


InAdded nav-native ETAs [RouteLegProgress#durationRemaining()](https://github.com/mapbox/mapbox-navigation-android/pull/1412/files#diff-eb4e0646b51e2ff7104194a9519ed892L69) was madeabstract`.

Clone this wiki locally


[8]ページ先頭

©2009-2025 Movatter.jp