#import #import "MGLPolyline.h" #import "MGLPolygon.h" #import "MGLPointAnnotation.h" #import "MGLShapeCollection.h" NS_ASSUME_NONNULL_BEGIN /** The `MGLFeature` protocol is used to provide details about geographic features contained in a map view’s tile sources. Each concrete subclass of `MGLShape` in turn has a subclass that conforms to this protocol. Typically, you do not create feature objects yourself but rather obtain them using `-[MGLMapView visibleFeaturesAtPoint:]` and related methods. Each feature object associates a shape with an identifier and attributes as specified by the source. Like ordinary `MGLAnnotation` objects, some kinds of `MGLFeature` objects can also be added to a map view using `-[MGLMapView addAnnotations:]` and related methods. */ @protocol MGLFeature /** An object that uniquely identifies the feature in its containing tile source. The identifier corresponds to the feature identifier (`id`) in the tile source. If the source does not specify the feature’s identifier, the value of this property is `nil`. If specified, the identifier may be an integer, floating-point number, or string. These data types are mapped to instances of the following Foundation classes:
In the tile sourceThis property
Integer NSNumber (use the unsignedLongLongValue or longLongValue property)
Floating-point number NSNumber (use the doubleValue property)
String NSString
For details about the identifiers used in most Mapbox-provided styles, consult the Mapbox Streets layer reference. */ @property (nonatomic, copy, nullable, readonly) id identifier; /** A dictionary of attributes for this feature specified by the tile source. The keys and values of this dictionary are determined by the tile source. In the tile source, each attribute name is a string, while each attribute value may be a null value, Boolean value, integer, floating-point number, or string. These data types are mapped to instances of the following Foundation classes:
In the tile sourceIn this dictionary
Null NSNull
Boolean NSNumber (use the boolValue property)
Integer NSNumber (use the unsignedLongLongValue or longLongValue property)
Floating-point number NSNumber (use the doubleValue property)
String NSString
For details about the attribute names and values found in Mapbox-provided vector tile sources, consult the Mapbox Streets and Mapbox Terrain layer references. */ @property (nonatomic, copy, readonly) NS_DICTIONARY_OF(NSString *, id) *attributes; /** Returns the feature attribute for the given attribute name. See the `attributes` property’s documentation for details on keys and values associated with this method. */ - (nullable id)attributeForKey:(NSString *)key; @end /** The `MGLPointFeature` class represents a point in a tile source. */ @interface MGLPointFeature : MGLPointAnnotation @end /** The `MGLPolylineFeature` class represents a polyline in a tile source. */ @interface MGLPolylineFeature : MGLPolyline @end /** The `MGLPolygonFeature` class represents a polygon in a tile source. */ @interface MGLPolygonFeature : MGLPolygon @end /** The `MGLMultiPointFeature` class represents a multipoint in a tile source. */ @interface MGLMultiPointFeature : MGLMultiPoint @end /** The `MGLMultiPolylineFeature` class represents a multipolyline in a tile source. */ @interface MGLMultiPolylineFeature : MGLMultiPolyline @end /** The `MGLMultiPolygonFeature` class represents a multipolygon in a tile source. */ @interface MGLMultiPolygonFeature : MGLMultiPolygon @end /** The `MGLShapeCollectionFeature` class represents a shape collection in a tile source. */ @interface MGLShapeCollectionFeature : MGLShapeCollection @end NS_ASSUME_NONNULL_END