diff options
author | Nadia Barbosa <captainbarbosa@users.noreply.github.com> | 2017-08-07 15:06:13 -0400 |
---|---|---|
committer | Nadia Barbosa <captainbarbosa@users.noreply.github.com> | 2017-08-09 10:12:16 -0400 |
commit | 2e24562ee8d2c0ca43fa5eab4170222e544e1d26 (patch) | |
tree | 4e0ab6ac32d0e0a7f27cbb7f41b8fd06b3224cf3 /platform/darwin | |
parent | 1394bfb554c5daa5d2384d960c9118e880a30480 (diff) | |
download | qtlocation-mapboxgl-2e24562ee8d2c0ca43fa5eab4170222e544e1d26.tar.gz |
[ios] Update MGLPolyline docs about antimeridian crossings
Diffstat (limited to 'platform/darwin')
-rw-r--r-- | platform/darwin/src/MGLPolyline.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/platform/darwin/src/MGLPolyline.h b/platform/darwin/src/MGLPolyline.h index b3db0fd39f..079a1c617d 100644 --- a/platform/darwin/src/MGLPolyline.h +++ b/platform/darwin/src/MGLPolyline.h @@ -33,8 +33,19 @@ NS_ASSUME_NONNULL_BEGIN `MGLPolygon` object. To group multiple polylines together in one shape, use an `MGLMultiPolyline` or `MGLShapeCollection` object. - To make the polyline straddle the antimeridian, specify some longitudes less - than −180 degrees or greater than 180 degrees. + To make the polyline go across the antimeridian or international date line, + specify some longitudes less than −180 degrees or greater than 180 degrees. + For example, a polyline that stretches from Tokyo to San Francisco would have + coordinates of (35.68476, -220.24257) and (37.78428, -122.41310). + + ```swift + let coordinates = [ + CLLocationCoordinate2D(latitude: 35.68476, longitude: -220.24257), + CLLocationCoordinate2D(latitude: 37.78428, longitude: -122.41310) + ] + + let polyline = MGLPolyline(coordinates: &coordinates, count: UInt(coordinates.count)) +``` A polyline is known as a <a href="https://tools.ietf.org/html/rfc7946#section-3.1.4">LineString</a> |