杨锴
2025-06-04 ac84f81ca2311300b431c1bfb9f71253b59073f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// MKMultiPointExtensions.swift - Copyright 2023 SwifterSwift
 
#if canImport(MapKit) && !os(watchOS)
import MapKit
 
// MARK: - Properties
 
public extension MKMultiPoint {
    /// SwifterSwift: Return an Array of coordinates representing the provided multi point.
    var coordinates: [CLLocationCoordinate2D] {
        var coords = [CLLocationCoordinate2D](repeating: kCLLocationCoordinate2DInvalid, count: pointCount)
        getCoordinates(&coords, range: NSRange(location: 0, length: pointCount))
        return coords
    }
}
 
#endif