Quantcast
Viewing all articles
Browse latest Browse all 2341

Created Unassigned: Pan map with offline cache causes crash [26013]

Been working on an MS Access 2003 project that uses MapWinGIS 4.9.3.5. Running on Windows 10 (64bit), and using OpenStreetMap tiles.

Immediate goal is to cache tiles so the program can be used offline. Finally got to a place where I can pan through the map while online, thus saving the tiles into a disk cache (.db3) for later use. Then I disconnect Internet access on the computer and try displaying the tiles when offline. Running into an issue when try to display an area where I haven't previous visited (ie. a cached tile does not exist for that area). About half the time it handles the situation gracefully by just displaying a blank tile background, while other times it crashes Access immediately.

Trying to find a common set of conditions that causes an immediate crash. Haven't found anything that is 100% consistent, but these two things cause the most frequent crashes:

1. pan to an area off the edge of the cached area. Move the map around several times (e.g. 3-5 separate pan operations). Often crashes

2. within a cached area, increase the zoom level beyond what was cached originally (e.g. I had panned thru the map at zoom level 10 while ONline, and now try try to pan thru it at zoom level 11 while OFFline.)

This is the code used to set up the map for caching the tiles:

Private Sub ConfigureOfflineMaps()
Dim sFilename As String
Dim sPathname As String
With axMap.Tiles
.DoCaching(tkCacheType.Disk) = True
.DoCaching(tkCacheType.RAM) = False
dhParsePath CurrentDb.Name, sPathname, sFilename
.DiskCacheFilename = sPathname & "\" & APPLICATIONNAME & ".db3"
.MaxCacheSize(tkCacheType.Disk) = 500
End With
End Sub

A second issue that causes a lot of head-scratching was to try to share a common .db3 file between this program and the new release of MapWindow 5. I had configured MW5 to store a cache file, panned thru a large area at various zoom levels, then pointed my program (MapWinGIS) to the same cache file. It consistently crashed Access. I gave up on that tack for now, but it is a goal for the future. In concept, is it feasible to share the cache file between the two applications, or is that concept just out of the question?

Finally, I tried to use the Prefetch command but could not figure out how to configure the final parameter in the call statement (MWStopExecution). Any advice for that command would be appreciated. So instead of prefetching the tiles, I just scrubbed thru the map while online to visit all the areas of interest.

(I also did this while writing this message: connected to Internet, opened the map with caching enabled, panned to new sections of map (worked OK), disconnected Internet, panned the map ==> crash Access)

Viewing all articles
Browse latest Browse all 2341

Trending Articles