Hey Steve,

I think what you are asking is how to load a cached folder of tiles created with generate_tiles.py in OpenLayers?

You may also be asking how to use TileCache to create tiles from a WMS or TMS layer in the same tiling mode as generate_tiles.py?

As far as the latter, your 'url' variable must point to a true WMS server url like Mapnik's OGCServer, not a set of pregenerated tiles.

As far as the former, you don't need TileCache (the python tool). But, you do use the *TileCache* layer in OpenLayers and you need to modify the getURL request.

I had an example of that setup sitting around, so I cleaned it up and posted it here:

http://mapnik-utils.googlecode.com/svn/trunk/tutorials/tilecache/generate_tiles_cache.html

Find the line : `var generate_tiles_url` and change it to your cache url. Looks like for you it is: `http://localhost/tilecache/tiles`


Dane



On Oct 15, 2008, at 7:18 AM, Stephen Lee-Kelland wrote:

Hi

Does anyone know how I can access the Mapnik tile cache created by "generate_tiles.py" directly using Tilecache? (ie: using pre- generated tiles).

I have tried copying the Mapnik cache into /var/www/html/tilecache/ tiles and then setting:

[basic]
type=WMS
url=http://127.0.0.1/tilecache/tiles
extension=png

[cache]
type=Disk
base=/tmp/tilecache

in tilecache.cfg and then running the index.html that comes with tilecache but this does not work. Neither the apache log nor firebug (script debugger) give any errors but all I get is a set of pink squares.

I can get tilecache.cgi to display one image at a time by using
http://127.0.0.1/tilecache/tilecache.cgi/1.0.0/basic/0/0/0.png and setting the url in tilecache.cfg to http://127.0.0.1/tilecache/tiles/0/0 .

I am using the following, nearly standard code in index.html:

function init(){
map = new OpenLayers.Map( $('map'), {'maxResolution': 360/512});

            layer = new OpenLayers.Layer.WMS( "basic",
"tilecache.cgi?", {layers: 'basic', format: 'image/png' } );
            map.addLayer(layer);
            map.addControl(new OpenLayers.Control.Permalink());
            if (!map.getCenter()) map.zoomToMaxExtent();
        }

Any help would be greatly appreciated.

Best wishes

Steve


_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to