Using a GeoWebCache Server
<< Click to Display Table of Contents >> Navigation: Deploying JMap Applications > Using a GeoWebCache Server |
JMap Web and JMap Mobile applications use an approach based on the production of map images 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 (small scale, few details on a large portion of territory), while higher scale levels typically contain a large amount of tiles (large scale, many details on a large portion of territory).
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 considerable storage space. Afterwards, 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 JMap 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.
Using GeoWebCache with JMap
Configuring JMap to use GeoWebCache
To use GeoWebCache in conjunction with JMap Server, JMap Admin must be configured to provide JMap with the settings to connect to GeoWebCache. These settings are entered in the section JMap Server > Settings.
The URL to GeoWebCache indicates the JMap Server address that communicates with GeoWebCache. 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 (e.g. cache1.jmaponline.net, cache2.jmaponline.net).
The username and password configured allow JMap Server to connect to GeoWebCache and send it commands. For instance, JMap Server can ask GeoWebCache to create, delete or update tile caches. These settings must match the configuration in GeoWebCache. Read below for more information on configuring GeoWebCache.
See the JMap Server Settings section for more information on configuring these settings.
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. It is when you configure layers that you can select the Cached and Offline (mobile only) options. See JMap Web Applications and JMap Mobile Applications.
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 (JMap Web and Mobile) or Offline (JMap Mobile only) options were activated. This section allows you to manage caching and access the GeoWebCache management console.
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 the Geowebcache interfaces, click on Manage in Geowebcache.
Interface for managing cache for JMap Web and JMap Mobile applications
Offline cache state
You must click on Create in order to instruct GeoWebCache to prepare the cache for offline mode for each layer. This option is only available if the cache state for a layer is set to Available. This operation may take several minutes, depending on the size of the cache. If the offline cache is ready, you can delete it by clicking on Delete.