Google 导航体验
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
Navigation SDK 提供了多种将导航体验集成到应用中的方法。本页将介绍 Google 导航体验,以及它与 Navigation SDK 中提供的其他导航体验有何不同。
什么是 Google 导航体验?
Google 导航体验是指使用 Navigation SDK 嵌入逐向导航体验,该体验使用 Google 提供的界面元素和视觉效果,类似于 Google 地图应用中的导航体验。将 Google 导航体验嵌入应用后,您无需从头开始构建导航体验,但仍可以修改部分体验。或者,如果您需要比 Google 导航体验提供的更多自定义选项,可以从 Navigation SDK 请求逐向导航 Feed,然后提供和管理自己的界面元素。
如需了解详情,请参阅
自定义导航体验。
当您使用 Google 导航体验时,您的应用会调用 Navigation SDK 来启动、运行和停止导航,具体流程如下:
开始导航。如需开始导航,您的应用会创建一个 navigator 实例。然后,它会设置导航器的目的地并初始化地图。最后,应用会启动精细的导航路线。
您可以根据自己的使用情形,以各种方式向用户呈现此应用流程。例如,应用可能有一个实体店定位器,其中包含自己的界面元素,用户可以使用这些元素开始前往实体店的导航。或者,当司机接受送货任务时,您的应用可能会开始以预定义的目的地进行主动导航。
有效导航。应用进入主动导航状态后,会使用设备位置信息来保持主动引导。您可以配置对您的使用情形有意义的事件监听器,例如用于路线变更和到达目的地剩余时间的监听器。在有效导航期间,Navigation SDK 会提供与 Google 地图应用中类似的界面组件。例如,导航体验会显示一个标准的 Google 地图图层,其中包含转向引导卡片、路况图层、替代路线和限速等视觉元素。
停止导航。您的应用以最适合相应用例的方式终止导航会话,例如使用在用户到达目的地时触发的到达监听器。
如何修改 Google 导航体验?
一般来说,您可以修改 Google 导航体验,使其具有不同的配色方案、摄像头视图、额外的转弯指导和事件响应触发器。以下列表介绍了您可以进行的一些调整。该列表并不详尽。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-31。
[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eThe Google Navigation SDK enables developers to easily integrate turn-by-turn navigation into their apps using pre-built UI elements similar to the Google Maps app.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can customize aspects of the Google navigation experience like color schemes, camera views, and guidance information, but for full control, a custom navigation experience is recommended.\u003c/p\u003e\n"],["\u003cp\u003eThe Google navigation experience involves a three-step flow: starting navigation by defining the destination, active navigation with real-time guidance, and stopping navigation upon arrival.\u003c/p\u003e\n"],["\u003cp\u003eThe Navigation SDK offers various options for modifying the navigation UI, such as showing or hiding elements, adjusting traffic and speed limit information, and customizing the map and camera.\u003c/p\u003e\n"]]],[],null,["# The Google navigation experience\n\nThe Navigation SDK provides different ways to integrate a navigation\nexperience into your app. This page explains what the Google navigation\nexperience is and how it differs from other navigation experiences that are\navailable in the Navigation SDK.\n\nWhat is the Google navigation experience?\n-----------------------------------------\n\nThe Google navigation experience refers to using the Navigation SDK to\nembed a turn-by-turn navigation experience that uses Google-provided UI elements\nand visuals, which are similar to the navigation experience within the Google\nMaps apps. When you embed the Google navigation experience in your app, you\ndon't need to build the navigation experience from scratch, but you can still\nmodify parts of the experience. As an alternative, if you need more\ncustomization than is available with the Google navigation experience, you can\nrequest a turn-by-turn navigation feed from the Navigation SDK and then\nprovide and manage your own UI elements.\nFor more information, see [Custom navigation experience](/maps/documentation/navigation/android-sdk/intro-custom-nav).\n\n\u003cbr /\u003e\n\nWhen you use Google navigation experience, your app calls the\nNavigation SDK to start, run, and stop navigation, using the following\nflow:\n\n1. **Start navigation**. To start navigation, your app creates a navigator\n instance. From there, it sets the destination for the navigator and\n initializes a map. Finally, the app initiates the turn-by-turn guidance.\n This app flow can be presented to the user in a variety of ways depending on\n your use case. For example, the app might have a store locator with its own\n UI elements that users can use to begin navigation to the store. Or, your\n app might begin active navigation with a predefined destination when a\n driver accepts a delivery task.\n\n2. **Active navigation**. Once your app enters active navigation, it uses the\n device location to maintain active guidance. You configure event listeners\n that are meaningful to your use case, such as for route changes and\n remaining time to the destination. During active navigation, the Navigation\n SDK provides UI components, which are similar to those in the Google Maps\n apps. For example, the navigation experience shows a standard Google maps\n layer, with visuals like turn guidance cards, traffic layers, alternate\n routes, and speed limits.\n\n3. **Stop navigation**. Your app terminates the navigation session in the way\n that best works for your use case, such as with an arrival listener that\n triggers when the user reaches the destination.\n\nHow can you modify the Google navigation experience?\n----------------------------------------------------\n\nIn general, you can modify the Google navigation experience to have different\ncolor schemes, camera views, extra turn guidance, and event response triggers.\nThe following list describes some of the adjustments you can make. This list is\nnot exhaustive.\n\n| **Modification** | **Details** |\n|--------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Modified navigation guidance: show/hide headers, colors and fonts, directions, alternate routes, and trip progress | [Map UI controls](/maps/documentation/navigation/android-sdk/controls) [Modify the navigation header](/maps/documentation/navigation/android-sdk/controls#modify_the_navigation_header) [Display directions list](/maps/documentation/navigation/android-sdk/controls#display_directions_list) [Hide alternate routes](/maps/documentation/navigation/android-sdk/controls#hiding_alternate_routes) [Display trip progress](/maps/documentation/navigation/android-sdk/controls#trip-progress-bar) |\n| Adjust traffic information and speed limit information | [Turn off traffic layer](/maps/documentation/navigation/android-sdk/controls#turn_off_the_traffic_layer) [Enable traffic lights and stop signs](/maps/documentation/navigation/android-sdk/controls#enable_traffic_lights_and_stop_signs) [Display the speedometer](/maps/documentation/navigation/android-sdk/controls#display_the_speed_limit) |\n| Change the map experience UI and adjust the camera. | [Add custom markers](/maps/documentation/navigation/android-sdk/controls#add_custom_markers) [Floating text](/maps/documentation/navigation/android-sdk/controls#floating_text) [Set night mode](/maps/documentation/navigation/android-sdk/controls#set_night_mode) [Adjust the camera](/maps/documentation/navigation/android-sdk/camera) |"]]