【发布时间】:2016-06-18 11:51:10
【问题描述】:
我想快速从谷歌地图获取方向。 在我的应用程序中,用户可以使用 LongTouch 制作两个标记,我想在标记之间显示方向,并且我还获得了每个标记的纬度和经度。 我是业余爱好者,找不到此代码。
func mapView(mapView: GMSMapView, didLongPressAtCoordinate coordinate: CLLocationCoordinate2D) {
if counterMarker < 2
{
counterMarker += 1
let marker = GMSMarker(position: coordinate)
marker.appearAnimation = kGMSMarkerAnimationPop
marker.map = mapView
marker.position.latitude = coordinate.latitude
marker.position.longitude = coordinate.longitude
latitudeMarker = marker.position.latitude
longitudeMarker = marker.position.longitude
print(latitudeMarker)
print(longitudeMarker)
print("ok")
}
}
如何使用谷歌地图获取方向和时间?
【问题讨论】:
标签: swift google-maps direction