简体   繁体   English

Mapbox Directions API Android 不工作

[英]Mapbox Directions API Android not working

I started using the Mapbox Directions API for my app, and I was about to check just if it works.我开始为我的应用程序使用 Mapbox Directions API,我正准备检查它是否有效。 I went through Antonio Zugaldia's blog which there he explains how to show directions with easy steps.我浏览了 Antonio Zugaldia 的博客,他在那里解释了如何通过简单的步骤显示方向。 ( https://www.mapbox.com/blog/android-directions-library/ ) ( https://www.mapbox.com/blog/android-directions-library/ )

So I started implemeting all the code and I tried running the app, but that didn't work out.所以我开始实现所有代码并尝试运行该应用程序,但没有成功。 I debug the app and saw that the flow broke in this line:我调试应用程序并看到流程在这一行中断:

Response<DirectionsResponse> response = client.execute();

when I debug this line, I saw it fell down in OkHttpCall.java class in method name:当我调试这一行时,我看到它在方法名称中的OkHttpCall.java类中掉了下来:

public Response<T> execute() throws IOException

on the last line which was:在最后一行是:

return parseResponse(rawCall.execute());

So how can I make directions work easily?那么我怎样才能让路线更轻松呢?

Thanks for the question and sorry for the trouble.感谢您的提问,很抱歉给您带来麻烦。 For all our services, including the Directions API, we're now using Mapbox Android Services which is much more powerful than the original library.对于我们所有的服务,包括 Directions API,我们现在使用的是 Mapbox Android 服务,它比原始库强大得多。 We have documentation on how to install it here, and full example for Directions here.我们此处提供了有关如何安装它的文档,并在此处提供了完整的方向示例 Hope this helps.希望这可以帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Mapbox(Android)不显示路线 - Mapbox (android) does not show directions Android 方向 API ArrayIndexOutOfBoundsException - Android Directions API ArrayIndexOutOfBoundsException Mapbox Android:如何获取从当前位置到您选择的目的地的路线? - Mapbox Android: How to get directions from current location to a destination you choose? 使用 MapBox 生成两个位置的路线和方向 - Using MapBox to generate a route and directions for two locations 使用Google Directions API在Android应用程序中获取驾驶指示 - Getting driving instructions in android application using Google Directions API 如何从我的 android 中间件解析方向 API 响应? - How to parse Directions API Response from my middleware in android? 如何将Google Directions API中的“步骤”解析为Java(Android) - How to parse “steps” from the google directions API to java (android) 如何在Android上使用Google Maps Directions API? - How do I use Google Maps Directions API on Android? Android智能手机上的Google Directions API会返回状态代码NOT_FOUND - Google Directions API on Android smartphone returns status code NOT_FOUND 如何在Android中的Java中向Google Map Api添加路线? - How to add directions to Google Map Api in java in Android?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM