ThinkGeo.com    |     Documentation    |     Premium Support

Does not see any cached tile in local disk

Hi,

I am trying the HowDoI samples for WPF. The one titled “Using tile cache” does not seem to save any tiles into my local folder. The code snippet:

        FileBitmapTileCache bitmapTileCache = new FileBitmapTileCache();
        bitmapTileCache.CacheDirectory = Samples.RootDirectory + @"Data\SampleCacheTiles";
        bitmapTileCache.CacheId = "World02CachedTiles";
        bitmapTileCache.TileAccessMode = TileAccessMode.ReadOnly;
        bitmapTileCache.ImageFormat = TileImageFormat.Png;
        worldOverlay.TileCache = bitmapTileCache;
        worldOverlay.TransitionEffect = TransitionEffect.None;

Thanks,

Liang

Hi Liang_Lu,

Please comment this line:

bitmapTileCache.TileAccessMode = TileAccessMode.ReadOnly;

It means you only read cache but not generate it.

Regards,

Ethan

Hi Ethan,

After commenting out the line, I started to see files adding to the cache directory as program runs. Thank you.

A follow up question, most of the time my program runs on computer with no internet connections at all. Is tile caching a good solution for this situation? Are there any alternatives?

Thanks,

Liang

Hi,

If your data is in local, internet is not important.

If your layer need to connect to internet, the cache is only solution.

Regards,

Ethan