背景:
我需要使一个区域的MKPolyline覆盖。区域应该和GPS轨迹一样大。
问题:
我不能使用showAnnotations,因为它是覆盖的,而不是注释:
mapView.showAnnotations(mapView.annotations, animated: true)如何在使用MKPolyline的情况下实现相同的结果
发布于 2015-11-04 15:31:29
这是我的解决方案:
var points:[CLLocationCoordinate2D] = self.track.getCLLocationCoordinate2D()
let polylines = MKPolyline(coordinates: &points, count: points.count)
let rect = MKCoordinateRegionForMapRect(polylines.boundingMapRect)
self.trackMapView.addOverlay(polylines)
self.trackMapView.setRegion(rect, animated: true)https://stackoverflow.com/questions/33515888
复制相似问题