Interface ITiledMapServer

Namespace
ESRI.ArcGIS.Carto
Assembly
ESRI.Server.Carto.dll

Provides access to members that serve tiled maps.

[Guid("1627CE7E-954F-4013-9969-E726F8084C25")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ITiledMapServer

Remarks

ITiledMapServer has methods that allow the caller  to discover if a map service is cached, the type of the cache and the tiling scheme for the cache. ITiledMapServer also has methods to determine the virtual directory for the cache and methods to retrieve tiles from the cache.

A tiled map has a number of LODs (Levels of Detail). Each LOD, which corresponds to a map at given map scale, contains many tiles. Each tile consists of pixels, and number of pixels in a tile (described as TileROWs and TileCOLs) is the same at all levels, but the pixel size, in map space, of a tile varies with LOD.

 

Tiled Map Structure

 

The ITiledMapServer, ITileCacheInfo and ILODInfo interfaces are used to access a tiled map that is served through ArcGIS for Server.

To get the pixel size (in map space) at a given LOD, use following code snippet:

Dim pTiledMap As ITiledMapServer
Dim pTileCacheInfo As ITileCacheInfo
Set pTiledMapInfo = pMapServer
Set pTileCacheInfo = pTiledMap.GetTileCacheInfo("usa")
Dim Resolution As Double
Dim pLODInfos As ILODInfos
Dim pLODInfo As ILODInfo
Set pLODInfos = pTileCacheInfo.LODInfos
Set pLODInfo = pLODs.Element(i)
Resolution = pLOD.Resolution

The dimension of a tile can be retrieved by ITileMapServer::TileRows and TileCols respectively.

TileRows = pTiledMap::TileRows
TileCols = pTiledMap::TileCols

Each tile is assigned a row and column number (TROW, TCOL) in a tile coordinate system. TROW, which starts from 0, increases from ‘top to bottom’ (i.e tile row number increases as map y coordinate decreases). TCOL, also starting from 0, increases from ‘left to right’ (i.e. tile column number increases as map x coordinate increases).

The size of tile, in map space, at a given LOD can be obtained by:

TileWidth = TileCols * Resolution
TileHeight = TileRows * Resolution

The tiling origin, in map space, is the same for all LODs, and can be obtained from ITileCacheInfo.Origin property.

xorigin = pTileCacheInfo.Origin.X
yorigin = pTileCacheInfo.Origin.Y

Given a map coordinate (x, y) the tile coordinates (TCOL, TROW) of the tile containing it for a given LOD are given by:

TCOL  = floor ( (x – xorigin) /  TileWidth )
TROW = floor ( (yorigin – y) / TileHeight )

The corner points in map coordinates of a tile with tile coordinates (TROW, TCOL) are:

xmin =  xorigin + (TCOL * TileWidth)
xmax = xmin + TileWidth
ymax =  yorigin  - (TROW * TileHeight)
ymin = ymax - TileHeight

Tiles are semi-open, include the boundaries corresponding to xmin, ymax.

Methods

GetCacheName(string, int)

Gets the cache name for a given layer within a map.

string GetCacheName(string MapName, int LayerID)

Parameters

MapName string
LayerID int

Returns

string

GetLayerTile(string, int, int, int, int)

Gets a tile for a given tile location from a given layer.

byte[] GetLayerTile(string MapName, int LayerID, int Level, int Row, int Column)

Parameters

MapName string
LayerID int
Level int
Row int
Column int

Returns

byte[]

Remarks

This call gets the specified tile from the specified layer for a map service that has a multi layer cache. GetLayerTile method only returns a tile if the cache is generated using PNG format. When the cache format specified in the TileImageInfo is not PNG the client should use GetLayerTileEx.

GetMapTile(string, int, int, int)

Gets a tile for a given tile location from a given map.

byte[] GetMapTile(string MapName, int Level, int Row, int Column)

Parameters

MapName string
Level int
Row int
Column int

Returns

byte[]

Remarks

This call gets the specified tile from a map service that has a single fused cache. GetMapTile only returns a tile if the cache is generated using PNG format. When the cache format specified in the TileImageInfo is not PNG the client should use GetMapTileEx.

GetTileCacheInfo(string)

Gets the cache configuration for a given map.

ITileCacheInfo GetTileCacheInfo(string MapName)

Parameters

MapName string

Returns

ITileCacheInfo

Remarks

The ITileCacheInfo object contains information on the tiling scheme for the cache. The tiling scheme includes the tiling origin, spatial reference, tile size in pixels and information on the Levels of Detail at which the service is cached.

ILODInfos enumerate a LODInfo object which describes a scale and resoluton.

Using the tiling scheme information in the TileCacheInfo object the client can calculate the tiles that cover any rectangular extent in map space and then retrieve tiles either directly from  the virtual directory, or from the tile handler or by making GetMapTile or GetLayerTile requests against the map service.

GetVirtualCacheDirectory(string, int)

Gets the virtual cache directory for a given layer within a map.

string GetVirtualCacheDirectory(string MapName, int LayerID)

Parameters

MapName string
LayerID int

Returns

string

Remarks

This call retrieves the virtual directory that hosts the cache tiles for this map service. Use -1 as the layerid in order to get the virtual cache directory  for a map service that has a single fused cache. This is an optional property and may not always be present, for example, on a secure server or on an on demand server. If present then this is the preferred (most optimal) way for a client to retrieve tiles.

HasLayerCache(string, int)

Indicates if a given layer has a single tile cache.

bool HasLayerCache(string MapName, int LayerID)

Parameters

MapName string
LayerID int

Returns

bool

Remarks

Use this method to discover if a particular layer in a map service with a multi layer cache is cached or not.  If IsFixedScaleMap is true and HasSingleFusedMapCache is false, then the map service has a multi layer cache that is made up of individual layer caches. Not all layers in such a map service need be cached.

HasSingleFusedMapCache(string)

Indicates if a given map has a single fused map tile cache.

bool HasSingleFusedMapCache(string MapName)

Parameters

MapName string

Returns

bool

Remarks

Use this method to determine if a cached map service has a single fused map cache.

IsFixedScaleMap(string)

Indicates if a given map is a fixed scale map.

bool IsFixedScaleMap(string MapName)

Parameters

MapName string

Returns

bool

Remarks

Use this method to determine if a map service is cached. The term fixed scale map service and cached map service are used synonymously in the API.  A fixed scale map service works with a cache of images that represent pre-rendered tiles for either the entire map service or for individual layers in the map service.