MGLTileSource


@interface MGLTileSource : MGLSource

MGLTileSource is a map content source that supplies map tiles to be shown on the map. The location of and metadata about the tiles are defined either by an option dictionary or by an external file that conforms to the TileJSON specification. A tile source is added to an MGLStyle object along with one or more MGLRasterStyleLayer or MGLVectorStyleLayer objects. Use a style layer to control the appearance of content supplied by the tile source.

A tile source is also known as a tile set. To learn about the structure of a Mapbox-hosted tile set, view it in Mapbox Studio’s Tilesets editor.

Create instances of MGLRasterTileSource and MGLVectorTileSource in order to use MGLTileSource‘s properties and methods. Do not create instances of MGLTileSource directly, and do not create your own subclasses of this class.

  • The URL to the TileJSON configuration file that specifies the contents of the source.

    If the receiver was initialized using -initWithIdentifier:tileURLTemplates:options, this property is set to nil.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly, nullable) NSURL *configurationURL;

    Swift

    var configurationURL: URL? { get }
  • An array of MGLAttributionInfo objects that define the attribution statements to be displayed when the map is shown to the user.

    By default, this array is empty. If the source is initialized with a configuration URL, this array is also empty until the configuration JSON file is loaded.

    Declaration

    Objective-C

    @property (nonatomic, copy, readonly)
        NSArray<MGLAttributionInfo *> *_Nonnull attributionInfos;

    Swift

    var attributionInfos: [MGLAttributionInfo] { get }