Caching Map Data - SuperWEB2
The Map View tab in SuperWEB2 requires a connection to an external map server to obtain both the geographical shapes used in the layers (for example, the shapes of the states and suburbs that will be overlaid onto the map as coloured layers) and the imagery used in the tiles of the underlying map.
To increase the performance of Map View, SuperWEB2 has two caching mechanisms. These mechanisms keep local copies of the information required to display the map, so that it is not necessary to query the external server every time a user loads a map.
Geometry Cache
The geometry cache is activated by default and cannot be turned off. It automatically keeps a local copy of the geographical shape data from the mapping server. These cached files are saved in the following location by default (see below for details on changing the location of the cache directory): <tomcat_home>\work\Catalina\localhost\webapi.
If the ArcGIS server geography changes, you will need to delete the local cache and restart the SuperWEB2 server:
- Update the geographies in your external ArcGIS server.
- Stop Tomcat/the SuperWEB2 service.
Delete the relevant cache files for the layer you want to update.
The names of the cache files follow this convention:
<arcgis_host>@<arcgis_service>@<layer_id>@<spatial_reference>
Where:
<arcgis_host>
indicates the host name of the ArcGIS server.<arcgis_service>
indicates the name of the service on the ArcGIS server that is providing the geographical layer data.<layer_id>
indicates the ID (from ArcGIS) of the layer data this file contains.<spatial_reference>
is the ArcGIS spatial reference for this layer.
You can therefore find the appropriate files by checking the layer ID in the filename (there may be multiple cache files for a particular layer).
- Restart Tomcat/the SuperWEB2 service.
- Generate a map containing the new geography to populate the cache with the new data from the map server.
Disconnected Mode
Mapping also has a special mode you can activate that allows you to run SuperWEB2 without an active connection to the ArcGIS server. To use this feature, you need to first populate SuperWEB2's cache of mapping data with geographical data for all your thematic layers. Once you have populated the cache, you can turn off the ArcGIS server and continue to use Map View without an active connection to ArcGIS.
The Map View edit buttons (which allow users to add or remove areas from the map) are not available when mapping is running in disconnected mode.
Activate Disconnected Mode
To use this mode:
- Populate the cache by doing the following:
- Generate a map in Map View for all levels of all mapping hierarchies and for all datasets. This will create cache files in the cache directory (<tomcat_home>\work\Catalina\localhost\webapi by default).
- Download a KMZ file for each level of all mapping hierarchies. This will create an additional file in the cache directory.
In SuperADMIN, use the following command to turn on disconnected mode:
CODEcfg global superweb2.mapping.disconnectedMode set true
For each thematic layer, remove the
dynamicImageLayerIds
anddynamicImageServiceURL
settings. You will also need to remove these settings from the defaults layer, if they have been defined there. For example:CODE> cfg global superweb2.mapping.thematic.defaults.dynamicImageServiceURL remove superweb2.mapping.thematic.defaults.dynamicImageServiceURL : Removed > cfg global superweb2.mapping.thematic.layers[0].dynamicImageLayerIds remove superweb2.mapping.thematic.layers[0].dynamicImageLayerIds : Removed > cfg global superweb2.mapping.thematic.layers[0].dynamicImageServiceURL remove superweb2.mapping.thematic.layers[0].dynamicImageServiceURL : Removed > cfg global superweb2.mapping.thematic.layers[1].dynamicImageLayerIds remove superweb2.mapping.thematic.layers[1].dynamicImageLayerIds : Removed > cfg global superweb2.mapping.thematic.layers[1].dynamicImageServiceURL remove superweb2.mapping.thematic.layers[1].dynamicImageServiceURL : Removed
Once you have completed these steps, SuperWEB2 will have enough cached mapping information to run without an active connection to the ArcGIS server.
Refresh the Cache
If the geographical data changes you will will need to repopulate the cache, as follows:
- Ensure the ArcGIS server is available.
- Add the
dynamicImageLayerIds
anddynamicImageServiceURL
settings back into the mapping configuration in SuperADMIN. - Clear the contents of the SuperWEB2 mapping cache directory (<tomcat_home>\work\Catalina\localhost\webapi).
- Use Map View to regenerate maps for all levels of all hierarchies, and re-download KMZ files for every level of the mapping hierarchies.
- Once you have completed these steps to regenerate the cache, you can remove the
dynamicImageLayerIds
anddynamicImageServiceURL
settings in SuperADMIN.
Cache Location
By default, SuperWEB2 generates the mapping cache files in <tomcat_home>\work\Catalina\localhost\webapi, but you can configure SuperWEB2 to write to another directory if necessary:
- Open <tomcat_home>\webapps\webapi\WEB-INF\classes\configuration.properties in a text editor.
Locate the following property:
CODEmap.mapCacheLocation=
Set this to the full path to the directory you want to use. Make sure that the directory exists and that the user running Tomcat has permission to write to it. If you are using Windows, you must escape each slash in the file path with an additional slash. For example:
CODEmap.mapCacheLocation=c:\\str\\sw2MapCache
- Save your changes and restart Tomcat or the SuperWEB2 service.