Packagecom.esri.ags.layers
Classpublic class ArcGISTiledMapServiceLayer
InheritanceArcGISTiledMapServiceLayer Inheritance TiledMapServiceLayer Inheritance Layer Inheritance mx.core.UIComponent

Allows you to work with a cached map service resource exposed by the ArcGIS Server REST API (available in ArcGIS Server 9.3 and above). A cached service accesses pre-created tiles from a cache instead of dynamically rendering images.

The projection of the map is determined by the first visible layer. The tiling scheme (scale levels) is determined by the first ArcGISTiledMapServiceLayer.

Note that ArcGISTiledMapServiceLayer, like all layers, extend UIComponent and thus include basic mouse events, for example: click, mouseOut, mouseOver, and mouseDown, as well as other events like show and hide, and general properties, such as alpha and visible.


Example
MXML usage of ArcGISTiledMapServiceLayer:
 <esri:Map>
     <esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/arcgis/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
 </esri:Map>

View the examples.

See also

com.esri.ags.events.LayerEvent
Directory of services from ArcGIS Online
Live sample - Tiled Map
Live sample - Projected Map


Public Properties
 PropertyDefined by
  copyright : String
[read-only] Map copyright as defined by the map service.
ArcGISTiledMapServiceLayer
  description : String
[read-only] Map description as defined by the map service.
ArcGISTiledMapServiceLayer
 InheriteddisplayLevels : Array
Levels to display in layer, based on LOD.level.
TiledMapServiceLayer
 InheritedfadeInFrameCount : uint
The number of frames it will take for the tiles to fade in.
TiledMapServiceLayer
  fullExtent : Extent
[read-only] Full extent as defined by the map service.
ArcGISTiledMapServiceLayer
  initialExtent : Extent
[read-only] Initial extent as defined by the map service.
ArcGISTiledMapServiceLayer
 InheritedisInScaleRange : Boolean
Returns true if the current scale of the map is between the maximum and minimum scale of the layer [added in version 1.3].
Layer
  layerInfos : Array
[read-only] The available layers in the map service and their default visibility.
ArcGISTiledMapServiceLayer
 Inheritedloaded : Boolean
When the layer is loaded, the value becomes "true" and layer properties can be accessed.
Layer
 Inheritedmap : Map
A reference to the Map this layer is in.
Layer
 InheritedmaxScale : Number = 0
The maximum scale of the layer [added in version 1.3].
Layer
 InheritedminScale : Number = 0
The minimum scale of the layer [added in version 1.3].
Layer
  proxyURL : String
The URL to proxy the request through.
ArcGISTiledMapServiceLayer
  requestTimeout : Number = -1
The request timeout in seconds.
ArcGISTiledMapServiceLayer
  serviceDescription : String
[read-only] Map service description as defined by the map service.
ArcGISTiledMapServiceLayer
  spatialReference : SpatialReference
[read-only] The spatial reference of the map service.
ArcGISTiledMapServiceLayer
  tileInfo : TileInfo
[read-only] Contains information about the tiling scheme.
ArcGISTiledMapServiceLayer
  tileServers : Array
List of URL endpoints to load from.
ArcGISTiledMapServiceLayer
  token : String
Token for accessing a secure tiled ArcGIS service.
ArcGISTiledMapServiceLayer
  units : String
[read-only] The units of the layer.
ArcGISTiledMapServiceLayer
  url : String
URL endpoint of a service.
ArcGISTiledMapServiceLayer
  visibleLayers : ArrayCollection
[read-only] The visible layers as defined by the default visibility in LayerInfo.
ArcGISTiledMapServiceLayer
Public Methods
 MethodDefined by
  
ArcGISTiledMapServiceLayer(url:String = null, proxyURL:String = null, token:String = null)
Creates a new ArcGISTiledMapServiceLayer object.
ArcGISTiledMapServiceLayer
  
getLayerDetails(layerID:Number, responder:IResponder):void
Gets the detailed layer information for an ArcGIS layer.
ArcGISTiledMapServiceLayer
 Inherited
refresh():void
Causes the layer to redraw or reload its content.
Layer
Protected Methods
 MethodDefined by
 Inherited
Adds listeners for ExtentEvent.EXTENT_CHANGE, ZoomEvent.ZOOM_START, ZoomEvent.ZOOM_UPDATE and ZoomEvent.ZOOM_END.
Layer
 Inherited
When an EXTENT_CHANGE event occurs, this calls invalidateLayer();
Layer
 Inherited
getTileURL(level:Number, row:Number, col:Number):URLRequest
Subclasses must override this method to cause tiles to be loaded from their own endpoints.
TiledMapServiceLayer
 Inherited
hideHandler(event:FlexEvent):void
When the layer is hidden (visible is set to false), this calls removeMapListeners().
Layer
 Inherited
Subclasses should call this whenever they would like to have updateLayer() called on them.
Layer
 Inherited
Removes all the layers children.
Layer
 Inherited
Removes the four event listeners added by addMapListeners();
Layer
 Inherited
setLoaded(value:Boolean):void
Subclasses must call this when they've loaded all their properties and are ready to load their content.
Layer
 Inherited
showHandler(event:FlexEvent):void
When the layer is shown (visible is set to true), this calls addMapListeners() and invalidateLayer().
Layer
 Inherited
toScreenX(mapX:Number):Number
Converts the x-coordinate of map point to a screen point.
Layer
 Inherited
toScreenY(mapY:Number):Number
Converts the y-coordinate of map point to a screen point.
Layer
 Inherited
updateLayer():void
Subclasses must override this method.
Layer
 Inherited
Finishes the zoom animation.
Layer
 Inherited
Prepares the zoom animation by taking a bitmap of the layer.
Layer
 Inherited
Redraws the bitmap of the layer.
Layer
Events
 EventSummaryDefined by
 Inherited Dispatched when a tile's content loading is complete and the tile has finished fading in.TiledMapServiceLayer
 Inherited Dispatched when a tile input/output error occurs.TiledMapServiceLayer
 Inherited Fires after layer properties for the layer are successfully populated.Layer
 Inherited Fires if the layer is unable to load.Layer
 Inherited Dispatched when all the tiles have either been completed or have errored.TiledMapServiceLayer
Property detail
copyrightproperty
copyright:String  [read-only]

Map copyright as defined by the map service.

This property can be used as the source for data binding.

Implementation
    public function get copyright():String
descriptionproperty 
description:String  [read-only]

Map description as defined by the map service.

This property can be used as the source for data binding.

Implementation
    public function get description():String
fullExtentproperty 
fullExtent:Extent  [read-only]

Full extent as defined by the map service.

This property can be used as the source for data binding.

Implementation
    public function get fullExtent():Extent
initialExtentproperty 
initialExtent:Extent  [read-only]

Initial extent as defined by the map service. Used for the map if it's the first layer in the map and map doesn't have an extent specified.

This property can be used as the source for data binding.

Implementation
    public function get initialExtent():Extent
layerInfosproperty 
layerInfos:Array  [read-only]

The available layers in the map service and their default visibility.

This property can be used as the source for data binding.

Implementation
    public function get layerInfos():Array

See also

proxyURLproperty 
proxyURL:String  [read-write]

The URL to proxy the request through.

This property can be used as the source for data binding.

Implementation
    public function get proxyURL():String
    public function set proxyURL(value:String):void
requestTimeoutproperty 
public var requestTimeout:Number = -1

The request timeout in seconds. A value less than or equal to zero prevents request timeout.

serviceDescriptionproperty 
serviceDescription:String  [read-only]

Map service description as defined by the map service.

This property can be used as the source for data binding.

Implementation
    public function get serviceDescription():String
spatialReferenceproperty 
spatialReference:SpatialReference  [read-only]

The spatial reference of the map service.

This property can be used as the source for data binding.

Implementation
    public function get spatialReference():SpatialReference
tileInfoproperty 
tileInfo:TileInfo  [read-only]

Contains information about the tiling scheme.

This property can be used as the source for data binding.

Implementation
    public function get tileInfo():TileInfo
tileServersproperty 
tileServers:Array  [read-write]

List of URL endpoints to load from. This improves performance by allowing more simultaneous requests.

Note: you can specify a single tile Server to override the URL used for tile requests.

This property can be used as the source for data binding.

Implementation
    public function get tileServers():Array
    public function set tileServers(value:Array):void

See also


Example
Using tile servers
<esri:ArcGISTiledMapServiceLayer url="http://mymaindomain/ArcGIS/rest/services/World_TilesOnDemand/MapServer">
    <esri:tileServers>
        <mx:String>http://tiles1.example.com/ArcGIS/rest/services/World_TilesOnDemand/MapServer</mx:String>
        <mx:String>http://tiles2.example.com/ArcGIS/rest/services/World_TilesOnDemand/MapServer</mx:String>
    </esri:tileServers>
</esri:ArcGISTiledMapServiceLayer>

tokenproperty 
public var token:String

Token for accessing a secure tiled ArcGIS service.


Example
Specifying the security token for a secured tile service
<esri:ArcGISTiledMapServiceLayer
    url="http://premium.arcgisonline.com/Server/rest/services/I3_Imagery_Prime_World_2D/MapServer?token=XXX-t0RZv0ViIuOqM80EKzQ2-0B3LYIgfPMbp4AMDsV5TDF1I14IkhD7JWx5jgzbwFIfxhXOniZCRZZZYYYXXX.."
    token="XXX-t0RZv0ViIuOqM80EKzQ2-0B3LYIgfPMbp4AMDsV5TDF1I14IkhD7JWx5jgzbwFIfxhXOniZCRZZZYYYXXX.." />
</esri:Map>

unitsproperty 
units:String  [read-only]

The units of the layer. Subclasses should override this method as a best practice in case a subclassed layer is added to a map which has different "units".

This property can be used as the source for data binding.

Implementation
    public function get units():String

See also

urlproperty 
url:String  [read-write]

URL endpoint of a service. To obtain the URL, use ArcGIS Services Directory. An example URL for the Street Map service on ArcGIS Online is http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer.

This property can be used as the source for data binding.

Implementation
    public function get url():String
    public function set url(value:String):void
visibleLayersproperty 
visibleLayers:ArrayCollection  [read-only]

The visible layers as defined by the default visibility in LayerInfo.

This property can be used as the source for data binding.

Implementation
    public function get visibleLayers():ArrayCollection

See also

Constructor detail
ArcGISTiledMapServiceLayer()constructor
public function ArcGISTiledMapServiceLayer(url:String = null, proxyURL:String = null, token:String = null)

Creates a new ArcGISTiledMapServiceLayer object.

Parameters
url:String (default = null) — URL to the ArcGIS Server REST resource that represents a cached map service.
 
proxyURL:String (default = null) — The URL to proxy the request through.
 
token:String (default = null) — Token for accessing a secure tiled ArcGIS service.
Method detail
getLayerDetails()method
public function getLayerDetails(layerID:Number, responder:IResponder):void

Gets the detailed layer information for an ArcGIS layer. On completion, LayerDetails is returned.

Parameters
layerID:Number — Layer ID assigned by ArcGIS Server for a layer.
 
responder:IResponder — IResponder to pass the LayerDetails result to.

See also

Examples
ArcGISTiledMapServiceLayer
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
    xmlns:mx="http://www.adobe.com/2006/mxml"
    xmlns:esri="http://www.esri.com/2008/ags"
    pageTitle="Example - ArcGIS API for Flex connecting to my tiled AGS service"
    styleName="plain"
    >
    <mx:Label text="This is a tiled Map Service from ArcGIS Online." />
    <esri:Map>
        <esri:ArcGISTiledMapServiceLayer
            url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
    </esri:Map>
</mx:Application>