Skip to content

Client-side Config

The file wwwroot/config.json in TerriaMap contains client-side configuration parameters.

It has this structure:

{
    "initializationUrls" : [
        "myinitfile",
        "anotherinitfile"
    ],
    "parameters": {
        "bingMapsKey": "...",
        ...
    }
}

intializationUrls

Each string in the array specifies a single initialization file (catalog) to be loaded by TerriaJS. The init files are loaded in the order they're specified.

If a string ends with .json, it is assumed to be a complete relative or absolute URL to an init file. The file may be on an entirely separate web server, but in that case it must be accessible for Cross-Origin Resource Sharing (CORS). It may also be generated by a service rather than being a simple static file. If the URL is relative, it is relative to the config file.

If the string does not end with .json, such as "foo", it refers to an init file on the same web server at init/foo.json. In a TerriaMap directory on your computer, it can be found at wwwroot/init/foo.json.

parameters

Specifies various options for configuring TerriaJS:

Option Meaning
"appName" TerriaJS uses this name whenever it needs to display the name of the application.
"autoPlay" true to start playing time-dynamic datasets on load, or false to start them paused.
"bingMapsKey" A Bing Maps API key used for requesting Bing Maps base maps and using the Bing Maps geocoder for searching. It is your responsibility to request a key and comply with all terms and conditions.
"brandBarElements": [ ] An array of strings of HTML that fill up the top left logo space.
"defaultMaximumShownFeatureInfos" The maximum number of "feature info" boxes that can be displayed when clicking a point. (Default: 100)
"disclaimer": {
  "text": "",
  "url": ""
}
This text will be displayed prominently at the bottom of the map, with a clickable link to the URL.
"feedbackUrl" URL of the service used to send feedback. If not specified, the "Give Feedback" button will not appear.
"googleAnalyticsKey" A Google API key for Google Analytics. If specified, TerriaJS will send various events about how it's used to Google Analytics.
"googleAnalyticsOptions" Additional options that will be passed to the Google Analytics call.
"printDisclaimer": {
  "text": "",
  "url": ""
}
Same as disclaimer, except only shown in printed views.
"supportEmail" The email address shown when things go wrong.
"mobileDefaultViewerMode" A string specifying the default view mode to load when running on a mobile platform. Options are: "3DTerrain", "3DSmooth", "2D". (Default: "2D")
"initFragmentPaths" An array of base paths to use to try to use to resolve init fragments in the URL. For example, if this property is [ "init/", "http://example.com/init/"], then a URL with #test will first try to load init/test.json and, if that fails, next try to load http://example.com/init/test.json. If not specified, this property defaults to [ "init/" ].
"disableMyLocation" True to disable the "Centre map at your current location" button.
"disableSplitter" True to disable the use of the splitter control.
"tabbedCatalog" True to create a separate explorer panel tab for each top-level catalog group to list its items in.
"interceptBrowserPrint" True (the default) to intercept the browser's print feature and use a custom one accessible through the Share panel.
"openAddData" True to automatically open Add Data dialog at startup.
"showWelcomeMessage" True to display welcome message on startup.
"showInAppGuides" True to display in-app guides.
"showFeaturePrompts" True to display new feature popups.
"useCesiumIonTerrain" True to use Cesium World Terrain from Cesium ion. False to use terrain from the URL specified with the "cesiumTerrainUrl" property. If this property is false and "cesiumTerrainUrl" is not specified, the 3D view will use a smooth ellipsoid instead of a terrain surface. Defaults to true.
"useCesiumIonBingImagery" True to use Bing Maps from Cesium ion (Cesium World Imagery). By default, Ion will be used, unless the bingMapsKey property is specified, in which case that will be used instead. To disable the Bing Maps layers entirely, set this property to false and set bingMapsKey to null.
"cesiumIonAccessToken" The access token to use with Cesium ion. If "useCesiumIonTerrain" is true and this property is not specified, the Cesium default Ion key will be used. It is a violation of the Ion terms of use to use the default key in a deployed application.
"cesiumTerrainUrl" The URL to use for Cesium terrain in the 3D model. This property is ignored if "useCesiumIonTerrain" is set to true.

Advanced options

These options only need to be changed in unusual deployments. They define the URLs that are accessed for certain additional services, so must be changed if deploying as a static site, for instance.

Option Meaning Default
"conversionServiceBaseUrl" URL of OGR2OGR conversion service (part of TerriaJS-Server). convert/
"corsProxyBaseUrl" URL of CORS proxy service (part of TerriaJS-Server) proxy/
"proj4ServiceBaseUrl" URL of Proj4 projection lookup service (part of TerriaJS-Server) proj4/
"proxyableDomainsUrl" URL of list of domains which the CORS proxy service will allow to be proxied. proxyabledomains/
"regionMappingDefinitionsUrl" URL of the JSON file that defines region mapping for CSV files. build/TerriaJS/data/regionMapping.json