Tilelayer zoom out error

Topics: General Topics
Nov 18, 2013 at 8:13 AM

I have a tilelayer using one of my own tile caches. It works fine, but it goes blank when I zoom out beyond a certain scale. My desired behavior is that it will show level 1 from far out until it zooms to level 2 etc.

Is there a way I can force this using the brutile tileschema (like manually adding an extra resolution or something?)
Nov 18, 2013 at 12:07 PM
Have you tried setting up logging to see what is going on

Watch out what is going on when you zoom out very far.
Nov 18, 2013 at 12:25 PM
Hi Felix,

I get a FileIO.FileNotFound error from brutile.dll, So I guess its calculating the file path from the zoom level and then trying to find a directory/file that does not exist. But instead of drawing the nearst matching layer, it just draws nothing. Is there a setting or something that can force it to use the nearest match?

Nov 18, 2013 at 2:30 PM

your tile schema must not provide information for zoom levels you don't have any tiles for. If you create your tileSchema with the default constructor, you can remove individual resolution entries afterwards.

If that is ok the FindNeareastZoomLevel function should provide valid information.
Nov 18, 2013 at 2:45 PM
I only have the resolutions for the zoom levels I have.

But for some reason it won't zoom out beyond the top level level 1.

Are you saying that i don't need to provide any resolutions to the tileschema?

Nov 18, 2013 at 7:34 PM
I just recalled that there is an issue with the BruTile library provided with NuGet.

Maybe this applies here as well.
Nov 20, 2013 at 8:59 AM
I stepped through the code, and it was indeed looking for a level 0 tile.

I tried modifying the code so that it would create a level 0 and it didn't work as it seemed to throw the extents for the other layers out. I found that if I added a level 0 to the cache, but didn't add it to the resolution collection then it would work fine.

Bit weird, but it seemed to work ok!
Nov 20, 2013 at 12:29 PM
That is exactly the issue that became appearant in the thread I mentioned. An MBTiles file with defined ZoomLevels from 7 to 12 that wouldn't show up.
Is your file cache based on BingMaps ?
Nov 20, 2013 at 1:01 PM
Its a custom tilecache that I built based on the code in the createTiles Sample project. So basically I load my sharpmap with my data and then run this process and it generates the tilecache and tileschema for me. All worked great until I added in level 0 then it all went out of line. the cache is using EPSG: 3857 if that helps/

Leaving out the resolution of zoom level 0 made it all work though. maybe a division by zero error somewhere along the line?