Class: ArcGISTiledMapServiceLayer

Description

dojo.require("esri.layers.agstiled");

Allows you to work with a cached map service resource exposed by the ArcGIS Server REST API. A cached service accesses tiles from a cache instead of dynamically rendering images. For dynamic map services, see DynamicMapServiceLayer.

Samples

Search for samples that use this class.  

Class hierarchy

esri.layers.Layer
  |_ esri.layers.TiledMapServiceLayer
        |_ esri.layers.ArcGISTiledMapServiceLayer

Constructor

Constructor Description
esri.layers.ArcGISTiledMapServiceLayer(url, options?) Creates a new ArcGISTiledMapServiceLayer object. A URL is a required parameter. This layer also takes some optional parameters. These optional parameters can be included in any order.

Properties

Property Type Description
capabilities String Capabilities of the map service, possible values are Map, Query and Data. Only available if the map service is published using ArcGIS Server version 10 or greater.
copyright String Copyright string as defined by the map service.
description String Map description as defined by the map service.
layerInfos LayerInfo[] Returns the available layers in service and their default visibility.
timeInfo TimeInfo Temporal information for the layer, such as time extent. If this property is null or not specified, then the layer does not support time-related operations.
units String Default units of the layer as defined by the service. If the layer is the base map, the map is in these units.
version Number The version of ArcGIS Server where the map service is published. Examples are 9.3, 9.3.1, 10, 10.01.
Constructor Detail

esri.layers.ArcGISTiledMapServiceLayer(url, options?)

Creates a new ArcGISTiledMapServiceLayer object. A URL is a required parameter. This layer also takes some optional parameters. These optional parameters can be included in any order.
Parameters:
<String> url Required URL to the ArcGIS Server REST resource at represents a map service. An example is http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Portland/Portland_ESRI_LandBase_AGO/MapServer. For more information on constructing a URL, see The Services Directory and the REST API.
<Object> options Optional Optional parameters. See options list.
Options:
<Number> displayLevels Lists which levels to draw. (As of v1.2)

In the following example, assume you have two layers. The first layer is an ArcGIS Online Street Map layer, and you want to use only levels 0 through 7. You also have a second layer with more recent street data that you want to use for levels 8 through 12.
  var agoServiceURL = "http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer";
  var agoLayer = new esri.layers.ArcGISTiledMapServiceLayer(agoServiceURL, { displayLevels:[0,1,2,3,4,5,6,7]});
  map.addLayer(agoLayer);

  var myServiceURL = "http://myserver/ArcGIS/rest/services/myservice/MapServer";
  var myLayer = new esri.layers.ArcGISTiledMapServiceLayer(myServiceURL, { displayLevels:[8,9,10,11,12]});
  map.addLayer(myLayer);
<String> id Id to assign to the layer. If not assigned, esri.Map assigns value.
<Number> opacity Initial opacity or transparency of layer. Values range from 0.0 to 1.0, where 0.0 is 100% transparent and 1.0 has no transparency. The default value is 1.0.
<String[]> tileServers Array of REST endpoints that can be used to retrieve tile images. (As of v1.1)
<Boolean> visible Initial visibility of the layer. The default value is true.
Code snippets:
var tiledMapServiceLayer = new esri.layers.ArcGISTiledMapServiceLayer(  
    "http://server.arcgisonline.com/ArcGIS/rest/services/NGS_Topo_US_2D/MapServer");
Properties Detail

<String> capabilities

Capabilities of the map service, possible values are Map, Query and Data. Only available if the map service is published using ArcGIS Server version 10 or greater. (As of v2.1)
Code snippets:
console.log(layer.capabilities);

<String> copyright

Copyright string as defined by the map service.

<String> description

Map description as defined by the map service.

<LayerInfo[]> layerInfos

Returns the available layers in service and their default visibility.

<TimeInfo> timeInfo

Temporal information for the layer, such as time extent. If this property is null or not specified, then the layer does not support time-related operations. (As of v2.0)

<String> units

Default units of the layer as defined by the service. If the layer is the base map, the map is in these units.

<Number> version

The version of ArcGIS Server where the map service is published. Examples are 9.3, 9.3.1, 10, 10.01. (As of v2.1)