Is there an API for Google Maps navigation in Android?

后端 未结 5 1263
野性不改
野性不改 2020-12-07 21:11

I am developing an Android app where I am using Google Maps. It is working well and good. But

After loading the map when a user has clicked “Get Directions”, Google

5条回答
  •  粉色の甜心
    2020-12-07 22:11

    As of 2018, Google has announced the Google Maps Navigation SDK. You can see the following Google Maps Platform presentation at I/O'18 where Google Maps Product Managers mentioned the SDK:

    https://youtu.be/XVjyIA3f_Ic?t=20m31s

    Unfortunately, this SDK is not available publicly at the moment. You have to contact sales team in order to purchase license for this SDK. As I can see currently only big ride sharing companies like Uber or Lyft have this SDK in their apps.

    Alternatively, you can open Google Maps app in navigation mode using the Google Maps URLs. Google Maps URLs build a universal, cross-platform URL to launch Google Maps, so you can use them with your intents.

    E.g.

    String url = "https://www.google.com/maps/dir/?api=1&destination=Madrid,Spain&origin=Barcelona,Spain&travelmode=driving&dir_action=navigate";           
    Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
    startActivity(intent);
    

提交回复
热议问题