I get an OutOfMemory exception when zooming in/out or while panning the map. The issue seems to have been caused by the Caching for the BingMapsOverlay. When I commented out the lines of the following code the OutOfMemory exception stopped appearing. Is there something I am doing wrong in the implementation of the Caching?
1.
bingMapsOverlay =
new
BingMapsOverlay(
"As*************************************************-R"
, BingMapsMapType.Road);
2.
// bingMapsOverlay.CacheDirectory = @"C:\Temp\BING";
3.
// bingMapsOverlay.TileType = TileType.MultipleTile;
4.
// InMemoryBitmapTileCache bitmapTileCache = new InMemoryBitmapTileCache();
5.
// bitmapTileCache.MaximumTilesCount = 1000;
6.
// bingMapsOverlay.TileCache = bitmapTileCache;
7.
// bingMapsOverlay.TileCache.CacheId = "BingCache";
8.
wpfMap1.Overlays.Add(
"BING"
, bingMapsOverlay);