[Tilecache] Extents vs. resoultion vs. maxResolution HowTo?

Steve Lime Steve.Lime at dnr.state.mn.us
Fri Nov 2 17:37:54 EDT 2007


I'm sick of beating my head against the wall so am just going to ask. Is there documentation
that details the joint setup of OpenLayers against TileCache with detail on the computations
necessary to get things sync'd up correctly? I'm trying to setup a cache for a simple no layer
(e.g. everything is STATUS DEFAULT) MapServerLayer.

In the tilecache config I have (at this point):

    [compass]
    metaTile=true
    type=MapServerLayer
    layers=
    mapfile=/usr/local/www/docs_maps/compass/compass.map
    srs=EPSG:29615
    extent_type=loose
    #bbox=59874.874702,4793122.838717,853624.446078,5481039.133908

and the sample client:

    <script type="text/javascript">
        <!--
        var map, layer;

        function init(){
            map = new OpenLayers.Map( $('map'), {maxExtent: new OpenLayers.Bounds(59874.874702,4793122.838717,853624.446078,5481039.133908)} );
            layer = new OpenLayers.Layer.WMS( "test", "tilecache.cgi?", {layers: 'compass', format: 'image/png', projection:'EPSG:26915'} );
            map.addLayer(layer);            
            if (!map.getCenter()) map.zoomToMaxExtent();
        }
        // -->
    </script>

I've tried a number of combinations of maxResolution, maxExent, resolutions and so on with 
no luck. This configuration results in tile errors like this initially:

An error occurred: can't find resolution index for 1.406250. Available resolutions are: 
[0.703125, 0.3515625, 0.17578125, 0.087890625, 0.0439453125, 0.02197265625, 0.010986328125, 0.0054931640625, 0.00274658203125, 0.001373291015625, 0.0006866455078125, 0.00034332275390625, 0.000171661376953125, 8.58306884765625e-05, 4.291534423828125e-05, 2.1457672119140625e-05, 1.0728836059570312e-05, 5.3644180297851562e-06, 2.6822090148925781e-06, 1.3411045074462891e-06]

and this if one zooms in once:

An error occurred: Current x value 456594.874702 is too far from tile corner x 456660.000000

I must be missing something obvious (am used to ka-map and using scale values instead of 
resolutions). There must be a standard setup for MapServerLayer and non-geographics 
coordinates.

Thanks- Steve




More information about the Tilecache mailing list