[OSM-dev] generate_tiles.py and openlayers issue

Martijn Verwijmeren cartinus at xs4all.nl
Fri Feb 29 19:27:37 GMT 2008


On Fri, 29 Feb 2008 16:49:04 +0000
Xin <xin at zenpow.com> wrote:

> Hi Guys,
> 
> I have been hellishly trying to get the the tiles generated from
> generate_tiles.py to work under OpenLayers. I am basing my OL code
> from http://trac.openlayers.org/wiki/UsingCustomTiles on the
> recommendation from an OL user.
> 
> OL is expecting these files:
> http://localhost:3000/tiles/10/510/511.png
> http://localhost:3000/tiles/10/511/511.png
> http://localhost:3000/tiles/10/512/511.png
> http://localhost:3000/tiles/10/511/509.png
> http://localhost:3000/tiles/10/512/510.png
> ...
> 
> I have these tiles:
> tiles/10/560/577.png
> tiles/10/560/578.png
> ...
> 
> It's pretty close. So I'm thinking it might be a projection issue?
> 
> In my mapnik config, I have set the projection to Google/OSM:
> <Map bgcolor="#b5d0d0" srs="+proj=merc +a=6378137 +b=6378137
> +lat_ts=0.0+lon_0= 0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m
> +nadgrids=@null +no_defs +over">
> 
> In my generate_tiles.py:
> http://pastie.caboo.se/159356
> 
> I got the file from OSM svn.
> 
> My OpenLayers JS config:
> http://pastie.caboo.se/159354
> 
> I'm finding it hard to wrap my head around all this.
> 
> Can anyone help at all?
> 
> Cheers,
> Xin

That example in the wiki looks to work almost the same as all the OSM
related slippy maps I looked at, except for a small difference. The
numbers in maxExtent and maxResolution I have seen so far have all been
integers and that example use numbers with a decimal point in them. I
don't know if the difference in rounding is enough to cause the
difference in tile names you see though, but it might be worth a try to
leave the decimal point and everything after it away.

M.v.g.,
Cartinus




More information about the dev mailing list