【问题标题】:Show direction between two markers in google map on clicking Navigation icon in flutter map view在颤动地图视图中单击导航图标时,在谷歌地图中的两个标记之间显示方向
【发布时间】:2019-09-19 06:41:28
【问题描述】:

我希望 Google 地图在点击右下角的导航图标时显示两个标记(标记 1 和标记 2)之间的方向。目前谷歌地图在点击导航图标时加载从当前位置到标记 2(当前点击的标记)的方向。

我正在使用 google_maps_flutter 依赖项来显示地图

【问题讨论】:

    标签: android ios google-maps flutter


    【解决方案1】:

    您必须使用您可能已经在使用的url_launcher

    onPressed: () async{
      String googleUrl = 'http://maps.google.com/maps?saddr=28.6207,77.3639&daddr=28.6057,77.3731';
      if (await canLaunch(googleUrl)) {
         await launch(googleUrl);
      } else {
         throw 'Could not open the map.';
      }
    },
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-26
      • 2018-08-04
      • 1970-01-01
      • 2020-07-02
      • 2016-07-08
      • 2019-09-23
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多