Using a GeoWebCache Server
JMap Web and JMap Mobile applications use an approach based on the production of images and maps generated by JMap Server. The images can be produced as a series of tiles that are adjacent to one another, for each scale level. Lower scale levels contain a small number of tiles, while higher scale levels typically contain a large amount of tiles.
These images are created on request when users navigate on the map in web or mobile applications. Producing these images demands a lot of work from JMap Server and therefore can cause significant delays in these applications. To improve performance, it is recommended to use a tile cache system. This system caches each tile once it is produced and can also ask JMap Server to produce all images of each layer in advance. This operation can require several hours of work during which JMap Server will be very busy. In addition, the sum total of the cached tiles can require a large storage space. This will greatly accelerate navigation in web and mobile applications, since all images will have been produced and made available.
JMap Server is compatible with the open source product GeoWebCache (http://geowebcache.org). However, to improve integration with JMap Admin, K2 Geospatial provides its own slightly adapted version of GeoWebCache. Visit K2 Geospatial's website (http://k2geospatial.com) to download the GeoWebCache installer for JMap Server. In addition to providing a tile cache for JMap applications, this version of GeoWebCache can also prepare maps for offline usage in mobile applications. This will allow users to continue working without a network connection using maps that have been loaded in local mode on their devices.
Configuring GeoWebCache in JMap
To use GeoWebCache in conjunction with JMap Server, JMap Admin must be configured to provide JMap with the settings to connect to GeoWebCache. Refer to the JMap Server Settings section for more information on configuring these settings.
Providing more than one URL towards GeoWebCache enables web and mobile applications to launch more image queries simultaneously, which improves performance when loading the map. These URLs must use domain names or IP addresses that point to the same GeoWebCache instance.
The username and password configured are used to establish communication with GeoWebCache. These settings must match the configuration in GeoWebCache. Read below for more information on configuring GeoWebCache.
Configuring GeoWebCache
GeoWebCache is not included with JMap and must be installed separately. For more information on installing and configuring GeoWebCache, read the following article.
Using GeoWebCache for mobile and web applications
If GeoWebCache is correctly installed and configured, you can use it with web and mobile applications. Usage of GeoWebCache for these types of applications is configured when these are deployed. In the information section of a web or mobile application that has already been deployed, there is a subsection titled Cached layers. This subsection displays the list of layers for which the Cached or Offline options were activated upon deployment (refer to the Web and Mobile Applications section).
Interface for managing cache for JMap Web and JMap Mobile applications
Cache state
For each layer, click on Seed to launch the production of the tile cache. This process can be cancelled by clicking on Cancel. To delete the cache for a layer, click on Delete. Cache production can take a very long time. If you wish to manage the cache directly in Geowebcache interface, click Manage in Geowebcache.
Offline cache state
Offline cache allows mobile application users to navigate on the map without a network connection. To enable this, part of the tiles for certain layers are stored directly on their mobile devices. To make a layer available offline, you must activate the Offline option when deploying the application. In addition, you must select the scale levels that will be available offline. It is important to limit the number of offline levels to avoid overloading mobile devices. Avoid selecting the highest scale level as it is also the largest (refer to the Web and Mobile Applications section).
Selecting scale levels offline when deploying the mobile application
You must select Build to ask GeoWebCache to prepare the cache for each layer to work in offline mode. This option is only available if the status of a layer's cache is set to Available. If the offline cache is already ready, you can delete it by clicking on Delete.