MGLTileSet

@interface MGLTileSet : NSObject

The MGLTileSet class holds the tile URL template strings and associated configuration for those strings. It can be passed to an MGLVectorSource or MGLRasterSource instead of an NSURL representing a TileJSON URL to create a source.

  • An NSArray of NSString objects that represent the tile templates.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic)
        NSArray<NSString *> *_Nonnull tileURLTemplates;

    Swift

    var tileURLTemplates: [String] { get set }
  • An NSNumber object containing an integer; specifies the minimum zoom level at which the source will display tiles. The value should be in the range of 0 to 22. The default value is 0 and the source will use the default value if minimumZoomLevel is nil.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable) NSNumber *minimumZoomLevel;

    Swift

    var minimumZoomLevel: NSNumber? { get set }
  • An NSNumber object containing an integer; specifies the maximum zoom level at which to display tiles. The value should be in the range of 0 to 22 and greater than minimumZoomLevel. The default value is 22 and the source will use the default value if maximumZoomLevel is nil.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic, nullable) NSNumber *maximumZoomLevel;

    Swift

    var maximumZoomLevel: NSNumber? { get set }
  • An NSString object that contains an attribution to be displayed when the map is shown to a user. The default value is nil.

    Declaration

    Objective-C

    @property (readwrite, copy, nonatomic, nullable) NSString *attribution;

    Swift

    var attribution: String? { get set }
  • An MGLTileSetScheme value that contains an enumeration (either MGLTileSetSchemeXYZ or MGLTileSetSchemeTMS) that influences the y direction of the tile coordinates. The default is MGLTileSetSchemeXYZ.

    Declaration

    Objective-C

    @property (assign, readwrite, nonatomic) MGLTileSetScheme scheme;

    Swift

    var scheme: MGLTileSetScheme { get set }
  • Initializes and returns a new tile set object.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithTileURLTemplates:
        (nonnull NSArray<NSString *> *)tileURLTemplates;

    Swift

    init(tileURLTemplates: [String])

    Parameters

    tileURLTemplates

    An NSArray of NSString objects that represent the tile templates.

    Return Value

    The initialized tile set object.

  • Initializes and returns a new tile set object.

    Declaration

    Objective-C

    - (nonnull instancetype)initWithTileURLTemplates:
                                (nonnull NSArray<NSString *> *)tileURLTemplates
                                    minimumZoomLevel:(NSUInteger)minimumZoomLevel
                                    maximumZoomLevel:(NSUInteger)maximumZoomLevel;

    Swift

    init(tileURLTemplates: [String], minimumZoomLevel: UInt, maximumZoomLevel: UInt)

    Parameters

    tileURLTemplates

    An NSArray of NSString objects that represent the tile templates.

    minimumZoomLevel

    An NSUInteger; specifies the minimum zoom level at which to display tiles.

    maximumZoomLevel

    An NSUInteger; specifies the maximum zoom level at which to display tiles.

    Return Value

    The initialized tile set object.