MGLSource

@interface MGLSource : NSObject

A source supplies data to be shown on the map. Sources don’t contain styling details like color or width. Use subclasses of MGLStyleLayer to give visual representation to sources.

You should use the concrete subclasses of MGLSource to create vector, raster, GeoJSON, and other source types.

  • Returns a source initialized with an identifier.

    After initializing and configuring the source, add it to a map view’s style using the -[MGLStyle addSource:] method.

    Declaration

    Objective-C

    - (instancetype)initWithIdentifier:(NSString *)identifier;

    Swift

    init!(identifier: String!)

    Parameters

    identifier

    A string that uniquely identifies the source in the style to which it is added.

    Return Value

    An initialized source.

  • A string that uniquely identifies the source in the style to which it is added.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic) NSString *identifier;

    Swift

    var identifier: String! { get set }