Skip To Content ArcGIS for Developers Sign In Dashboard

ArcGIS Tiled Map Service layer

An ArcGIS Tiled Map Service layer displays map content from an ArcGIS Server Map service that has been cached (tiled). A cached map service contains pre-generated map tiles. The number and content of these map tiles are defined by the service's tiling scheme and the map document that the service is based on. The tiling scheme essentially specifies parameters such as tile dimensions, image format, scale levels, and so on. As you navigate the map, the layer fetches new map tiles to be displayed.

Unlike a dynamic layer, a tiled layer's spatial reference must match the map's spatial reference. This is necessary because tiled layers display map tiles that are pre-generated ahead of time and cannot be reprojected to match a different spatial reference.

To instantiate an AGSTiledMapServiceLayer, you need to provide a URL to a map service's REST web service endpoint. You should verify that the service is indeed cached by checking that the Single Fused Map Cache property in the Services Directory is set to true. AGSTiledMapServiceLayer will not work with map services that are not cached.

let url = NSURL(string: "")
let layer = AGSTiledMapServiceLayer(URL: url)

After creating the layer, you can add it to the map to display its contents. When the layer is ready, its loaded property will be enabled. You can then safely access its properties.

if layer.loaded {
 println("Tiling Scheme: \(layer.tileInfo)")

Unlike ArcGIS Dynamic Map Service layers, you cannot modify properties of an ArcGIS Tiled Map Service layer to alter map contents. This is because the layer relies on a cached Map service that does not create map images on the fly the way a dynamic Map Service does.