Hi, I'd like to know if there was a way to save tiles into a directory and use them for offline use. The tiles need to be premanently stored and reuploaded upon application launch.
WorldMapKitDesktopOverlay Offline Use
Gary,
Thanks for your question you can easily add Tile Caching to your WorldMapKitDesktopOverlay and this will prevent the Overlay from contacting the server if the tile already exists in the TileCache. To do this you can do the following code:
FileBitmapTileCache offlineTilecache = new FileBitmapTileCache(@“C:\Temp\WorlMapKitCache”, “WorldMapKit”);
worldMapKitDesktopOverlay.TileCache = offlineTilecache;
However when I was doing some testing I noticed one drawback with this approach, when the application is first launched it currently needs to contact the server to get some WMS Information, my approach above will only work if you the application is launched with an internet connection and then goes offline while the application is still up. There may be an easy enhancement we can make to the WorldMapKitDesktopOverlay where it won’t make this initial call to the server on startup if that is a requirement for you.
Also to delete the tile cache you can do this anytime by calling the following method on FitleBitmapTileCache object.
offlineTilecache.DeleteTiles();
Thanks!
This enhancement, would I edit this myself or when you say "we can make to WorldMapKitDesktopOverlay" you mean changing the actual SDK.
Gary,
After further research my original answer was a poor one. The WorldMapKitDesktopOverlay by default actually has it’s own tile cache setup and you don’t need to set your own unless you really want too. As far as the enhancement for the WorldMapKitDesktopOverlay to work offline one of the developers here actually just implemented this feature and it will be available in the daily development build if you want to test it out on Monday.
Thanks!
I’ve never tried this before so I don’t know if it only works in the latest version, but with the latest version I was able to setup a cache and automatically save tiles into a folder. Then I was able to close the program and reopen it with my internet disconnected and view the tiles I had previously caches. Works perfectly thanks!
Thanks Gary, glad it’s working!