WindowsMobile: Cache only

Jun 17, 2010 at 6:26 AM
Hi, Fiest of all: Thats just THE project i was looking for! THank you a million times! Now the harder stuff ;0) I have written a small Application on WinMobile that works fine when Internet is connected, yet when i want to switch to cache only i only get blank tiles (or rather blue ones with an exception overlaying the message that no tile could be loaded). Is there maye a step by step example on how to load caches on mobile? It seems as if Desktop has ShowImportDialog() as method which the Mobile lacks and hence i have to rely on CacheLocation and so on - which obviously does not work.. Might be someone friendly enough to help me?
Coordinator
Jun 17, 2010 at 6:34 AM

hey, ...what's the exception?

Jun 17, 2010 at 6:49 AM
Over the text that says i wouldnt have the needed imagery for that zoom level is a second message that tells me that there is an exception yet no text for it is available.. sorry for that. Btw, i just see that there might be a slight problem with my cache file. Is it right, that a cache of about 20MB in the windows program is exported roughly 4MB large?
Jun 17, 2010 at 7:02 AM
Aha, after i added System.SR.dll as reference to the project (there seems to be a bug with the Windows Mobile 6 SDKs Erroir messages) i can now read the exception: "Exception: No data in local tile cache..."
Coordinator
Jun 17, 2010 at 7:03 AM

try just copy all database to mobile, do not use export

Jun 17, 2010 at 8:13 PM
Edited Jun 17, 2010 at 8:40 PM
ok, i found it in the roaming directory.. but same error (though i only copied the Data.gmdb file) I try to load it with the following code: MapWindow.MapType = GMap.NET.MapType.GoogleTerrain; MapWindow.CurrentPosition = new GMap.NET.PointLatLng(position.Latitude, position.Longitude); MapWindow.Zoom = 15; MapWindow.CacheLocation = tbMap.Text; MapWindow.Manager.Mode = AccessMode.CacheOnly; MapWindow.ReloadMap(); filename is correct..
Coordinator
Jun 17, 2010 at 9:28 PM

?

Jun 17, 2010 at 9:30 PM
Ah.. i see the last message was malformated. The last part was the code i used to load the datafile. Basically i just set leocation and cachelocation with two variables and then refresh the mapview control. Yet to no avail although i use the cache file i found in the roaming directory.
Coordinator
Jun 18, 2010 at 5:09 AM

why do you change cache location?

Jun 18, 2010 at 6:04 AM

first of all because i didnt know there was a defalt path for it and secondly because i would like to have several cache files for different purposes.

Coordinator
Jun 18, 2010 at 6:24 AM

i see, do does it work as expected?

Jun 18, 2010 at 6:28 AM

It still doesnt. Although i use the Datafile from the Roaming directory on windows, having now about 40MB after prefetching GoogleMaps, Terrain and OSM. I just copied this one big file to the mobile and loaded it via CacheLocation and ReloadMap(). Yet this only leads to the 'blue boxes' which give me the exception that i wouldnt have any tiles for that location on my local cahce..  Could you maybe sumarise how to do this? Maybe a simple step by step? I tried to follow the MobileDemo - yet this relies on ServerAndCache and i would lo go on Cache only, preferably on Cache at my own location..

Coordinator
Jun 18, 2010 at 6:54 AM

can you try put it in default location?

Jun 18, 2010 at 7:03 AM

Without touching the location and putting the database into the default directory i get the "No data in local tile cahce.." exception on the map again. With all three tried Maps.

Coordinator
Jun 18, 2010 at 7:32 AM

and where do you put it? On Mobile, if you have sd card, it's there

Jun 18, 2010 at 7:36 AM

It is in "\Speicherkarte\GMap.NET\TileDBv3\en" Maybe there is a language problem? My phone has a german version hence 'Speicherkarte' instead of Storage Card.

 

Coordinator
Jun 18, 2010 at 7:47 AM

it should find it, but anyway, can you debug it?

add breakpoint in GMap.NET.Internals\Cache.cs constructor, then go step by step

Jun 18, 2010 at 7:55 AM

I will do that later when i am on the machine again that i have the source on. I just tried with the sample program for mobile you provide and there the cache works...

Interestering enough - so i guess its somewhere in my implementation :0(

Coordinator
Jun 18, 2010 at 8:21 AM

it's possible, but let me know what was causing it, if you will figure it out

Jun 18, 2010 at 9:38 AM

i guess i will completely rewrite my program.. it seems as if some of my objects are conflicting with yours hence it doesnt work. Now after playing with your demo program i am convinced that it is my implementation yet i dont really see where exactly i went wrong..

anyway as time is a pressing issue at the moment i will completely rewrite my program now.. i hope it works then. If i find time i will try to modify my old code till it works, but first of all i need my program to run ;0)

Jun 18, 2010 at 11:04 AM

When i was redoing your work, trying to imitate as much as possible i found the problem: Its almost a shame, but i didnt copy the interop.dll for sqlite by default.. it was not added to the project and now everything works finde.

 

Could kick my own but at the moment..

Coordinator
Jun 18, 2010 at 11:25 AM

i see ;} good