0
我有點困惑,可能是XCode提示我應該爲MKPolygon提供第三個參數,或者當我在第三個參數時只有2個參數。我確信在格式化過程中它是一些小而愚蠢的東西,但是從座標陣列創建MKPolygon的最佳方法的任何幫助都將非常棒!無法使用MKPolygon或polygonWithCoordinates(Swift)
// receive array of coordinates and update polygon of quarantine
func updateQuarantine(coords:[CLLocationCoordinate2D]) {
let polyLine:MKPolygon = MKPolygon(coordinates: &coords, count: coords.count)
self.mapView.addOverlay(polyLine)
self.mapView.removeOverlay(quarantinePolygon)
quarantinePolygon = polyLine
}