TilePrefetcher and missing methods?

Topics: Help, Windows Forms
Aug 27, 2013 at 2:17 PM
Hi!

I'm trying to use TilePreFetcher() in my app. I know it works in the demo.
I tried to do this in my code:
                            using (GMap.NET.TilePrefetcher obj = new GMap.NET.TilePrefetcher())
                            {
                                //obj.Overlay = overlay; // set overlay if you want to see cache progress on the map

                                //obj.Shuffle = MainMap.Manager.Mode != AccessMode.CacheOnly;

                                obj.Owner = this;
                                obj.ShowCompleteMessage = true;
                                obj.Start(area, 10, myMap.MapProvider, 100);
                            }
The reaseon obj.Overlay and obj.Shuffle is commented out is because Visual studio claims they do not exist.

When I run my program and select an area and then use tileprefetcher it seems to work fine except when it is done it says: "Prefetch Complete! => 0 of 6". And when I run my program again it aint cached. If I cache with the Demo it works.

Also I found that the demo used some events called: OnTileCacheComplete, OnTileCacheStart, OnTileCacheProgress. My map controll doesn't seem to have those. On the other hand the methods they use seems to be in the TilePrefetcher.cs so.
Aug 27, 2013 at 3:58 PM
try update to latest version
Aug 28, 2013 at 10:08 AM
Thank you! All the methods are there.

However, I'm afraid, prefetching doesn't seem to work. In my app it still says "Prefetch Complete! => 0 of x". While it is fetching it says 1 of x, 2 of x, ... , x of x.
What I want is for my app to let the user to manualy choose an area to cache so it will be there if the computer later lacks an internet connection.
I read some where that I have to use GMap.NET.AccessMode.ServerAndCache; for it too work but that makes it cach automaticly if I zoom/move to a new area on the map.

I tried in the Demo to set to ServerOnly and then fetch and it sayed "Prefetch Complete! => x of x" but when I restart the program and choose cache only or turn of internet the area I fetched is not there.
So in the end it doesnt matter if I "prefetch" or not as long as have ServerAndCache. Which means the caching is automatic.
How can I make it pure manual?

Thank you!
Aug 28, 2013 at 10:58 AM
set mode to ServerAndCache, launch prefetcher form, close it, set mode to cache only
Aug 28, 2013 at 12:10 PM
Thanks again, it works!

It still says 0 => x but I just make sure the user dont see it. It is obviously something I've missed but nvm the program does what it is supose to.