我试图在我的应用中使用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