diff options
author | Jesse Bounds <jesse@rebounds.net> | 2017-01-11 16:05:38 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-11 16:05:38 -0800 |
commit | 6ad47cfbad038ee8330fece5da7438d084e67a68 (patch) | |
tree | 98aa48e9c2562791a310c30e5d107c4221f99c1e /platform/darwin/test/MGLDocumentationExampleTests.swift | |
parent | 4332b3b9539e1c059b18c77ef6c0a9e6af44fe84 (diff) | |
download | qtlocation-mapboxgl-6ad47cfbad038ee8330fece5da7438d084e67a68.tar.gz |
[ios, macos] Add convenience initializers to shape source (#7665)
This adds two new convenience initializers to MGLShapeSource:
-initWithIdentifier:features:options: takes an array of shape objects
that conform to MGLFeature, inserts them in a shape collection feature
and creates a source with that shape. -initWithIdentifier:shapes:options
does the same but with concrete MGLShape objects that get added to
a shape collection.
Throw an exception if an shape source is created with the features
initializer but is sent an array of features that contains something
that is not actually an object that conforms to the feature protocol.
Updates to geojson data guide
Qualify APIs that take arrays of shapes that are features
Diffstat (limited to 'platform/darwin/test/MGLDocumentationExampleTests.swift')
-rw-r--r-- | platform/darwin/test/MGLDocumentationExampleTests.swift | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/platform/darwin/test/MGLDocumentationExampleTests.swift b/platform/darwin/test/MGLDocumentationExampleTests.swift index 5f0e83b2ca..d796b4e708 100644 --- a/platform/darwin/test/MGLDocumentationExampleTests.swift +++ b/platform/darwin/test/MGLDocumentationExampleTests.swift @@ -66,8 +66,7 @@ class MGLDocumentationExampleTests: XCTestCase, MGLMapViewDelegate { CLLocationCoordinate2D(latitude: 38.91, longitude: -77.04), ] let polyline = MGLPolylineFeature(coordinates: &coordinates, count: UInt(coordinates.count)) - let shape = MGLShapeCollectionFeature(shapes: [polyline]) - let source = MGLShapeSource(identifier: "lines", shape: shape, options: nil) + let source = MGLShapeSource(identifier: "lines", features: [polyline], options: nil) mapView.style?.addSource(source) //#-end-example-code |