DingiFeatureprotocol is used to provide details about geographic features contained in an
DingiVectorTileSourceobject. Each concrete subclass of
MGLShapein turn has a subclass that conforms to this protocol. A feature object associates a shape with an optional identifier and attributes.
You can add custom data to display on the map by creating feature objects and adding them to an
-[DingiShapeSource initWithIdentifier:shape:options:]method or
In addition to adding data to the map, you can also extract data from the map:
-[DingiMapView visibleFeaturesAtPoint:]and related methods return feature objects that correspond to features in the source. This enables you to inspect the properties of features in vector tiles loaded by
DingiVectorTileSourceobjects. You also reuse these feature objects as overlay annotations.
While it is possible to add
DingiFeature-conforming objects to the map as annotations using
-[DingiMapView addAnnotations:]and related methods, doing so has trade-offs:
Features added as annotations will not have
attributesproperties when used with feature querying.
Features added as annotations become interactive. Taps and selection can be handled in
DingiPolylineFeatureobject associates a polyline shape with an optional identifier and attributes.
A polyline feature is known as a LineString feature in GeoJSON.
DingiMultiPolylineFeatureobject associates a multipolyline shape with an optional identifier and attributes.
A multipolyline feature is known as a MultiLineString feature in GeoJSON.
DingiPointCollectionFeatureobject associates a point collection with an optional identifier and attributes.
A point collection feature is known as a MultiPoint feature in GeoJSON.
DingiShapeCollectionFeatureobject associates a shape collection with an optional identifier and attributes.
DingiShapeCollectionFeatureis most commonly used to add multiple shapes to a single
DingiShapeSource. Configure the appearance of an
DingiSource’s shape collection collectively using an
DingiSymbolStyleLayerobject, or use multiple instances of
DingiLineStyleLayerto configure the appearance of each kind of shape inside the collection.
A shape collection feature is known as a feature collection in GeoJSON.