[OpenLayers-Users] tile images and leading zeros

Xin xin at zenpow.com
Wed Feb 27 12:00:11 EST 2008


Thank you for the quick reply Chris. It helped a lot.

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!

Using http://trac.openlayers.org/wiki/UsingCustomTiles, 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.

My updated JS:
http://pastie.caboo.se/158268

As you can see, I have set the options for Google-like tiles.

My generate_tiles.py configs:
    minZoom = 10
    maxZoom = 16
    bbox = (16.981109375,-22.6169453125,17.156890625,-22.5290546875)
    render_tiles(bbox, mapfile, tile_dir, minZoom, maxZoom)

The lat/lng from JS and bbox from generate_tiles are of the same place.

At default zoom (14), some of the tiles OL's looking for are:
http://localhost:3000/tiles/14/8193/8188.png
http://localhost:3000/tiles/14/8192/8188.png
http://localhost:3000/tiles/14/8191/8188.png
http://localhost:3000/tiles/14/8190/8188.png
http://localhost:3000/tiles/14/8189/8188.png

listing directory 14:
8964  8965  8966  8967  8968  8969  8970  8971  8972

It's so close! but not quite it. Can anyone offer any advice?

Any help is much appreciated.

Xin



On 26/02/2008, Christopher Schmidt <crschmidt at metacarta.com> wrote:
>
> On Tue, Feb 26, 2008 at 05:32:49PM +0000, Xin wrote:
> > Hi,
> >
> > I am trying to use OpenLayers with image times generated from
> > generate_tiles.py (mapnik folder of openstreetmap).
> >
> > With my setup, OL is looking for the following files:
> > http://localhost:3000/tiles/basic/00/000/000/000/000/000/000.png
> > http://localhost:3000/tiles/basic/00/000/000/001/000/000/000.png
> >
> > My tiles are:
> > http://localhost:3000/tiles/basic/0/0/0.png
> > etc.
> >
> > There are two problems here:
> > 1) OL is looking a deeper directory structural than I've got
> > 2) OL is looking for files with leading zeros
>
>
> Why are you using OpenLayers.Layer.TileCache? Use TMS; speciically, you
> probably want something like
> http://trac.openlayers.org/wiki/UsingCustomTiles or the
> Spherical-mercator example.
>
> Regards,
>
> --
> Christopher Schmidt
> MetaCarta
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20080227/85f9b1dc/attachment.html


More information about the Users mailing list