Provides access to members that serve tiled maps.
Members
Name | Description | |
---|---|---|
GetCacheName | Gets the cache name for a given layer within a map. | |
GetLayerTile | Gets a tile for a given tile location from a given layer. | |
GetMapTile | Gets a tile for a given tile location from a given map. | |
GetTileCacheInfo | Gets the cache configuration for a given map. | |
GetVirtualCacheDirectory | Gets the virtual cache directory for a given layer within a map. | |
HasLayerCache | Indicates if a given layer has a single tile cache. | |
HasSingleFusedMapCache | Indicates if a given map has a single fused map tile cache. | |
IsFixedScaleMap | Indicates if a given map is a fixed scale map. |
ITiledMapServer.GetCacheName Method
Gets the cache name for a given layer within a map.
Public Function GetCacheName ( _
ByVal MapName As String, _
ByVal LayerID As Integer _
) As String
public string GetCacheName (
string MapName,
int LayerID
);
ITiledMapServer.GetLayerTile Method
Gets a tile for a given tile location from a given layer.
Public Function GetLayerTile ( _
ByVal MapName As String, _
ByVal LayerID As Integer, _
ByVal Level As Integer, _
ByVal Row As Integer, _
ByVal Column As Integer _
) As Byte[]
public Byte[] GetLayerTile (
string MapName,
int LayerID,
int Level,
int Row,
int Column
);
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.
ITiledMapServer.GetMapTile Method
Gets a tile for a given tile location from a given map.
Public Function GetMapTile ( _
ByVal MapName As String, _
ByVal Level As Integer, _
ByVal Row As Integer, _
ByVal Column As Integer _
) As Byte[]
public Byte[] GetMapTile (
string MapName,
int Level,
int Row,
int Column
);
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.
ITiledMapServer.GetTileCacheInfo Method
Gets the cache configuration for a given map.
Public Function GetTileCacheInfo ( _
ByVal MapName As String _
) As ITileCacheInfo
public ITileCacheInfo GetTileCacheInfo (
string MapName
);
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.
ITiledMapServer.GetVirtualCacheDirectory Method
Gets the virtual cache directory for a given layer within a map.
Public Function GetVirtualCacheDirectory ( _
ByVal MapName As String, _
ByVal LayerID As Integer _
) As String
public string GetVirtualCacheDirectory (
string MapName,
int LayerID
);
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.
ITiledMapServer.HasLayerCache Method
Indicates if a given layer has a single tile cache.
Public Function HasLayerCache ( _
ByVal MapName As String, _
ByVal LayerID As Integer _
) As Boolean
public bool HasLayerCache (
string MapName,
int LayerID
);
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.
ITiledMapServer.HasSingleFusedMapCache Method
Indicates if a given map has a single fused map tile cache.
Public Function HasSingleFusedMapCache ( _
ByVal MapName As String _
) As Boolean
public bool HasSingleFusedMapCache (
string MapName
);
Remarks
Use this method to determine if a cached map service has a single fused map cache.
ITiledMapServer.IsFixedScaleMap Method
Indicates if a given map is a fixed scale map.
Public Function IsFixedScaleMap ( _
ByVal MapName As String _
) As Boolean
public bool IsFixedScaleMap (
string MapName
);
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.
Classes that implement ITiledMapServer
Classes | Description |
---|
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.
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.