let latitude = NSUserDefaults.standardUserDefaults().doubleForKey(klat)
let longitude = NSUserDefaults.standardUserDefaults().doubleForKey(klong)
let location = CLLocationCoordinate2DMake(latitude, longitude)
// Second Location lat and long
let latitudeSec: CLLocationDegrees = 10.0100
let longitudeSec: CLLocationDegrees = 76.3620
let locationSec = CLLocationCoordinate2DMake(latitudeSec, longitudeSec)
let span = MKCoordinateSpanMake(1, 1)
let region = MKCoordinateRegionMake(location, span)
mapView.setRegion(region, animated: true)
我有两个位置(lat和long),带有两个注释。我需要知道如何在MKMap上绘制这两个语音之间的界限吗?
答案 0 :(得分:-2)
如果你有两个注释'坐标然后只需将新的MKPolyline添加到地图视图中。你可以通过谷歌搜索找到几个这样的例子。