NavigationManager.getInstance()返回null

发布于 2025-01-27 07:30:36 字数 205 浏览 2 评论 0原文

我在Android应用程序中使用此处地图API,并且我有一个特定的客户端报告难度使用地图,我可以在日志中看到该问题是navigationmanager.getInstance()返回null。不幸的是,我无法在本地复制此内容,我只能在客户端设备的日志上看到它。

有人会对我在哪里开始调试此事有任何建议,什么可能导致这种情况发生?

感谢帮助。

I use the here maps api in an android application and I have a client particular client reporting difficulty using the map, I can see in the logs that the issue is NavigationManager.getInstance() returns null. Unfortunately I cannot replicate this locally, I can only see it on logs from client devices.

Would anyone have any advice on where I would start debugging this and what could cause this to happen ?

Appreciate the help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情绪 2025-02-03 07:30:36

NavigationManager类负责在开车或步行时向用户提供语音和视觉说明。可以使用NavigationManager.getInstance()检索NavigationManager的实例。在启动导航之前,它应与SETMAP(MAP)方法的地图关联。

可以以三种不同的模式开始导航:
仿真模式 - 仿真(路由,长) - 由于沿给定路线模拟位置时,此模式不需要任何GPS数据。
导航模式 - 启动划分(路线) - 此模式采用计算的路线,并将位置与路线相匹配。在使用此模式之前,需要使用GPS数据运行定位。
跟踪模式 - startTracking() - 此模式不需要计算的路由,因为它仅跟踪并显示地图上的当前位置。
注意:Android许可android.permission.access_fine_location需要使用NavigationManager。否则,类返回错误。positioning_failed。此外,为了确保应用程序接收位置更新,用户需要在运行时启用位置权限(切换到“ on”)。
以下是在计算的路线上执行导航的一个示例:

NavigationManager navigationManager = NavigationManager.getInstance();

//set the map where the navigation will be performed
navigationManager.setMap(getMap());

// if user wants to start real navigation, submit calculated route
// for more information on calculating a route, see the "Directions" section
NavigationManager.Error error = navigationManager.startNavigation(route);

您可以检查

NavigationManager class is responsible for providing voice and visual instructions to the user while driving or walking. An instance of NavigationManager can be retrieved using NavigationManager.getInstance(). It should be associated with a map with setMap(Map) method before navigation is started.

Navigation can be started in three different modes:
Simulation Mode - simulate(Route, long) - This mode does not require any GPS data from the device as the position is simulated along the given route.
Navigation Mode - startNavigation(Route) - This mode takes the calculated route and matches the position against the route. Before using this mode, PositioningManager is required to be running with GPS data.
Tracking Mode - startTracking() - This mode does not require a calculated route as it only tracks and shows the current position on the map.
Note: Android permission android.permission.ACCESS_FINE_LOCATION is required to use NavigationManager. Otherwise, the class returns Error.POSITIONING_FAILED. In addition, to ensure that the app receives location updates, the user needs to have the Location permission enabled (toggled to "on") during runtime.
The following is an example of performing navigation on a calculated route:

NavigationManager navigationManager = NavigationManager.getInstance();

//set the map where the navigation will be performed
navigationManager.setMap(getMap());

// if user wants to start real navigation, submit calculated route
// for more information on calculating a route, see the "Directions" section
NavigationManager.Error error = navigationManager.startNavigation(route);

You can check the the map-guidance example for the same.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文