Jump to content
We've recently updated our Privacy Statement, available here. ×
  • Offline Maps in Spotfire


    Map tiles (or tiles web map, slippy map, or raster tiles) are a map displayed on your Map Chart by seamlessly joining dozens of individually requested image files over the internet. They are convenient because they are loaded on-demand over the internet but there are some cases where it is desired to work with maps offline. That's the reason why Spotfire allows the use of a local override of the default map service.

    In this guide, you will learn how to host map tiles locally for use in Spotfire.

    Download the Map Tiles

    This guide comes with a pre-downloaded map tiles package (maplayer.zip) containing worldwide raster tiles and vector tiles (used for PDF export) down to zoom level 6 (level 0 is the lowest level of details). It is precise enough to visualize data at country, state (Admin-1), and county (Admin-2) levels offline.

    You can download the package (maplayer.zip) at the bottom of this page.

    You can also download map tiles for a specific geographic area or for additional zoom levels for use offline. To do that you will need to follow the latest section of this article "Creating a custom Map Tiles Package".

    Setup a Localhost Server to host the Map Tiles

    1. Go to Control Panel > Programs > Turn Windows features on or off.
    2. Check "Internet Information Services".


    3. Click OK.

    Enable Cross-origin Resource Sharing (CORS)

    CORS must be activated on Internet Information Services to enable fetching vector tiles used for PDF Exports of map charts in Spotfire.

    1. Go to Control Panel > Administrative Tools
    2. Open Internet Information Services (IIS) Manager
    3. Open HTTP Response Headers


    4. Click Add and enter the following setting:

      Name: Access-Control-Allow-Origin

      Value: *


    5. Click OK.

    Install the Map Tiles

    1. If not done already, extract the (Download the maplayer.zip file from the Resources section at the bottom of this article) archive you previously downloaded
    2. Move the "maplayer" folder in your localhost directory (Local Disk > inetpub > wwwroot).



    3. Eventually, if the offline map will be called from a different domain than localhost, modify the URL in the JSON Files (services-list & offline map).



    Configure Spotfire

    The offline map tiles are ready to be used in Spotfire. You simply need to change the default Map service URL to your locally hosted tiles.

    1. Start Spotfire.
    2. Go to Tools > Options > Map Chart.
    3. Check "Custom URL" and replace the default URL with the URL of your locally hosted tiles service list (Should be http://localhost/maplayer/services-list.json).


    4. Click OK and restart Spotfire (A change of map service will only take effect after the program has been restarted).

    Configure Spotfire Web Player

    If you need the Spotfire Web Player to use offline tiles, you simply need to change the default Map Service URL to your locally hosted tiles in the Administration Manager.

    1. Start Spotfire.
    2. Go to Tools > Administration Manager > Preferences > Everyone > MapChart > MapChartPreferences
    3. Enter URL of your locally hosted tiles service list (Example: http://localhost/maplayer/services-list.json) in "DefaultWebMapServiceListUrl" and "DefaultHttpsWebMapServiceListUrl"
    4. Close.

    Creating a Custom Map Tiles Package

    This part of the guide provides guidance on how to download map tiles from Spotfire GeoAnalytics map service using QGIS.

    Note that this method is way to download raster tiles to be used offline in your Spotfire analysis. This method does not support downloading vector tiles necessary to support offline PDF Exports of map charts in Spotfire.

    QGIS is a free, open-source professional GIS software available for Windows, macOS and Linux used to create and edit geospatial information. The instructions below are based on QGIS 3.6.

    Install and configure QGIS

    1. Download, install and start QGIS
    2. Go to Plugins > Manage and Install Plugins...
    3. Install the "Tiles XYZ" plugin and close the Plugins windows


    Add the Spotfire GeoAnalytics map tiles

    From the Browser panel, right-click XYZ Tiles and create a New Connection with the following information:

    • Name: Spotfire GeoAnalytics
    • URL: It depends on the style of the map you would like to download:
      • Light map: https://geoanalytics.spotfire.com/tile/standard_map/{z}/{x}/{y}.png
      • Dark map: https://geoanalytics.spotfire.com/tile/rich_ref_map_dark/{z}/{x}/{y}.png
    • Min. Zoom Level: 1
    • Max. Zoom Level: 18
    • Referrer: © OpenStreetMap Contributors
    • Tile Resolution: Standard (256x256 / 96 DPI)


    Click OK and double-click the Spotfire GeoAnalytics XYZ Tiles service you just created. The Spotfire GeoAnalytics map is now added to QGIS and visible from the Map View.



    Downloading the Map Tiles

    The guide comes with a map tiles package template containing the files necessary for Spotfire to make your map work offline.

    1. Download the template package (maplayer-template.zip) at the bottom of this page.
    2. Extract the archive and rename the folder to "maplayer"
    3. Go back to QGIS
    4. Open the Processing Toolbox (Ctrl + Alt + T), double-click "Generate XYZ Tiles (Directory)" and enter the following information:

      - Extent: Select "Use Canvas Extent"

      - Minimum Zoom: Choose the minimum zoom level (level 0 the lowest, level 18 the most precise)

      - Maximum Zoom: Choose the maximum zoom level (level 0 the lowest, level 18 the most precise)

      The higher the number of zoom levels you select the longer it will take to download the tiles and the more storage space will be required from your local drive.

      We don't recommend downloading tiles from zoom level 10 and upper.


    5. Click "Run". Map Tiles are now downloading. This process can take a while depending on the number of zoom levels and their precisions.

    Configure the Template Package

    1. Go to the maplayer folder you previously downloaded and extracted
    2. Open offlinemap.json with a text editor
    3. Change the value for the following lines:

      - minScale = The minimum zoom value you set in QGIS

      - maxScale = The maximum zoom value you set in QGIS


    4. Save and close the file

    Your custom Map Tiles package is now ready to use with Spotfire. You can follow the steps described at the top of the page.




    User Feedback

    Recommended Comments

    There are no comments to display.

  • Create New...