getCoordinates(_:range:)
Retrieves one or more points associated with the shape and converts them to coordinate values.
Declaration
func getCoordinates(_ coords: UnsafeMutablePointer<CLLocationCoordinate2D>, range: NSRange)Parameters
- coords:
On input, provide a C array of structures large enough to hold the desired number of coordinates. On output, this structure contains the requested coordinate data.
- range:
The range of points you want. The
locationfield indicates the first point you’re requesting, with0being the first point,1being the second point, and so on. Thelengthfield indicates the number of points you want. The array incoordsneeds to be large enough to accommodate the number of requested coordinates.
Discussion
This method converts the map points into coordinates before returning them to you. If you want to specify the value of each point as a map point, you can access the values directly using the points() method.