A class representing a collection of all features of the same GMSFeatureType, whose style can
be overridden on the client. Each GMSFeatureType will have one corresponding GMSFeatureLayer.
Determines if the data-driven GMSFeatureLayer is available. Data-driven styling requires
the Metal Framework, a valid map ID and that the feature type be applied.
If NO, styling for the GMSFeatureLayer returns to the default and events are not triggered.
Styling block to be applied to all features in this layer.
The style block is applied to all visible features in the viewport when the setter is called, and
is run multiple times for the subsequent features entering the viewport.
The function is required to be deterministic and return consistent results when it is applied
over the map tiles. If any styling specs of any feature would be changed, style must be set
again. Changing behavior of the style block without calling the style setter will result in
undefined behavior, including stale and/or shattered map renderings. See the example below:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-11-15 UTC."],[[["\u003cp\u003e\u003ccode\u003eGMSFeatureLayer\u003c/code\u003e represents a collection of features with the same type, allowing for client-side style overrides.\u003c/p\u003e\n"],["\u003cp\u003eEach feature type has a corresponding \u003ccode\u003eGMSFeatureLayer\u003c/code\u003e to manage its features.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003estyle\u003c/code\u003e property enables applying custom styling to all features within the layer using a block.\u003c/p\u003e\n"],["\u003cp\u003eData-driven styling requires the Metal Framework, a valid map ID, and an applicable feature type, indicated by the \u003ccode\u003eavailable\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eWhile the \u003ccode\u003einitWithFeatureType\u003c/code\u003e initializer exists for testing purposes, production instances should be created by the SDK.\u003c/p\u003e\n"]]],["`GMSFeatureLayer` represents a collection of features of the same `GMSFeatureType`, allowing client-side style overrides. Key actions involve setting the `featureType`, checking if the layer is `available` for data-driven styling, and setting a `style` block to customize feature appearances. Styling changes require resetting the `style`. A unit test constructor `initWithFeatureType` is provided; production instances are managed by the SDK. The `init` method is unavailable.\n"],null,["GMSFeatureLayer \n\n\n @interface GMSFeatureLayer\u003c__covariant T : id \u003c../Protocols/GMSFeature.html\u003e\u003e : NSObject\n\nA class representing a collection of all features of the same [GMSFeatureType](../Type-Definitions/GMSFeatureType.html), whose style can\nbe overridden on the client. Each [GMSFeatureType](../Type-Definitions/GMSFeatureType.html) will have one corresponding `GMSFeatureLayer`.\n- `\n ``\n ``\n `\n\n [featureType](#/c:objc(cs)GMSFeatureLayer(py)featureType)`\n ` \n The feature type associated with this layer. All features associated with the layer will be of\n this type. \n\n Declaration \n Swift \n\n var featureType: FeatureType { get }\n\n Objective-C \n\n @property (nonatomic, readonly) ../Type-Definitions/GMSFeatureType.html _Nonnull featureType;\n\n- `\n ``\n ``\n `\n\n [available](#/c:objc(cs)GMSFeatureLayer(py)available)`\n ` \n Determines if the data-driven `GMSFeatureLayer` is available. Data-driven styling requires\n the Metal Framework, a valid map ID and that the feature type be applied.\n If `NO`, styling for the `GMSFeatureLayer` returns to the default and events are not triggered. \n\n Declaration \n Swift \n\n var isAvailable: Bool { get }\n\n Objective-C \n\n @property (nonatomic, readonly, getter=isAvailable) BOOL available;\n\n- `\n ``\n ``\n `\n\n [style](#/c:objc(cs)GMSFeatureLayer(py)style)`\n ` \n Styling block to be applied to all features in this layer.\n\n The style block is applied to all visible features in the viewport when the setter is called, and\n is run multiple times for the subsequent features entering the viewport.\n\n The function is required to be deterministic and return consistent results when it is applied\n over the map tiles. If any styling specs of any feature would be changed, `style` must be set\n again. Changing behavior of the style block without calling the `style` setter will result in\n undefined behavior, including stale and/or shattered map renderings. See the example below: \n\n var selectedPlaceIDs = Set\u003cString\u003e()\n var style = FeatureStyle(fill: .red, stroke: .clear, strokeWidth: 0)\n layer.style = { feature in\n selectedPlaceIDs.contains(feature.placeID) ? style : nil\n }\n\n\n selectedPlaceIDs.insert(\"foo\")\n\n style = FeatureStyle(fill: .clear, stroke: .blue, strokeWidth: 1.5)\n\n\n layer.style = { feature in\n selectedPlaceIDs.contains(feature.placeID) ? style : nil\n }\n\n Declaration \n Swift \n\n var style: ((T) -\u003e FeatureStyle?)? { get set }\n\n Objective-C \n\n @property (nonatomic, nullable) ../Classes/GMSFeatureStyle.html *_Nullable (^)(T _Nonnull) style;\n\n- `\n ``\n ``\n `\n\n [-initWithFeatureType:](#/c:objc(cs)GMSFeatureLayer(im)initWithFeatureType:)`\n ` \n Create a feature layer instance for testing.\n\n This method should be used for your unit tests only. In production, `GMSFeatureLayer` instances\n should only be created by the SDK. \n\n Declaration \n Swift \n\n convenience init(featureType: FeatureType)\n\n Objective-C \n\n - (nonnull instancetype)initWithFeatureType:(nonnull ../Type-Definitions/GMSFeatureType.html)featureType;\n\n- `\n ``\n ``\n `\n\n [-init](#/c:objc(cs)GMSFeatureLayer(im)init)`\n ` \n Unavailable \n\n Declaration \n Objective-C \n\n - (instancetype)init NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE;"]]