diff options
author | Minh Nguyễn <mxn@1ec5.org> | 2017-03-13 17:45:37 -0700 |
---|---|---|
committer | Minh Nguyễn <mxn@1ec5.org> | 2017-03-14 14:42:57 -0700 |
commit | 4430e656036caa6e2d9523222f0c6c630200fa45 (patch) | |
tree | 5c3a9946c568a9a8c46696a2e3bffb4c4bade976 /platform/darwin/src/MGLShapeSource.h | |
parent | 7a13bee72e7c31185219dc0e1fb97b80a155ca11 (diff) | |
download | qtlocation-mapboxgl-4430e656036caa6e2d9523222f0c6c630200fa45.tar.gz |
[ios, macos] Expanded feature querying documentation
Also fixed a couple incorrect Swift method names on macOS.
Diffstat (limited to 'platform/darwin/src/MGLShapeSource.h')
-rw-r--r-- | platform/darwin/src/MGLShapeSource.h | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/platform/darwin/src/MGLShapeSource.h b/platform/darwin/src/MGLShapeSource.h index 07045490bd..d0097f748e 100644 --- a/platform/darwin/src/MGLShapeSource.h +++ b/platform/darwin/src/MGLShapeSource.h @@ -211,18 +211,32 @@ MGL_EXPORT @property (nonatomic, copy, nullable) NSURL *URL; /** - Returns an array of map features for this source, filtered by the given predicate. + Returns an array of map features for this source, filtered by the given + predicate. Each object in the returned array represents a feature for the current style - and provides access to attributes specified by the source + and provides access to attributes specified via the `shape` property. Features come from tiled GeoJSON data that is converted to tiles internally, so feature geometries are clipped at tile boundaries and features - may appear duplicated across tiles. - - @param predicate A predicate to filter the returned features. + may appear duplicated across tiles. For example, suppose this source contains a + long polyline representing a road. The resulting array includes those parts of + the road that lie within the map tiles that the source has loaded, even if the + road extends into other tiles. The portion of the road within each map tile is + included individually. + + Returned features may not necessarily be visible to the user at the time they + are loaded: the style may lack a layer that draws the features in question. To + obtain only _visible_ features, use the + `-[MGLMapView visibleFeaturesAtPoint:inStyleLayersWithIdentifiers:predicate:]` + or + `-[MGLMapView visibleFeaturesInRect:inStyleLayersWithIdentifiers:predicate:]` + method. + + @param predicate A predicate to filter the returned features. Use `nil` to + include all features in the source. @return An array of objects conforming to the `MGLFeature` protocol that - represent features in the sources used by the current style. + represent features in the source that match the predicate. */ - (NS_ARRAY_OF(id <MGLFeature>) *)featuresMatchingPredicate:(nullable NSPredicate *)predicate; |