[Tilecache] couldn't calculate tile index for laye

Jackey Cheung cheung.jackey at gmail.com
Wed Mar 28 21:42:32 EDT 2007


Thx for the hint.

I've change the map to a world map bbox=-180,-90,180,90, and codes to:

openlayers:
        var options4326 = {
                 //maxResolution: 1,
                 //maxZoomLevel: 8,
                 maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90),
                 projection:"EPSG:4326",
                 controls: [new OpenLayers.Control.MouseDefaults()]
                 };
        var map = new OpenLayers.Map('map', options4326);

        var gdhk_tilecache = new OpenLayers.Layer.WMS(
            "WMS (EPSG 4326); tilecache",
            "http://localhost/tilecache/tilecache.cgi", {
              layers: 'world',
              format: 'image/png'}

tilecache.cfg:
[world]
type=WMSLayer
url=http://localhost/cgi-bin/en/mapserv
extension=png


but I still got the same error. any clue?

Just wondering, do I need to set something in the map file? besides the map 
extent (which I've set to -180 -90 180 90)? Or do I need to add the 
"?map=world.map&" to the url in the tilecache.cfg?

thx a lot.


----- Original Message -----
From: "Christopher Schmidt" <crschmidt at metacarta.com>
To: "GMail" <cheung.jackey at gmail.com>
Cc: <tilecache at openlayers.org>
Sent: Wednesday, March 28, 2007 19:19
Subject: Re: [Tilecache] couldn't calculate tile index for laye

> On Wed, Mar 28, 2007 at 05:09:12PM +0800, GMail wrote:
>> Greetings,
>>     I've got problem using openlayers+tilecache+ms4w. Codes follow:
>>
>> OpenLayers:
>>         var options4326 = {
>>                  //maxResolution: 1,
>>                  //maxZoomLevel: 8,
>>                  maxExtent: new 
>> OpenLayers.Bounds(109.659395,20.208809,117.205135,25.452341),
>>                  projection:"EPSG:4326",
>>                  controls: [new OpenLayers.Control.MouseDefaults()]
>>                  };
>>         var map = new OpenLayers.Map('map', options4326);
>>
>>         var gdhk_tilecache = new OpenLayers.Layer.WMS(
>>             "WMS (EPSG 4326); tilecache",
>>             "http://localhost/tilecache/tilecache.cgi", {
>>               layers: 'gdhk',
>>               format: 'image/gif'}
>>             );
>>
>> tilecache.cfg:
>> [gdhk]
>> type=WMSLayer
>> url=http://localhost/cgi-bin/en/mapserv
>> extension=gif
>> #bbox=109.659395,20.208809,117.205135,25.452341
>> #levels=8
>>
>> It always return errors "couldn't calculate tile index for layer", but I 
>> can see the image by:
>> http://localhost/tilecache/tilecache.cgi?layers=gdhk&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&SRS=EPSG:4326&WIDTH=256&HEIGHT=256&BBOX=109.659395,20.208809,117.205135,25.452341
>
> If your'e using a non-standard bbox, you should have two parameters in
> *each* of your map config and tilecache config, which need to match:
>
> * bbox / maxExtent
> * maxresolution / maxResolution
>
> If you set your maxResolution to 1 in OpenLayers, and set your
> maxresolution to 1 in TileCache, I think you'll be able to get started.
>
> Regards,
> -- 
> Christopher Schmidt
> MetaCarta 




More information about the Tilecache mailing list