How to use local maptile-files with GMap.NET

Topics: Help
Feb 21, 2011 at 7:59 AM

First of all, thanks for the great thing that is called GMap.NET! :)

So I have been toying around with it a bit and so far really liked it! However, I would need to use only locally stored maptiles for this one project that has to work even without an internet connection. I looked around a bit in the code and so far I've changed the MakeImageUrl -method (to generate URI pointing at a the local files instead). Then, however, I checked from where this was called and realized it wasn't quite that simple.

So basically, what should I do in order to use my locally stored files (under <the folder that contains the binary>/<zoomLevel>/<X>/<Y>.png)? I only have the files for zoom levels 0-5 anyways, and that's all I need. Now I just need to figure out how to use them :)

Feb 21, 2011 at 12:02 PM

I have a win forms app the does

GMaps.Instance.Mode = AccessMode.CacheOnly;   or   GMaps.Instance.Mode = AccessMode.ServerAndCache;

in its initialisation based on saved settings. I tried running it with my network disabled and it works fine in CacheOnly mode, except that message "No internet connection available, going to CacheOnly mode." is displayed. Maybe this message should not be displayed it it is already in CacheOnly mode.
 
Remeber to fill the cache database with all the all the data you will want when running in CacheOnly mode without getting blacklisted becase you downloaded too much.