ArcGIS Tiled Map Service Layer

An ArcGIS Tiled Map Service layer displays map content from an ArcGIS Server Map service which has been cached (tiled). A cached map service contains pre-generated map tiles. The number and content of these map tiles is defined by the service's tiling scheme and the map document that the service is based upon. The tiling scheme essentially specifies parameters such as tile dimensions, image format, scale levels, etc. 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 re-projected 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 Single Fused Map Cache property in the Services Directory is set to true. AGSTiledMapServiceLayer will not work with map services that are not cached.

NSURL* url = [NSURL URLWithString: @" http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/ESRI_LandBase_WebMercator/MapServer"]; 
AGSTiledMapServiceLayer* layer = [AGSTiledMapServiceLayer tiledMapServiceLayerWithURL: 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){
  NSLog(@"Tiling Scheme: %@", layer.tileInfo);
}

Unlike with 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 which does not create map images on-the-fly like a dynamic Map Service.

9/14/2011