Tile Caching

These instructions describe creating a TMS tile cache, they're not relate to using/creating tile caches in ArcGIS Server.

Weave supports the use of tile caches to improve map display performance on the client.

Since tile caches are a client side mapping technology unless you have a corresponding server side map engine in Weave that replicates the maps that you can get from the tile cache you will not be able to include the map layers from the tile cache in reports.

Since tile caches are pre-generated in a certain projection, using certain scales and covering a certain area, if you want to enable the use of a tile cache in a client configuration then you will need to use the projection, scales and extent of the tile cache to configure the client.

Client Configuration

Map Engine

To change a map engine to be a tile cache you need to change the map engine type in a client configuration.

The map engine configuration in the client needs to have its 'type' set to 'tilecache' to tell the Weave client that the map it is generating comes from a tile cache rather than the Weave server (the default map engine type is 'weave' if it's not set explicitly).

A tile cache also need to know where to load the tiles from, which is done by setting one or more 'url' parameters that point to the base directory on a web server that's serving the tiles.

You also need to set the 'layername' of the directory under the 'url' that has the actual tiles, since a single web server can be serving multiple tile caches.

There are also some options that may be set for a tile cache, one is the 'format' option, which tells the Weave client what format the tile images are stored in, and should be set to 'image/jpeg', 'image/png' or 'image/gif' depending upon the source tiles. The other option that's required is to set 'singleTile' to false, which tells the Weave client that it should generate the map from multiple smaller tile requests.

This gives us a simple map engine configuration of



<mapEngine id="mapengine.aerial.tile">
    <type>tilecache</type>
    <url>http://tileserver.example.com/tilecache></url>
    <layername>aerial</layername>
    <options>
        <format>image/jpeg</format>
        <singleTile>false</singleTile>
    </options>
</mapEngine>

This is assuming that the tile images are available at

http://tileserver.example.com/aerial

and are stored in the TileCache format and are JPEG images.

Map Scales

A tile cache is generated at fixed scales and as such requires that the client configuration for the map view is told what the scales are (which also means that the client can only view the map at those fixed scales).

To do this you need to ensure that you have a 'scales' setting set for the map view

<view id="com.cohga.html.client.map.mapView">
    ...
    <scales>
        <scale>1000</scale>
        <scale>2000</scale>
        <scale>5000</scale>
        <scale>10000</scale>
        <scale>20000</scale>
        <scale>50000</scale>
        <scale>100000</scale>
    </scales>
    ....
    <mapEngine id="mapengine.aerial.tile">
        <type>tilecache</type>
        <url>http://tileserver.example.com/tilecache></url>
        <layername>aerial</layername>
        <options>
            <format>image/jpeg</format>
        </options>
    </mapEngine>
</view>

This is assuming that the tile cache has been generated with 7 levels at 1:1000, 1:2000, 1:5000, 1:10000, 1:20000, 1:50000 and 1:100000.

It's also possible to use resolutions/resolution to set the scales (instead of including the scales), since tile caches are generally created based on map units per pixel rather than map scale, so if you're using a pre-generated tile cache and you know the resolution that the tile cache was generated at then you could use them instead. But if you're going to have Weave generate the tile cache then you should use scales.

Extent

Tile caches are generated to cover a certain area, and the Weave client configuration needs to be told what this area is so that the tiles will line up correctly.
To do this you need to ensure that the 'full' extent for the map matches the time cache.