Skip to content

DTVF: Settings

Michael Hillman edited this page Oct 21, 2022 · 18 revisions

This page details how to set up and configure global parameters and some of the more advanced features offered by the Digital Twin Visualisation Framework (DTVF). These are listed here (rather than in committed README files) as they are likely to pertain to the DTVF as a whole, independent of the selected map provider.

Each of these features/configuration options should be specified within a settings.json file within the hosted directory of the visualisation (i.e. next to the index.html file). The file should be a standard JSON object with one (or more) of the following fields.

Map Imagery

By default, a number of base imagery layers are provided by the framework; these are the Light, Dark, Outdoors, and Satellite styles provided by Mapbox, and can be used within Mapbox and Cesium visualisations. However, these options can be overridden by adding an imagery node to the settings file. When present, this node should contained a list of key-value pairs in which the key is the user displayed name of the imagery layer, and the value its URL (your access token will be appended at runtime). Additionally, a default entry can be added to set the pre-selected imagery when loading the map.

An example of a custom imagery node is shown below.

"imagery": {
    "Light": "https://api.mapbox.com/styles/v1/cmclinnovations/cl6p66equ000314pj8v0p60ub/tiles/256/{z}/{x}/{y}?access_token=",
    "Dark": "https://api.mapbox.com/styles/v1/cmclinnovations/cl6owj7v2000415q1oj9aq5zq/tiles/256/{z}/{x}/{y}?access_token=",
    "Outdoors": "https://api.mapbox.com/styles/v1/cmclinnovations/cl6p69s56000t14p47gpfhg1o/tiles/256/{z}/{x}/{y}?access_token=",
    "Satellite (Raw)": "https://api.mapbox.com/styles/v1/mapbox/satellite-v9/tiles/256/{z}/{x}/{y}?access_token=",
    "Satellite (Labelled)": "https://api.mapbox.com/styles/v1/mapbox/satellite-streets-v11/tiles/256/{z}/{x}/{y}?access_token=",
    "default": "Dark"
},

Feature Fields

Some features within the framework require each location to have an in-built name and description (such as the box shown when mousing over a location). by default, these fields within the data need to be named name and description; however, if the data uses fields with other names then you can remap these by using a fields node within the settings. An example of using different fields in place of the name and description is shown below.

"fields": {
    "name": "full_id",
    "description": "operator"
}

Feature Searching

TODO

Attribution

If users wish, or are required, to show attributions for their visualisatied data, then a HTML string can be added to the settings.json file under the attribution variable name. When present, this will display a collapsable attributions box in the lower left of the visualisation.