Android:重新创建地图工具栏:在Google地图中打开

时间:2017-07-21 10:21:30

标签: android google-maps-android-api-2

所以我正在构建一个显示位置(标记)的地图。我不想使用Map ToolBar(它有方向并在Google Maps按钮中打开)但是我想在GoogleMaps中打开我自己的按钮,并指示该标记。

1 个答案:

答案 0 :(得分:1)

试试这个:

Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
    Uri.parse("http://maps.google.com/maps?saddr=20.344,34.34&daddr=20.5666,45.345"));
startActivity(intent);

如果不能正常工作,请根据此链接https://developers.google.com/maps/documentation/urls/guide

进行尝试
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
        Uri.parse("https://www.google.com/maps/search/?api=1&query=47.5951518,-122.3316393"));
    startActivity(intent);