I have an application that consumes tile layers via API. If connection brakes, while the application is running, cache is available and I can continue use the map which is fine. If restart the application and network connectivity is still not available, cache is no longer available too.My question is: Is there a way to continue working with that cache after the application is restarted?
MapInfo Pro caches the images in a temp folder for the dedicated session.
You find this location here: %Temp%\MIPRO.
You may have several subfolders depending on your currently running sessions.
In a subfolder named like this MapInfo.Application.x64_19068, you will find the cache folder.
Thank you Peter.
I can't find such a directory, but maybe I don't make something right. Let's say I build and run template project TileServer.csprj. I changed the code a little bit to use the sample from Developer Guide section "Working with Maps from Tile Servers" - "Opening Tile Server via APIs". So I used this sample to run the project with Bing maps and the map is loaded and cache is working, but I can't find such a directory that you mentioned. I see that cache is working since the last loaded tiles are available on the application even if I disconnect my PC from the network.
Ah, you are using MapXtreme and not MapInfo Pro.
Look in this folder instead: %temp%\MapXtreme
I can't find such a directory, but the cache is working. What also confuses me is 'CacheType' property in 'TableInfoTileServer.CacheSettings'. It is set to 'CacheOption.Off'. This option should be set to "On" probably, but if I choose anything different that 'Off' the following exception is thrown:
An unhandled exception of type 'System.AccessViolationException' occurred in TileViewLayer.dll
'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'
Any idea about this exception? Maybe, If I enable the cache explicitly by setting 'CacheSettings.CacheType = CacheOption.On' the cache directory will be created.
That error may also refer to file access, I assume?
Can you also specify a cache folder for the tile server table?