MLNRasterTileSource class
MLNRasterTileSource is a map content source that supplies raster image 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 raster tile source is added to an MLNStyle object along with one or more
MLNRasterStyleLayer objects. Use a raster style layer to control the
appearance of content supplied by the raster tile source.
Each
raster
source defined by the style JSON file is represented at runtime by an
MLNRasterTileSource object that you can use to initialize new style layers. You
can also add and remove sources dynamically using methods such as
MLNStyle/addSource: and MLNStyle/sourceWithIdentifier:.
Example
let source = MLNRasterTileSource(identifier: "clouds", tileURLTemplates:
["https://example.com/raster-tiles/{z}/{x}/{y}.png"], options: [ .minimumZoomLevel: 9,
.maximumZoomLevel: 16,
.tileSize: 512,
.attributionInfos: [
MLNAttributionInfo(title: NSAttributedString(string: "© Mapbox"), url: URL(string:
"https://mapbox.com"))
]
])
mapView.style?.addSource(source)
Related examples
TODO: Add raster imagery, learn how to add a MLNRasterStyleLayer
to your map using an MLNRasterTileSource.
- Inheritance
- 
    - Object
- MLNSource
- MLNTileSource
- MLNRasterTileSource
 
- Implementers
Constructors
- MLNRasterTileSource()
- 
          Returns a new instance of MLNRasterTileSource constructed with the default newmethod.factory
- MLNRasterTileSource.castFrom(ObjCObjectBase other)
- 
          Constructs a MLNRasterTileSource that points to the same underlying object as other.
- 
          MLNRasterTileSource.castFromPointer(Pointer<ObjCObject> other, {bool retain = false, bool release = false})
- Constructs a MLNRasterTileSource that wraps the given raw object pointer.
Properties
- attributionHTMLString → NSString?
- 
  The attribution HTML string associated with this source.
  no setterinherited
- attributionInfos → NSArray
- 
  An array of MLNAttributionInfoobjects that define the attribution statements to be displayed when the map is shown to the user.no setterinherited
- configurationURL → NSURL?
- 
  The URL to the TileJSON configuration file that specifies the contents of the
source.
  no setterinherited
- debugDescription$1 → NSString
- 
  debugDescription
  no setterinherited
- description$1 → NSString
- 
  description
  no setterinherited
- hash$1 → int
- 
  hash
  no setterinherited
- hashCode → int
- 
  The hash code for this object.
  no setterinherited
- identifier ↔ NSString
- 
  A string that uniquely identifies the source in the style to which it is added.
  getter/setter pairinherited
- isProxy → bool
- 
  isProxy
  no setterinherited
- ref → ObjCObjectRef
- 
  
  finalinherited
- runtimeType → Type
- 
  A representation of the runtime type of the object.
  no setterinherited
- superclass$1 → ObjCObjectBase
- 
  superclass
  no setterinherited
Methods
- 
  autorelease() → MLNRasterTileSource 
- 
  autorelease
  override
- 
  class$1() → ObjCObjectBase 
- 
  class
  inherited
- 
  conformsToProtocol$1(Protocol aProtocol) → bool 
- 
  conformsToProtocol:
  inherited
- 
  copy() → ObjCObjectBase 
- 
  copy
  inherited
- 
  dealloc() → void 
- 
  dealloc
  inherited
- 
  doesNotRecognizeSelector(Pointer< ObjCSelector> aSelector) → void
- 
  doesNotRecognizeSelector:
  inherited
- 
  forwardingTargetForSelector(Pointer< ObjCSelector> aSelector) → ObjCObjectBase
- 
  forwardingTargetForSelector:
  inherited
- 
  forwardInvocation(NSInvocation anInvocation) → void 
- 
  forwardInvocation:
  inherited
- 
  init() → MLNRasterTileSource 
- 
  init
  override
- 
  initWithIdentifier(NSString identifier, {required NSURL configurationURL}) → MLNRasterTileSource 
- Returns a raster tile source initialized with an identifier and configuration URL.
- 
  initWithIdentifier$1(NSString identifier, {required NSURL configurationURL, required double tileSize}) → MLNRasterTileSource 
- Returns a raster tile source initialized with an identifier, configuration URL, and tile size.
- 
  initWithIdentifier$2(NSString identifier, {required NSArray tileURLTemplates, NSDictionary? options}) → MLNRasterTileSource 
- Returns a raster tile source initialized an identifier, tile URL templates, and options.
- 
  initWithIdentifier_(NSString identifier) → MLNRasterTileSource 
- 
  Returns a source initialized with an identifier.
  override
- 
  isEqual(ObjCObjectBase object) → bool 
- 
  isEqual:
  inherited
- 
  isKindOfClass(ObjCObjectBase aClass) → bool 
- 
  isKindOfClass:
  inherited
- 
  isMemberOfClass(ObjCObjectBase aClass) → bool 
- 
  isMemberOfClass:
  inherited
- 
  methodForSelector(Pointer< ObjCSelector> aSelector) → Pointer<NativeFunction< Void Function()> >
- 
  methodForSelector:
  inherited
- 
  methodSignatureForSelector(Pointer< ObjCSelector> aSelector) → NSMethodSignature
- 
  methodSignatureForSelector:
  inherited
- 
  mutableCopy() → ObjCObjectBase 
- 
  mutableCopy
  inherited
- 
  noSuchMethod(Invocation invocation) → dynamic 
- 
  Invoked when a nonexistent method or property is accessed.
  inherited
- 
  performSelector(Pointer< ObjCSelector> aSelector) → ObjCObjectBase
- 
  performSelector:
  inherited
- 
  performSelector$1(Pointer< ObjCSelector> aSelector, {required ObjCObjectBase withObject}) → ObjCObjectBase
- 
  performSelector:withObject:
  inherited
- 
  performSelector$2(Pointer< ObjCSelector> aSelector, {required ObjCObjectBase withObject, required ObjCObjectBase withObject$1}) → ObjCObjectBase
- 
  performSelector:withObject:withObject:
  inherited
- 
  release() → void 
- 
  release
  inherited
- 
  respondsToSelector(Pointer< ObjCSelector> aSelector) → bool
- 
  respondsToSelector:
  inherited
- 
  retain() → MLNRasterTileSource 
- 
  retain
  override
- 
  retainCount() → int 
- 
  retainCount
  inherited
- 
  self$1() → MLNRasterTileSource 
- 
  self
  override
- 
  toString() → String 
- 
  A string representation of this object.
  inherited
- 
  zone() → Pointer< NSZone> 
- 
  zone
  inherited
Operators
- 
  operator ==(Object other) → bool 
- 
  The equality operator.
  inherited
Static Methods
- 
  alloc() → MLNRasterTileSource 
- 
  alloc
  override
- 
  allocWithZone(Pointer< NSZone> zone) → MLNRasterTileSource
- 
  allocWithZone:
  override
- 
  isInstance(ObjCObjectBase obj) → bool 
- 
  Returns whether objis an instance of MLNRasterTileSource.override
- 
  new$() → MLNRasterTileSource 
- 
  new
  override