MapInfo Pro Developers User Group

 View Only
  • 1.  Tile caching

    Posted 10-11-2023 05:02

    Hi,

    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?

    Regards,

    Nickie



    ------------------------------
    Nikolay Iliev
    Knowledge Community Shared Account
    ------------------------------


  • 2.  RE: Tile caching

    Employee
    Posted 10-11-2023 08:07

    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.

    In the example above, you can see that my current session has used the PreciselyIron tile server and another WMTS service.
    If you dive into one of these, you'll find the tile server levels as subfolders
    These subfolders will hold additional subfolders and eventually the images that have been cached.
    You may be able to copy this cache structure into a new temp folder for your new session.


    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------



  • 3.  RE: Tile caching

    Posted 10-12-2023 10:18

    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.

    Regards



    ------------------------------
    Nikolay Iliev
    Knowledge Community Shared Account
    ------------------------------



  • 4.  RE: Tile caching

    Employee
    Posted 10-13-2023 06:50

    Ah, you are using MapXtreme and not MapInfo Pro.

    Look in this folder instead: %temp%\MapXtreme



    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------



  • 5.  RE: Tile caching

    Posted 10-17-2023 07:47

    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.

    Regards



    ------------------------------
    Nikolay Iliev
    Knowledge Community Shared Account
    ------------------------------



  • 6.  RE: Tile caching

    Employee
    Posted 10-23-2023 03:01

    That error may also refer to file access, I assume?

    Can you also specify a cache folder for the tile server table?



    ------------------------------
    Peter Horsbøll Møller
    Principal Presales Consultant | Distinguished Engineer
    Precisely | Trust in Data
    ------------------------------