summaryrefslogtreecommitdiff
path: root/platform/darwin/docs/guides
diff options
context:
space:
mode:
authorJesse Bounds <jesse@rebounds.net>2017-01-11 16:05:38 -0800
committerGitHub <noreply@github.com>2017-01-11 16:05:38 -0800
commit6ad47cfbad038ee8330fece5da7438d084e67a68 (patch)
tree98aa48e9c2562791a310c30e5d107c4221f99c1e /platform/darwin/docs/guides
parent4332b3b9539e1c059b18c77ef6c0a9e6af44fe84 (diff)
downloadqtlocation-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/docs/guides')
-rw-r--r--platform/darwin/docs/guides/Working with GeoJSON Data.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/darwin/docs/guides/Working with GeoJSON Data.md b/platform/darwin/docs/guides/Working with GeoJSON Data.md
index 0fffed06dd..adaf053e41 100644
--- a/platform/darwin/docs/guides/Working with GeoJSON Data.md
+++ b/platform/darwin/docs/guides/Working with GeoJSON Data.md
@@ -36,6 +36,16 @@ resulting shape or feature object into the
the map, or you can use the object and its properties to power non-map-related
functionality in your application.
+To include multiple shapes in the source, create and pass an `MGLShapeCollection` or
+ `MGLShapeCollectionFeature` object to
+ `-[MGLShapeSource initWithIdentifier:shape:options:]`. Alternatively, use the
+ `-[MGLShapeSource initWithIdentifier:features:options:]` or
+ `-[MGLShapeSource initWithIdentifier:shapes:options:]` method to create a shape source
+ with an array. `-[MGLShapeSource initWithIdentifier:features:options:]` accepts only `MGLFeature`
+ instances, such as `MGLPointFeature` objects, whose attributes you can use when
+ applying a predicate to `MGLVectorStyleLayer` or configuring a style layer’s
+ appearance.
+
## Extracting GeoJSON data from the map
Any `MGLShape`, `MGLFeature`, or `MGLShapeCollectionFeature` object has an