簡體   English   中英

重定向到谷歌地圖應用程序,其中包含源和目的地之間的方向,有些停頓

[英]Redirect to google maps app with directions between source and destination with some stops in flutter

我想重定向到谷歌地圖應用程序進行導航,在我的顫振應用程序的源和目的地之間有一些停靠點。 url_launcher 包重定向到帶有源和目標的映射,但我想要一些站點。 那可能嗎?

如果您想使用方向導航,您只需創建一個帶有源坐標和目的地坐標以及其他坐標的 url 以添加為停靠點。

步驟: 1. 安裝url_launcher插件

  1. 編寫如下代碼。
_launchURL(String url) async {
    if (await canLaunch(url)) {
      await launch(url);
    } else {
      throw 'Could not launch $url';
    }
  }




const url ='https://www.google.com/maps/dir/?api=1&origin=43.7967876,-79.5331616&destination=43.5184049,-79.8473993&waypoints=43.1941283,-79.59179|43.7991083,-79.5339667|43.8387033,-79.3453417|43.836424,-79.3024487&travelmode=driving&dir_action=navigate';
_launchURL(url);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM