ThinkGeo.com    |     Documentation    |     Premium Support

ThinkGeo V12 Is tile caching allowed on a BingMapsOverlay

Hi ThinkGeo

We have a BingMapsOverlay and we can set a TileCache property on the overlay. We create a new FileRasterTileCache and set it
And we can also see that several directories are created on disk. E.g 17/70039, 17/70040 and so forth in the folder we point to in FileRasterTileCache. But no tiles are written to disk only the directory structure are created.
It this because Bing does not allowed tiles to be cache locally?

Best regards
Jesper

Jesper,
I did some test base on the sample you sent to us. I do see some files cached.

Your previous sample using the following code to replace the bing map click event.

    private void Bing_Click(object sender, RoutedEventArgs e)
    {
        _wpfMap.Overlays.Clear();
         BingMapsOverlay bingMapsOverlay = new BingMapsOverlay("Your ID");

        //OpenStreetMapOverlay bingMapsOverlay = new OpenStreetMapOverlay();

        bingMapsOverlay.TileCache = new FileRasterTileCache(@"C:\sample\CacheFolder\", "Bingmap");
        // new FileBitmapTileCache(tileCacheFolder, "Bingmap");

        // bingMapsOverlay.MapType = BingMapsMapType.Road;
        _wpfMap.Overlays.Add(bingMapsOverlay);
        _wpfMap.Refresh();
    }

Thanks

Frank

Hi Frank

returning to the caching issue.
I setup cache as you described it, and after app start, cache folder is filled with valid tiles. Tough, we noticed that setting _bingMapsOverlay.IsCacheOnly = true; prevents rendering of the tiles. Event those that already cached in the folder. Check this sample:
private void _wpfMap_Loaded(object sender, RoutedEventArgs e)
{
_bingMapsOverlay = new BingMapsOverlay(BingMapsApiKey);
_bingMapsOverlay.TileCache = new FileRasterTileCache(@".\TileCache", “bing”);
_bingMapsOverlay.MapType = BingMapsMapType.Road;
_bingMapsOverlay.IsVisible = true;
_bingMapsOverlay.IsCacheOnly = true; /// <<< Cache option

Are we doing something wrong?

With best regards
Alex

Thanks Alexey,
We have fixed this one. Could you get the latest beta nugget package and try again.

Thanks

Frank