Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have been given an mbtiles file which contains tiles for zoom levels between 16 and 20. When I preview the mbtiles on tilestache, I am not able to zoom in beyond the 18th level. If I request the map at zoom level 19, tiles of zoom level 18 are being rendered. I have viewed the mbtiles files and sure enough there is text "minzoom16" and "maxzoom20".

There is another mbtiles file with tiles from zoom levels 11 to 16. It is rendering tiles requested for zoom level 18 too; beyond zoom level that no tiles.

This makes me wonder if there is any internal setting in the tilestache code that limits the server to rendering tiles up to a certain zoom level. I have searched the source, but couldn't find anything in particular; not that I am a python programmer, but still.

So, does tilestache limit the zoom levels to a certain number? If yes, how can it be changed?

Thank you.

EDIT:

"bholakpur":
{
   "provider": {"name": "mbtiles", "tileset": "/home/***/****/tiles/bholakpur.mbtiles"},
   "preview": {"zoom": 20, "ext": "png"}
}

EDIT 2: Bing layer is the base layer for the map and as far as my tests go Bing has only 18 zoom levels. May be that is the reason the other layers are not requesting tiles beyond the 18th zoom level.

share|improve this question
    
Does your tilestache configuration have a "preview" stanza? Can you post that? –  BradHards Dec 19 '12 at 3:35
    
Can you also post the "layers" definition? –  BradHards Dec 19 '12 at 3:38
    
Edited the question to add the "layers" definition. –  Srisa Dec 19 '12 at 10:03
    
OK, probably not that. You could try adding an explicit bounds stanza (tilestache.org/doc/#layers) and see if that helps. The defaults should be OK though. –  BradHards Dec 19 '12 at 10:07
    
No luck with adding the bounds stanza either. –  Srisa Dec 24 '12 at 12:38
add comment

1 Answer 1

Srisa, I know it's been many months since you asked this question, but I've just had to grapple with the same issue. Turns out that the zoom limit of 18 is in modestmaps.js, not TileStache, and you can get around it by adding a call to .setZoomRange() in TileStache/Core.py. Here are lines 729-746:

<body>
    <div id="map"></div>
    <script type="text/javascript" defer>
    <!--
        var template = '{Z}/{X}/{Y}.%(ext)s';
        var provider = new com.modestmaps.TemplatedMapProvider(template);
        var map = new MM.Map('map', provider, null, [
            new MM.TouchHandler(),
            new MM.DragHandler(),
            new MM.DoubleClickHandler()
        ]);
        map.setZoomRange(0, 22);
        map.setCenterZoom(new com.modestmaps.Location(%(lat).6f, %(lon).6f), %(zoom)d);
        // hashify it
        new MM.Hash(map);
    //-->
    </script>
</body>

I didn't want to deal with it again, so I set the range to the maximum.

I have to thank Dane Springmeyer of MapBox for aiming me in the right direction.

share|improve this answer
    
Thank you for the heads up, will check it out when I have enough time. –  Srisa Oct 3 '13 at 7:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.