Skip to content
This repository has been archived by the owner on Dec 17, 2022. It is now read-only.

Configuration

unicolet edited this page Aug 25, 2012 · 7 revisions

Mappu can be configured by editing a Javascript file that lives in the application root directory:

<WEBROOT>/static/maps/en/1.1/

and for Italian:

<WEBROOT>/static/maps/it/1.1/

Note there can be many copies of this file, usually one copy per language. Since Mappu by default supports English and Italian there will be two copies to edit at the locations shown above.

It is possible to symlink the two files together to reduce administrative overhead.

This is the default configuration file that ships with Mappu:

var WMSCONFIG = {
	use_cache: true,
	server_path : "/geoserver/wms",
	wfs_server_path : "/geoserver/wfs",
	server_cache_path : "/geoserver/gwc/service/wms",
	default_srs: "EPSG:3003",
	// enable use of regexps in link matching
	extended_link_regex: true,
	// attempt to save memory and improve performance
	// might confuse the reordering of layers
	remove_wms_layers_when_not_used: false,
	// set to the desired initial zoom level or false to have the map calculate the
	// most appropriate one based on the map's extent
	default_zoom_level: false
};
var APPCONFIG = {
	title: "Sample",
	print: {
		chrome: "/chrome.html",
		firefox: "/firefox.html",
		other: "/other.html"
	},
	admin_user: "admin",
	advanced_options: "/mapsocial/",
	// disable application usage tips globally
	showTips: true
};

Configuration has been split in two blocks: one for the WxS services and the other for the application interface.

WxS Services

Mappu uses WMS and WFS services to fetch and browse cartographic data. Mappu has extensively been tested with Geoserver versions >= 2.1.x. Some limited testing was also done on Mapserver. For optimal results Geoserver is recommended, but in principle any WxS compliant provider should work out of the box.

The WMSCONFIG section simply tells Mappu:

  • server_path : the url at which the WMS service is available. This url must be in the same domain as the Mappu server or the GetCapabilities request will be blocked by the browser
  • wfs_server_path : same as above, but for the WFS service
  • server_cache_path : to improve performance most WMS services are fronted by a cache (GeoServer uses GeoWebCache by default). This parameter tells Mappu where such cache is located. Please note that the cache will be used on if the next parameter is set to true
  • use_cache : enables the cache (see previous param)
  • extended_link_regex : enables the use of the regex operator in the link matching engine (See the link section of the User Manual)
  • remove_wms_layers_when_not_used : this is an experimental feature, which attempts to conserve browser resources and enhance responsiveness by removing not selected layers from the map. Enable with care
  • default_zoom_level : the zoom level at which Mappu should open the initial view upon login. If disabled (i.e. set to false) Mappu will attempt to select the most appropriate zoom level by looking at the bounding box returned in the GetCapabilities response

Application interface

  • title : the text shown in top left corner of the application
  • print : deprecated, will be removed in next version
  • admin_user : the login of the admin user. Used to enable the advanced options link in the layer pane.
  • advanced_options : the url of the Grails application that allows user, link, search and tips management
  • showTips : setting to enable or disable usage tips shown on login. If false overrides user setting of true.
Clone this wiki locally