Thank you for the quick reply Chris. It helped a lot.<br><br>I am new to this and wasn't sure how to use tiles. So I searched for tiles on the example page, and TileCache came up. That's how I got to use it!<br><br>
Using <a href="http://trac.openlayers.org/wiki/UsingCustomTiles">http://trac.openlayers.org/wiki/UsingCustomTiles</a>, OL is accessing tiles in the right format now. But the exact file name does not match with what I produced from a certain bounding box and zoom range. I fear it's projection issues.<br>
<br>My updated JS:<br><a href="http://pastie.caboo.se/158268">http://pastie.caboo.se/158268</a><br><br>As you can see, I have set the options for Google-like tiles.<br><br>My generate_tiles.py configs:<br> minZoom = 10<br>
maxZoom = 16<br> bbox = (16.981109375,-22.6169453125,17.156890625,-22.5290546875)<br> render_tiles(bbox, mapfile, tile_dir, minZoom, maxZoom)<br><br>The lat/lng from JS and bbox from generate_tiles are of the same place.<br>
<br>At default zoom (14), some of the tiles OL's looking for are:<br><div class="logRow logRow-info"><span class="objectBox objectBox-text"><a href="http://localhost:3000/tiles/14/8193/8188.png">http://localhost:3000/tiles/14/8193/8188.png</a></span><a class="objectLink objectLink-sourceLink"><br>
</a></div><div class="logRow logRow-info"><span class="objectBox objectBox-text"><a href="http://localhost:3000/tiles/14/8192/8188.png">http://localhost:3000/tiles/14/8192/8188.png</a></span><a class="objectLink objectLink-sourceLink"><br>
</a></div><div class="logRow logRow-info"><span class="objectBox objectBox-text"><a href="http://localhost:3000/tiles/14/8191/8188.png">http://localhost:3000/tiles/14/8191/8188.png</a></span><a class="objectLink objectLink-sourceLink"><br>
</a></div><div class="logRow logRow-info"><span class="objectBox objectBox-text"><a href="http://localhost:3000/tiles/14/8190/8188.png">http://localhost:3000/tiles/14/8190/8188.png</a></span><a class="objectLink objectLink-sourceLink"><br>
</a></div><div class="logRow logRow-info"><span class="objectBox objectBox-text"><a href="http://localhost:3000/tiles/14/8189/8188.png">http://localhost:3000/tiles/14/8189/8188.png</a><br><br>listing directory 14:<br>8964 8965 8966 8967 8968 8969 8970 8971 8972<br>
<br></span></div><span class="objectBox objectBox-text"></span>It's so close! but not quite it. Can anyone offer any advice?<br><br>Any help is much appreciated.<br><br>Xin<br><br><br><br><div><span class="gmail_quote">On 26/02/2008, <b class="gmail_sendername">Christopher Schmidt</b> <<a href="mailto:crschmidt@metacarta.com">crschmidt@metacarta.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Tue, Feb 26, 2008 at 05:32:49PM +0000, Xin wrote:<br> > Hi,<br> ><br> > I am trying to use OpenLayers with image times generated from<br> > generate_tiles.py (mapnik folder of openstreetmap).<br> ><br> > With my setup, OL is looking for the following files:<br>
> <a href="http://localhost:3000/tiles/basic/00/000/000/000/000/000/000.png">http://localhost:3000/tiles/basic/00/000/000/000/000/000/000.png</a><br> > <a href="http://localhost:3000/tiles/basic/00/000/000/001/000/000/000.png">http://localhost:3000/tiles/basic/00/000/000/001/000/000/000.png</a><br>
><br> > My tiles are:<br> > <a href="http://localhost:3000/tiles/basic/0/0/0.png">http://localhost:3000/tiles/basic/0/0/0.png</a><br> > etc.<br> ><br> > There are two problems here:<br> > 1) OL is looking a deeper directory structural than I've got<br>
> 2) OL is looking for files with leading zeros<br> <br> <br>Why are you using OpenLayers.Layer.TileCache? Use TMS; speciically, you<br> probably want something like<br> <a href="http://trac.openlayers.org/wiki/UsingCustomTiles">http://trac.openlayers.org/wiki/UsingCustomTiles</a> or the<br>
Spherical-mercator example.<br> <br> Regards,<br> <br>--<br> Christopher Schmidt<br> MetaCarta<br> _______________________________________________<br> Users mailing list<br> <a href="mailto:Users@openlayers.org">Users@openlayers.org</a><br>
<a href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a><br> </blockquote></div><br>