The MKTileOverlay class implements an overlay that is optimized for covering an area of the map using individual bitmap tiles. (In general, a map tile is a prerendered map image that covers a specific geographic area.) You can use tile overlay objects to represent your own tile-based content and to coordinate the display of that content in a map view. Your tiles can supplement the underlying map content or replace it completely. A tile overlay object coordinates the loading and management of the tiles while a corresponding MKTileOverlayRenderer object handles the actual drawing of the tiles on the map.


You can use a single tile overlay object to represent all of the tiles at one or more zoom levels of the map. The default tile overlay object uses a template string to build URLs so that it can locate the map tiles it needs. Each URL incorporates the x and y index of the map tile, the zoom level it is intended for, and the scale factor corresponding to the screen resolution on which to display the tile. The default class lets you specify map tiles whose indexes start in either the upper-left corner or lower-left corner of the map. If you use a different indexing scheme for your tiles, you can also subclass and override the url(forTilePath:) or loadTile(at:result:) methods to map between the requested tile and your custom indexing scheme.


Initializing a Tile Overlay

init(urlTemplate: String?)

Initializes and returns a tile overlay object using the specified tile-access template.

Accessing the Tile Attributes

var tileSize: CGSize

The size (in pixels) of your tile images.

var isGeometryFlipped: Bool

A Boolean value that indicates the orientation of tile indexes along the y axis.

var minimumZ: Int

The minimum zoom level supported by the tiles of this overlay object.

var maximumZ: Int

The maximum zoom level supported by the tiles of this overlay object.

var canReplaceMapContent: Bool

A Boolean value that indicates whether the tile content is fully opaque.

Customizing the Loading of Tiles

var urlTemplate: String?

The template for generating tile image URLs.

func url(forTilePath: MKTileOverlayPath)

Returns the URL to use to access the specified tile.



Use this structure to specify the index values for a single tile.


Inherits From