Map Service GetVirtualCacheDirectory method

Gets the virtual directory containing the cache tiles for a given layer within a map (data frame).

 

GetVirtualCacheDirectory(string MapName, int LayerID)

 

Parameter

Description

MapName

Name of the map (data frame) on which a cache was created.

 

LayerID

The layer id of the layer in the map on which a cache was created.  A multilayer cache will have a different virtual directory for each layer.  A fused cache will only have one virtual directory.  To get the virtual directory of a fused cache, specify a value of -1.

 

 

Return Value

 

A string representing the url to a virtual directory containing cached tile images.   If the map or layer does not have a virtual cache directory, the method will return an exception.  

 

Remarks

 

To determine if you are working with a map service that has a cache, use the IsFixedScaleMap() method.

 

To determine if you are working with a multilayer or fused cache, use the methods HasLayerCache() or HasSingleFusedCache() on the map service proxy.  The virtual directory for a fused cache follows the pattern <base url>\<map name>\_alllayers.  For a multilayer cache the pattern is <base url>\<map name>\<layer name>.   Layer names can be retrieved via the MapServerInfo object returned from the GetServerInfo() method.   Each layer is referenced via a MapLayerInfo object accessible via the MapLayerInfos property.

 

Note that a map service with a multilayer cache may have a cache generated on some layers and not others.   

 

Examples

C#

VB.NET

Java