MGLComputedShapeSource


@interface MGLComputedShapeSource : MGLSource

MGLComputedShapeSource is a map content source that supplies vector shapes, one tile at a time, to be shown on the map on demand. You implement a class conforming to the MGLComputedShapeSourceDataSource protocol that returns instances of MGLShape or MGLFeature, then add a computed shape source to an MGLStyle object along with an MGLVectorStyleLayer object. The vector style layer defines the appearance of any content supplied by the computed shape source.

MGLComputedShapeSource is similar to MGLShapeSource but is optimized for data sets that change dynamically or are too large to fit completely in memory. It is also useful for data that is divided into tiles in a format other than Mapbox Vector Tiles. For GeoJSON data, use the MGLShapeSource class. For static tiles or Mapbox Vector Tiles, use the MGLVectorTileSource class.

You can add and remove sources dynamically using methods such as -[MGLStyle addSource:] and -[MGLStyle sourceWithIdentifier:]. This class cannot be represented in a style JSON file; you must add it ot the style at runtime.