From 2e24562ee8d2c0ca43fa5eab4170222e544e1d26 Mon Sep 17 00:00:00 2001 From: Nadia Barbosa Date: Mon, 7 Aug 2017 15:06:13 -0400 Subject: [ios] Update MGLPolyline docs about antimeridian crossings --- platform/darwin/src/MGLPolyline.h | 15 +++++++++++++-- 1 file 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 LineString -- cgit v1.2.1