Reputation: 141
How do I explicitly load the Data.gmdb cache file in GMap.NET? I tried copying over the file created on my machine to another machine and run the application in offline mode but the cache file (generated in PC1-Online) does not work for PC2-Offline. Is there a way to explicitly load the file?
Upvotes: 2
Views: 5366
Reputation: 1
at least after update to 2.1.7 CacheLocation only works if set in designer.vb
otherwise user/appdata/local folder is used
Upvotes: 0
Reputation: 6494
I think you could try to load your your-cache-file.gmdb
into your application in this way:
In you MainForm_Load
listener do the following:
string pathToExecutable = System.IO.Path.GetDirectoryName(Application.ExecutablePath);
GMaps.Instance.ImportFromGMDB(pathToExecutable + "\your-cache-file.gmdb"); //or just whatever path to your cache
Or in this way:
YourGMapControl.CacheLocation = System.IO.Path.GetDirectoryName(Application.ExecutablePath);
The last one creates TileDBv5/en/Data.gmdb
in your executable directory folder, where cache to be replaced is located.
But! Don't forget about main things:
MainMap.Manager.Mode = AccessMode.ServerAndCache;
mode only. In CacheOnly
it will use allready created cache, in ServerOnly
it will load all the data from server without caching it locally.TilePrefetcher
. Example here.Upvotes: 2