我試圖在我的應用中使用Waze
實現導航,使用他們自己的API:here。將自定義座標設置爲函數,Waze集成
我都希望使用在array
設置custom coordinates
設置,然後配合他們在這個代碼:
func navigate(toLatitude latitude: Double , longitude: Double) {
if UIApplication.shared.canOpenURL(URL(string: "waze://")!) {
// Waze is installed. Launch Waze and start navigation
let urlStr: String = "waze://?ll=\(latitude),\(longitude)&navigate=yes"
UIApplication.shared.openURL(URL(string: urlStr)!)
}
else {
// Waze is not installed. Launch AppStore to install Waze app
UIApplication.shared.openURL(URL(string: "http://itunes.apple.com/us/app/id323229106")!)
}
}
我已經嘗試設置了不同類型的數組,但沒有成功,使這行得通 。所以,如果你可以幫助我組自定義列保持緯度和經度,將與代碼正常工作,這將是真棒
你的幫助會非常有幫助的,
預先感謝您。
你是什麼意思的自定義座標? – Subramanian
就像我會創建自己的座標數組,我控制他們的度數,我會設置func導航到該座標數組。你現在明白了? @Subramanian – RandomGeek
但是他們的apis不支持座標數組right .. – Subramanian