From 4430e656036caa6e2d9523222f0c6c630200fa45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguye=CC=82=CC=83n?= Date: Mon, 13 Mar 2017 17:45:37 -0700 Subject: [ios, macos] Expanded feature querying documentation Also fixed a couple incorrect Swift method names on macOS. --- platform/ios/src/MGLMapView.h | 76 +++++++++++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 28 deletions(-) (limited to 'platform/ios') diff --git a/platform/ios/src/MGLMapView.h b/platform/ios/src/MGLMapView.h index 063818dc6e..4872ff2448 100644 --- a/platform/ios/src/MGLMapView.h +++ b/platform/ios/src/MGLMapView.h @@ -1171,10 +1171,11 @@ IB_DESIGNABLE Returns an array of rendered map features that intersect with a given point, restricted to the given style layers. - This method may return all features from the specified layers. To filter - the returned features, use the - `-visibleFeaturesAtPoint:inStyleLayersWithIdentifiers:predicate:` method. For more - information about searching for map features, see that method’s documentation. + This method returns all the intersecting features from the specified layers. To + filter the returned features, use the + `-visibleFeaturesAtPoint:inStyleLayersWithIdentifiers:predicate:` method. For + more information about searching for map features, see that method’s + documentation. @param point A point expressed in the map view’s coordinate system. @param styleLayerIdentifiers A set of strings that correspond to the names @@ -1187,17 +1188,17 @@ IB_DESIGNABLE /** Returns an array of rendered map features that intersect with a given point, - restricted to the given style layers and filtered by the given - predicate. + restricted to the given style layers and filtered by the given predicate. Each object in the returned array represents a feature rendered by the - current style and provides access to attributes specified by the relevant - tile sources. - The returned array includes features specified in vector and GeoJSON tile - sources but does not include anything from raster, image, or video sources. - - Only visible features are returned. For example, suppose the current style uses - the + current style and provides access to attributes specified by the relevant map + content sources. The returned array includes features loaded by + `MGLShapeSource` and `MGLVectorSource` objects but does not include anything + from `MGLRasterSource` objects, or from image, video, or canvas sources, which + are unsupported by this SDK. + + The returned features are drawn by a style layer in the current style. For + example, suppose the current style uses the Mapbox Streets source, but none of the specified style layers includes features that have the `maki` property set to `bus`. If you pass a point corresponding to the location of a @@ -1224,13 +1225,18 @@ IB_DESIGNABLE To find out the layer names in a particular style, view the style in Mapbox Studio. + Only visible features are returned. To obtain features regardless of + visibility, use the + `-[MGLVectorSource featuresInSourceLayersWithIdentifiers:predicate:]` and + `-[MGLShapeSource featuresMatchingPredicate:]` methods on the relevant sources. + @note Layer identifiers are not guaranteed to exist across styles or different - versions of the same style. Applications that use this API must first set the - style URL to an explicitly versioned style using a convenience method like - `+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL” + versions of the same style. Applications that use this API must first set + the style URL to an explicitly versioned style using a convenience method + like `+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL” inspectable in Interface Builder, or a manually constructed `NSURL`. This - approach also avoids layer identifer name changes that will occur in the default - style’s layers over time. + approach also avoids layer identifer name changes that will occur in the + default style’s layers over time. @param point A point expressed in the map view’s coordinate system. @param styleLayerIdentifiers A set of strings that correspond to the names of @@ -1261,9 +1267,9 @@ IB_DESIGNABLE Returns an array of rendered map features that intersect with the given rectangle, restricted to the given style layers. - This method may return all features from the specified layers. To filter - the returned features, use the - `-visibleFeaturesAtPoint:inStyleLayersWithIdentifiers:predicate:` method. For + This method returns all the intersecting features from the specified layers. To + filter the returned features, use the + `-visibleFeaturesAtPoint:inStyleLayersWithIdentifiers:predicate:` method. For more information about searching for map features, see that method’s documentation. @@ -1282,13 +1288,14 @@ IB_DESIGNABLE predicate. Each object in the returned array represents a feature rendered by the - current style and provides access to attributes specified by the relevant - tile sources. - The returned array includes features specified in vector and GeoJSON tile - sources but does not include anything from raster, image, or video sources. - - Only visible features are returned. For example, suppose the current style uses - the + current style and provides access to attributes specified by the relevant map + content sources. The returned array includes features loaded by + `MGLShapeSource` and `MGLVectorSource` objects but does not include anything + from `MGLRasterSource` objects, or from image, video, or canvas sources, which + are unsupported by this SDK. + + The returned features are drawn by a style layer in the current style. For + example, suppose the current style uses the Mapbox Streets source, but none of the specified style layers includes features that have the `maki` property set to `bus`. If you pass a rectangle containing the location of a bus @@ -1316,6 +1323,11 @@ IB_DESIGNABLE To find out the layer names in a particular style, view the style in Mapbox Studio. + Only visible features are returned. To obtain features regardless of + visibility, use the + `-[MGLVectorSource featuresInSourceLayersWithIdentifiers:predicate:]` and + `-[MGLShapeSource featuresMatchingPredicate:]` methods on the relevant sources. + @note Layer identifiers are not guaranteed to exist across styles or different versions of the same style. Applications that use this API must first set the style URL to an explicitly versioned style using a convenience method like @@ -1324,6 +1336,14 @@ IB_DESIGNABLE approach also avoids layer identifer name changes that will occur in the default style’s layers over time. + @note Layer identifiers are not guaranteed to exist across styles or different + versions of the same style. Applications that use this API must first set + the style URL to an explicitly versioned style using a convenience method + like `+[MGLStyle outdoorsStyleURLWithVersion:]`, `MGLMapView`’s “Style URL” + inspectable in Interface Builder, or a manually constructed `NSURL`. This + approach also avoids layer identifer name changes that will occur in the + default style’s layers over time. + @param rect A rectangle expressed in the map view’s coordinate system. @param styleLayerIdentifiers A set of strings that correspond to the names of layers defined in the current style. Only the features contained in these -- cgit v1.2.1