Plugin reference


API

Exposes an API for interacting with QWC2 via window.qwc2.

You can interact with the API as soon as the QWC2ApiReady event is dispatched.

For example:

window.addEventListener("QWC2ApiReady", () => {
     const {React} = window.qwc2.libs;

     class MyPlugin extends React.Component {
         render() {
             return React.createElement("div", {}, "Hello World");
         }
     }

     window.qwc2.addPlugin("MyPlugin", MyPlugin);
});

All following action functions are available:

I.e. setCurrentTask is available via window.qwc2.setCurrentTask.

Some of the core libraries (React, axios, ol, ...) are accessible via window.qwc2.libs.

In addition, the following methods are available on window.qwc2:

addPlugin(name,plugin,translations)

Add custom plugin

  • name: An identifier
  • plugin: The plugin component class
  • translations: The plugin translation messages: {"<lang>": {<messages>}, ...}

removePlugin(name)

Remove custom plugin

  • name: The identifier

addIdentifyAttributeCalculator(name,calcFunc)

Add custom attribute calculator (i.e. computed attributes which are added to GetFeatureInfo responses).

  • name: An identifier
  • calcFunc: The calculator function with signature function(layer, feature)

The calcFunc should return either a two-enty [name, value] pair or a one-value [value] array.

removeIdentifyAttributeCalculator(name)

Remove custom identify attribute calculator

  • name: The identifier

addIdentifyExporter(name,exporterConfig)

Add custom identify exporter

  • name: An identifier
  • exporterFunc: The exporter configuration

The exporter configuration is an object of the shape

{
   id: "<id>",
   title: "<title>",
   allowClipboard: <true|false>,
   export: (features, callback) => {
     callback({
       data: <blob>, type: "<mimeType>", filename: "<filename>"
     });
   }
 }

removeIdentifyExporter(name)

Remove identify exporter

  • name: The identifier

drawScratch(geomType,message,drawMultiple,callback,style)

Deprecated, use window.qwc2.drawGeometry instead.

drawGeometry(geomType,message,callback,options)

Draw geometries, and return these as GeoJSON to the calling application.

  • geomType: Point, LineString, Polygon, Circle or Box.
  • message: A descriptive string to display in the tool taskbar.
  • callback: A function(result, crs), the result being an array of GeoJSON features, and crs the projection of the feature coordinates.
  • options: Optional configuration:
  • drawMultiple: Whether to allow drawing multiple geometries (default: false).
  • style: A custom style object to use for the drawn features, in the same format as DEFAULT_FEATURE_STYLE in qwc2/utils/FeatureStyles.js.
  • initialFeatures: Array of initial geometries.
  • snapping: Whether snapping is available while drawing (default: false).
  • snappingActive: Whether snapping is initially active (default: false)

getState()

Return the current application state.

AttributeTable

Displaying the attribute table of layers in a dialog.

To make a layer available in the attribute table, create a a data resource and matching permissions for it in the qwc-admin-gui.

The attribute table works for both read-only as well as read-write data resources.

This plugin queries the dataset via the editing service specified by editServiceUrl in config.json (by default the qwc-data-service).

Property Type Description Default value
allowAddForGeometryLayers bool Whether to allow adding records for datasets which have a geometry column. undefined
showEditFormButton bool Whether to show a button to open the edit form for selected layer. Requires the Editing plugin to be enabled. true
showLimitToExtent bool Whether to show the "Limit to extent" checkbox undefined
zoomLevel number The zoom level for zooming to point features. 1000

Authentication

Handles authentication

Invokes the the authentication service specified by authServiceUrl in config.json.

Property Type Description Default value
clearLayerParam bool Whether to clear the layer parameter from the URL on login. undefined
idleTimeout number An idle timeout in seconds after which the user is automatically logged of. undefined
logoutTargetUrl string An URL to redirect to on logout, instead of the viewer URL. undefined
requireLogin bool Whether authentication is required, i.e. the viewer automatically redirects to the login page if no user is authenticated. undefined

BackgroundSwitcher

Map button for switching the background layer.

Property Type Description Default value
position number The position slot index of the map button, from the bottom (0: bottom slot). 0

Bookmark

Allows managing user bookmarks.

Bookmarks are only allowed for authenticated users.

Requires permalinkServiceUrl to point to a qwc-permalink-service.

Property Type Description Default value
side string The side of the application on which to display the sidebar. 'right'

BottomBar

Bottom bar, displaying mouse coordinate, scale, etc.

Property Type Description Default value
additionalBottomBarLinks [{
label: string,
labelMsgId: string,
url: string,
urlTarget: string,
icon: string,
}]
Additional bottombar links undefined
displayCoordinates bool Whether to display the coordinates in the bottom bar. true
displayScales bool Whether to display the scale in the bottom bar. true
termsUrl string The URL of the terms label anchor. undefined
termsUrlIcon string Icon of the terms inline window. Relevant only when termsUrlTarget is iframe. undefined
termsUrlTarget string The target where to open the terms URL. If iframe, it will be displayed in an inline window, otherwise in a new tab. You can also use the :iframedialog:<dialogname>:<options> syntax to set up the inline window. undefined
viewertitleUrl string The URL of the viewer title label anchor. undefined
viewertitleUrlIcon string Icon of the viewer title inline window. Relevant only when viewertitleUrl is iframe. undefined
viewertitleUrlTarget string The target where to open the viewer title URL. If iframe, it will be displayed in an inline window, otherwise in a new tab. You can also use the :iframedialog:<dialogname>:<options> syntax to set up the inline window. undefined

CookiePopup

A simple popup to notify that cookies are used.

Cyclomedia

Cyclomedia integration for QWC2.

Property Type Description Default value
apikey string The Cyclomedia API key undefined
clientId string OAuth client ID. undefined
cyclomediaVersion string The cyclomedia version. '24.1'
displayMeasurements bool Whether to display Cyclomedia measurement geometries on the map. true
geometry {
initialWidth: number,
initialHeight: number,
initialX: number,
initialY: number,
initiallyDocked: bool,
side: string,
}
Default window geometry with size, position and docking status. Positive position values (including '0') are related to top (InitialY) and left (InitialX), negative values (including '-0') to bottom (InitialY) and right (InitialX). {
initialWidth: 480,
initialHeight: 640,
initialX: 0,
initialY: 0,
initiallyDocked: false,
side: 'left'
}
loginRedirectUri string The relative path to the redirect login handling of oauth. undefined
logoutRedirectUri string The relative path to the redirect logout handling of oauth. undefined
maxMapScale number The maximum map scale above which the recordings WFS won't be displayed. 5000
projection string The projection to use for Cyclomedia. 'EPSG:3857'

DxfExport

Allows exporting a selected extent of the map as DXF.

Uses the DXF format support of QGIS Server.

Deprecated. Use the MapExport plugin instead.

Property Type Description Default value
formatOptions string Optional format options to pass to QGIS Server via FORMAT_OPTIONS. undefined
layerOptions [{
label: string,
layers: string,
}]
Optional choice of layer sets to pass to QGIS Server via LAYERS. undefined
serviceUrl string Optional URL invoked on export instead of the default QGIS Server URL. undefined

Editing

Allows editing geometries and attributes of datasets.

The attribute form is generated from the QGIS attribute form configuration.

This plugin queries the dataset via the editing service specified by editServiceUrl in config.json (by default the qwc-data-service).

Property Type Description Default value
allowCloneGeometry bool Whether to enable the "Clone existing geometry" functionality. true
side string The side of the application on which to display the sidebar. 'right'
snapping bool Whether snapping is available when editing. true
snappingActive {bool, string} Whether snapping is enabled by default when editing.
Either false, edge, vertex or true (i.e. both vertex and edge).
true
width string The default width of the editing sidebar, as a CSS width string. "30em"

FeatureForm

Displays queried feature attributes in a form.

The attribute form is generated from the QGIS attribute form configuration.

If the dataset it editable, allows editing the attributes directly in the displayed form.

This plugin queries the feature via the editing service specified by editServiceUrl in config.json (by default the qwc-data-service), rather than over WMS GetFeatureInfo like the Identify plugin.

Can be used as default identify tool by setting "identifyTool": "FeatureForm" in config.json.

Property Type Description Default value
exitTaskOnResultsClose bool Whether to clear the task when the results window is closed. undefined
geometry {
initialWidth: number,
initialHeight: number,
initialX: number,
initialY: number,
initiallyDocked: bool,
side: string,
}
Default window geometry with size, position and docking status. Positive position values (including '0') are related to top (InitialY) and left (InitialX), negative values (including '-0') to bottom (InitialY) and right (InitialX). {
initialWidth: 320,
initialHeight: 480,
initialX: 0,
initialY: 0,
initiallyDocked: false,
side: 'left'
}

FeatureSearch

Displays a dialog with a search form for configured QGIS feature searches with one or more input fields.

See Configuring the QGIS feature search.

Property Type Description Default value
side string The side of the application on which to display the sidebar. 'right'

GeometryDigitizer

Allows digitizing geometries to send to configured applications.

Property Type Description Default value
styleActive {
strokeColor: array,
strokeWidth: number,
strokeDash: array,
fillColor: array,
}
The style of active geometries (i.e. supported by the selected application) undefined
styleInactive {
strokeColor: array,
strokeWidth: number,
strokeDash: array,
fillColor: array,
}
The style of inactive (i.e. not supported by the selected application) undefined

HeightProfile

Displays a height profile along a measured line.

Triggered automatically when a line is measured via the Measure plugin.

Requires elevationServiceUrl in config.json to point to a qwc-elevation-service.

The print height profile functionality requires a template located by default at assets/templates/heightprofileprint.html with containing a container element with id=heightprofilecontainer.

Property Type Description Default value
height number The height of the height profile widget in pixels. 150
heightProfilePrecision number The precision of displayed and exported values (0: no decimals, 1: 1 decimal position, etc). 0
samples number The number of elevation samples to query. 500
templatePath string Template location for the height profile print functionality ":/templates/heightprofileprint.html"

Help

Displays a custom help dialog in a sidebar.

Define the help contents by specifying the bodyContentsFragmentUrl prop.

Property Type Description Default value
bodyContentsFragmentUrl string URL to a document containing a HTML fragment to display in the Help sidebar. undefined
side string The side of the application on which to display the sidebar. 'right'

HomeButton

Map button for reverting to the home extent of the theme.

Property Type Description Default value
position number The position slot index of the map button, from the bottom (0: bottom slot). 5
themeFlagBlacklist [string] Omit the button in themes matching one of these flags. undefined
themeFlagWhitelist [string] Only show the button in themes matching one of these flags. undefined

Identify

Displays queried feature attributes.

Uses WMS GetFeatureInfo to query features and displays the result in table, as a HTML fragment or as plain text based on the supported GetFeatureInfo format.

Extendable in combination with the qwc-feature-info-service, which provides support for customized queries and templates for the result presentation.

Property Type Description Default value
attributeCalculator func Optional function for computing derived attributes. See js/IdentifyExtensions.js for details. This prop can be specified in the appConfig.js cfg section. undefined
attributeTransform func Optional function for transforming attribute values. See js/IdentifyExtensions.js for details. This prop can be specified in the appConfig.js cfg section. undefined
clearResultsOnClose bool Whether to clear the identify results when exiting the identify tool. true
customExporters array Optional list of custom exporters to offer along with the built-in exporters. See js/IdentifyExtensions.js for details. This prop can be specified in the appConfig.js cfg section. []
displayResultTree bool Whether to display a tree overview of results (as opposed to a flat list of results). true
enableExport {bool, array} Whether to enable the export functionality. Either true|false or a list of single allowed formats (builtin formats: json, geojson, csv, csvzip) true
exitTaskOnResultsClose bool Whether to clear the task when the results window is closed. undefined
exportGeometry bool Whether to include the geometry in exported features. Default: true. true
featureInfoReturnsLayerName bool Whether to assume that XML GetFeatureInfo responses specify the technical layer name in the name attribute, rather than the layer title. true
geometry {
initialWidth: number,
initialHeight: number,
initialX: number,
initialY: number,
initiallyDocked: bool,
side: string,
}
Default window geometry with size, position and docking status. Positive position values (including '0') are related to top (InitialY) and left (InitialX), negative values (including '-0') to bottom (InitialY) and right (InitialX). {
initialWidth: 240,
initialHeight: 320,
initialX: 0,
initialY: 0,
initiallyDocked: false,
side: 'left'
}
highlightAllResults bool Whether to highlight all results if no result is hovered true
initialRadiusUnits string The initial radius units of the identify dialog in radius mode. One of 'meters', 'feet', 'kilometers', 'miles'. 'meters'
params object Extra params to append to the GetFeatureInfo request (i.e. FI_POINT_TOLERANCE, FI_LINE_TOLERANCE, feature_count, ...). Additionally, region_feature_count and radius_feature_count are supported. undefined
replaceImageUrls bool Whether to replace an attribute value containing an URL to an image with an inline image. true

LayerCatalog

Displays a pre-configured catalog of external layers in a window.

Configured through a catalog JSON containing a tree of external layer identifiers.

For wms layers, sublayers: false denotes that the sublayer structure of the added layer should not be exposed in the layer tree.

Example:

{
  "catalog": [
    {
      "title": "Öffentlicher Verkehr swissTLMRegio",
      "resource": "wms:http://wms.geo.admin.ch#ch.swisstopo.vec200-transportation-oeffentliche-verkehr",
      "sublayers": false
    },
    {
      "title": "Gewässerschutz",
       "resource": "wms:https://geo.so.ch/api/wms#ch.so.afu.gewaesserschutz[50]"
    },
    {
      "title": "Landeskarten",
      "sublayers": [
        {
          "title": "Landeskarte 1:1 Million | LK1000",
          "resource": "wms:http://wms.geo.admin.ch#ch.swisstopo.pixelkarte-farbe-pk1000.noscale"
        },
        {
          "title": "Landeskarte 1:100`000 | LK100",
          "resource": "wms:http://wms.geo.admin.ch#ch.swisstopo.pixelkarte-farbe-pk100.noscale"
        }
      ]
    }
  ]
}
Property Type Description Default value
catalogUrl string The URL to the catalog JSON file. undefined
geometry {
initialWidth: number,
initialHeight: number,
initialX: number,
initialY: number,
initiallyDocked: bool,
side: string,
}
Default window geometry with size, position and docking status. Positive position values (including '0') are related to top (InitialY) and left (InitialX), negative values (including '-0') to bottom (InitialY) and right (InitialX). {
initialWidth: 320,
initialHeight: 320,
initialX: 0,
initialY: 0,
initiallyDocked: false,
side: 'left'
}
levelBasedIndentSize bool Whether to increase the indent size dynamically according to the current level (true) or keep the indent size constant (false). true

LayerTree

Displays the map layer tree in a sidebar.

The print legend functionality requires a template located by default at assets/templates/legendprint.html with containing a container element with id=legendcontainer.

Property Type Description Default value
addLayerSeparator func Whether to allow adding separator entries in the layer tree, useful for organizing the tree. undefined
allowCompare bool Whether to enable the compare function. Requires the MapCompare plugin. true
allowImport bool Whether to allow importing external layers. true
allowMapTips bool Whether to allow enabling map tips. true
allowSelectIdentifyableLayers bool Whether to allow selection of identifyable layers. The showQueryableIcon property should be true to be able to select identifyable layers. false
bboxDependentLegend {bool, string} Whether to display a BBOX dependent legend. Can be true|false|"theme", latter means only for theme layers. false
enableLegendPrint bool Whether to enable the legend print functionality. true
enableServiceInfo bool Whether to display a service info button to display the WMS service metadata. true
enableVisibleFilter bool Whether to display a button to filter invisible layers from the layertree. true
extraLegendParameters string Additional parameters to pass to the GetLegendGraphics request- undefined
flattenGroups bool Whether to display a flat layer tree, omitting any groups. false
grayUnchecked bool Whether to display unchecked layers gray in the layertree. true
groupTogglesSublayers bool Whether toggling a group also toggles all sublayers. false
infoInSettings bool Whether to display the layer info button inside the layer settings menu rather than next to the layer title. true
layerInfoGeometry {
initialWidth: number,
initialHeight: number,
initialX: number,
initialY: number,
initiallyDocked: bool,
}
Default layer info window geometry with size, position and docking status. {
initialWidth: 480,
initialHeight: 480,
initialX: null,
initialY: null,
initiallyDocked: false
}
scaleDependentLegend {bool, string} Whether to display a scale dependent legend. Can be true|false|"theme", latter means only for theme layers. undefined
showLegendIcons bool Whether to display legend icons. true
showQueryableIcon bool Whether to display the queryable icon to indicate that a layer is identifyable. true
showRootEntry bool Whether to display the root entry of the layertree. true
showToggleAllLayersCheckbox bool Whether to display a checkbox to toggle all layers. true
side string The side of the application on which to display the sidebar. 'right'
templatePath string Template location for the legend print functionality ":/templates/legendprint.html"
width string The initial width of the layertree, as a CSS width string. "25em"

LocateButton

Map button for controling the locate (GPS) state.

Property Type Description Default value
position number The position slot index of the map button, from the bottom (0: bottom slot). 2
themeFlagBlacklist [string] Omit the button in themes matching one of these flags. undefined
themeFlagWhitelist [string] Only show the button in themes matching one of these flags. undefined

LoginUser

Displays the currently logged in user.

MapPlugin

The main map component.

Property Type Description Default value
mapOptions {
zoomDuration: number,
enableRotation: bool,
rotation: number,
panStepSize: number,
panPageSize: number,
constrainExtent: bool,
kineticPanParams: object,
}
Zoom duration in ms, rotation in degrees, panStepSize and panPageSize as fraction of map width/height. {}
showLoading bool Whether to display the loading spinner when layers are loading. true
swipeGeometryTypeBlacklist [string] A list of layer geometry types to ignore when determining the top-most layer to compare. []
swipeLayerNameBlacklist [string] A list of layer names to ignore when determining the top-most layer to compare. You can use * as a whildcard character. []
toolsOptions object Map tool configuraiton options. Refer to the sample config.json. {}

MapComparePlugin

Allows comparing the top layer with the rest of the map.

Activated through a checkbox in the LayerTree.

MapCopyright

Displays layer attributions in the bottom right corner of the map.

Property Type Description Default value
prefixCopyrightsWithLayerNames bool Whether to prepend the layer name to the attribution string. undefined
showThemeCopyrightOnly bool Whether to only display the attribution of the theme, omitting external layers. undefined

MapExport

Allows exporting a selected portion of the map to a variety of formats.

Property Type Description Default value
allowedFormats [string] Whitelist of allowed export format mimetypes. If empty, supported formats are listed. undefined
allowedScales {[number], bool} List of scales at which to export the map. If empty, scale can be freely specified. If false, the map can only be exported at the current scale. undefined
defaultFormat string Default export format mimetype. If empty, first available format is used. undefined
defaultScaleFactor number The factor to apply to the map scale to determine the initial export map scale (if allowedScales is not false). 0.5
dpis [number] List of dpis at which to export the map. If empty, the default server dpi is used. undefined
exportExternalLayers bool Whether to include external layers in the image. Requires QGIS Server 3.x! true
formatConfiguration {
format: [{
name: string,
extraQuery: string,
formatOptions: string,
baseLayer: string,
}],
}
Custom export configuration per format.
If more than one configuration per format is provided, a selection combo will be displayed.
extraQuery will be appended to the query string (replacing any existing parameters).
formatOptions will be passed as FORMAT_OPTIONS.
baseLayer will be appended to the LAYERS instead of the background layer.
undefined
pageSizes [{
name: string,
width: number,
height: number,
}]
List of image sizes to offer, in addition to the free-hand selection. The width and height are in millimeters. [
{name: '15 x 15 cm', width: 150, height: 150},
{name: '30 x 30 cm', width: 300, height: 300}
]
side string The side of the application on which to display the sidebar. 'right'

MapFilter

Allows filtering the map content via QGIS Server WMS FILTER.

See Map filtering.

Property Type Description Default value
allowCustomFilters bool Whether to allow custom filters. undefined
allowFilterByGeom bool Whether to allow filter by geometry. Requires the filter_geom plugin from qwc-qgis-server-plugins, and the filter will only be applied to postgis layers. undefined
allowFilterByTime bool Whether to display the temporal filter if temporal dimensions are found. true
highlightStyle {
strokeColor: array,
strokeWidth: number,
strokeDash: array,
fillColor: array,
}
The style used for highlighting filter geometries. {
strokeColor: [0, 0, 0],
fillColor: [255, 255, 0, 0.25]
}
position number The position slot index of the map button, from the bottom (0: bottom slot). Set to -1 to hide the button. 5
side string The side of the application on which to display the sidebar. undefined

MapInfoTooltip

Provides map context information when right-clicking on the map.

Displays the coordinates at the picked position by default.

If elevationServiceUrl in config.json to points to a qwc-elevation-service, the height at the picked position is also displayed.

If mapInfoService in config.json points to a qwc-mapinfo-service, additional custom information according to the qwc-mapinfo-service configuration is returned.

You can pass additional plugin components to the MapInfoTooltip in appConfig.js:

MapInfoTooltipPlugin: MapInfoTooltipPlugin([FirstPlugin, SecondPlugin])

where a Plugin is a React component of the form

class MapInfoTooltipPlugin extends React.Component {
  static propTypes = {
    point: PropTypes.object,
    closePopup: PropTypes.func
  }
  render() { return ...; }
};
Property Type Description Default value
cooPrecision number The number of decimal places to display for metric/imperial coordinates. 0
degreeCooPrecision number The number of decimal places to display for degree coordinates. 4
elevationPrecision number The number of decimal places to display for elevation values. 0
plugins array Additional plugin components for the map info tooltip. []

MapLegend

Displays the map legend in a floating dialog.

The user can toggle whether to display only layers which are enabled, visible in the current extent and/or visible at the current scale.

See https://docs.qgis.org/3.28/en/docs/server_manual/services/wms.html#wms-getlegendgraphic for supported extra legend params.

Property Type Description Default value
addGroupTitles bool Whether to add group titles to the legend. false
addLayerTitles bool Whether to add layer titles to the legend. Note that often the legend image itself already contains the layer title. false
bboxDependentLegend bool Whether to display a BBOX-dependent legend by default. false
excludeLayers array List of layernames to exclude from the legend. []
extraLegendParameters string Extra parameters to add to the GetLegendGraphics request. undefined
geometry {
initialWidth: number,
initialHeight: number,
initialX: number,
initialY: number,
initiallyDocked: bool,
side: string,
}
Default window geometry with size, position and docking status. A locked window is not closeable and not resizeable. Positive position values (including '0') are related to top (InitialY) and left (InitialX), negative values (including '-0') to bottom (InitialY) and right (InitialX). {
initialWidth: 320,
initialHeight: 320,
initialX: 0,
initialY: 0,
initiallyDocked: false,
side: 'left'
}
lockedWindow bool Whether the legend window is locked (always visible, not moveable or closeable). Set position and size via geometry. undefined
onlyVisibleLegend bool Whether to only include enabled layers in the legend by default. false
scaleDependentLegend bool Whether to display a scale-dependent legend by default. false

MapTip

Displays maptips by hovering over features on the map.

Queries the map tips configured in the QGIS layer properites over GetFeatureInfo.

The map tip needs to be configured in QGIS Layer Properties → Display.

Property Type Description Default value
layerFeatureCount number The maximum number of feature maptips to display for a single layer. 5
showFeatureSelection bool Whether to show the maptip feature selection on the map or not true

Measure

Allows measuring points/lines/areas on the map.

Property Type Description Default value
showMeasureModeSwitcher bool Whether to show the widget to switch between measure modes. true
snapping bool Whether snapping is available when editing. true
snappingActive {bool, string} Whether snapping is enabled by default when editing.
Either false, edge, vertex or true (i.e. both vertex and edge).
true

NewsPopup

Displays a newsletter in a popup dialog.

The popup won't be dispayed anymore, if the user chooses so, until a newer revision is published (specified via newsRev prop).

Property Type Description Default value
newsDocument string URL to the news HTML document to display in the popup. undefined
newsRev string Revision of the document. undefined

Portal

Displays a landing lage, consisting of a full-screen theme switcher and a configurable menu.

Property Type Description Default value
bottomBarLinks [{
href: string,
label: string,
labelmsgid: string,
target: string,
}]
Links to show in the portal bottom bar undefined
logo string Name of a logo image below assets/img. undefined
menuItems array Portal menu items, in the same format as the TopBar menu items. []
showMenuOnStartup bool Whether the menu should be visible on startup. undefined
topBarText string Portal title text to show in the top bar. undefined

Print

Invokes QGIS Server WMS GetPrint to print the map to PDF.

Uses the print layouts defined in the QGIS project.

Property Type Description Default value
allowGeoPdfExport bool Whether to allow GeoPDF export. Requires QGIS Server 3.32 or newer. undefined
defaultDpi number The default print dpi. 300
defaultScaleFactor number The factor to apply to the map scale to determine the initial print map scale. 0.5
displayRotation bool Whether to display the map rotation control. true
formats [string] Export layout format mimetypes. If empty, supported formats are listed. If format is not supported by QGIS Server, print will fail undefined
gridInitiallyEnabled bool Whether the grid is enabled by default. false
hideAutopopulatedFields bool Whether to hide form fields which contain autopopulated values (i.e. search result label). undefined
inlinePrintOutput bool Whether to display the print output in an inline dialog instead triggering a download. false
printExternalLayers bool Whether to print external layers. Requires QGIS Server 3.x! true
scaleFactor number Scale factor to apply to line widths, font sizes, ... of redlining drawings passed to GetPrint. 1.9
side string The side of the application on which to display the sidebar. 'right'

ProcessNotifications

Adds support for displaying notifications of background processes.

Only useful for third-party plugins which use this functionality.

RasterExport

Allows exporting a selected portion of the map to an image ("screenshot").

Deprecated. Use the MapExport plugin instead.

Property Type Description Default value
allowedFormats [string] Whitelist of allowed export format mimetypes. If empty, supported formats are listed. undefined
allowedScales [number] List of scales at which to export the map. undefined
defaultFormat string Default export format mimetype. If empty, first available format is used. undefined
defaultScaleFactor number The factor to apply to the map scale to determine the initial export map scale. 0.5
dpis [number] List of dpis at which to export the map. If empty, the default server dpi is used. undefined
exportExternalLayers bool Whether to include external layers in the image. Requires QGIS Server 3.x! true
pageSizes [{
name: string,
width: number,
height: number,
}]
List of image sizes to offer, in addition to the free-hand selection. The width and height are in millimeters. [
{name: '15 x 15 cm', width: 150, height: 150},
{name: '30 x 30 cm', width: 300, height: 300}
]
side string The side of the application on which to display the sidebar. 'right'

Redlining

Allows drawing figures and text labels on the map.

Property Type Description Default value
allowGeometryLabels bool Whether to allow labeling geometric figures. true
snapping bool Whether snapping is available when editing. true
snappingActive {bool, string} Whether snapping is enabled by default when editing.
Either false, edge, vertex or true (i.e. both vertex and edge).
true

Routing

Compute routes and isochrones.

Requites routingServiceUrl in config.json pointing to a Valhalla routing service.

Property Type Description Default value
enabledModes [string] List of enabled routing modes. ["auto", "heavyvehicle", "transit", "bicycle", "pedestrian"]
enabledProviders [string] List of search providers to use for routing location search. ["coordinates", "nominatim"]
geometry {
initialWidth: number,
initialHeight: number,
initialX: number,
initialY: number,
initiallyDocked: bool,
side: string,
}
Default window geometry with size, position and docking status. Positive position values (including '0') are related to top (InitialY) and left (InitialX), negative values (including '-0') to bottom (InitialY) and right (InitialX). {
initialWidth: 320,
initialHeight: 640,
initialX: 0,
initialY: 0,
initiallyDocked: true,
side: 'left'
}
showPinLabels bool Whether to label the routing waypoint pins with the route point number. true

ScratchDrawing

Task which which can be invoked by other tools to draw a geometry and pass it to a callback.

Only useful for third-party code, i.e. over the JavaScript API.

Invoke as setCurrentTask("ScratchDrawing", null, null, {callback: <function(features, crs)>});

Settings

Settings panel.

Allows configuring language and color scheme.

Property Type Description Default value
colorSchemes [{
title: string,
titleMsgId: string,
value: string,
}]
List of available color schemes. Value is the css class name, title/titleMsgId the display name. []
languages [{
title: string,
titleMsgId: string,
value: string,
}]
List of available languages. Value is the lang code, title/titleMsgId the display name. []
showDefaultThemeSelector bool Whether to show a selector to set the default theme/bookmark (of a logged in user). true
side string The side of the application on which to display the sidebar. 'right'

Share

Share the current map as a URL/permalink.

Compact permalinks will be generated if permalinkServiceUrl in config.json points to a qwc-permalink-service.

Property Type Description Default value
showLink bool Show the map URL. true
showQRCode bool Show the QR code of the map URL. true
showSocials {bool, [string]} Show the social buttons. Either true or falseto enable/disable all, or an array of specific buttons to display (possible choices: email, facebook, twitter, linkedin, whatsapp). true
side string The side of the application on which to display the sidebar. 'right'

StartupMarker

Displays a marker when starting up the viewer.

The marked is displayed in the center of the map if c=<x>,<y>&hc=1 is set in the URL.

Property Type Description Default value
removeMode string When to remove the marker. Possible choices: onpan, onzoom, onclickonmarker. 'onpan'

TaskButton

Generic map button to launch a task.

Property Type Description Default value
icon string The icon name. undefined
mode string The task mode. undefined
position number The position slot index of the map button, from the bottom (0: bottom slot). 1
task string The task name. undefined
themeFlagBlacklist [string] Omit the button in themes matching one of these flags. undefined
themeFlagWhitelist [string] Only show the button in themes matching one of these flags. undefined

ThemeSwitcher

Theme switcher panel.

Property Type Description Default value
collapsibleGroups bool Whether to allow collapsing theme groups. undefined
hideAddThemeButton bool Whether to hide the add theme button. Note: the button will also be hidden if the global option allowAddingOtherThemes is false. undefined
hideAddThemeLayersButton bool Whether to hide the add theme layers button. Note: the button will also be hidden if the global option allowAddingOtherThemes is false. undefined
showDefaultThemeSelector bool Whether to show an icon to select the default theme/bookmark (of a logged in user). true
showLayerAfterChangeTheme bool Whether to show the LayerTree by default after switching the theme. false
showThemeFilter bool Wether to show the theme filter field in the top bar. * true
side string The side of the application on which to display the sidebar. 'right'
themeLayersListWindowSize {
width: number,
height: number,
}
The default window size for the theme layers dialog. {width: 400, height: 300}
width string Default width as a CSS string. "50%"

TimeManager

Allows controling the time dimension of temporal WMS layers.

Property Type Description Default value
cursorFormat string The format of the time cursor label. Either date, time or datetime. "datetime"
dateFormat string The date format in the time controls, i.e. YYYY-MM-DD. "YYYY-MM-DD[\n]HH:mm:ss"
defaultAnimationInterval number The default interval for the temporal animation, in seconds. 1
defaultEnabled bool Default for TimeManager enabled when loading application. true or false false
defaultFeatureCount number The default number of features that will be requested. 100
defaultStepSize number The default step size for the temporal animation, in step units. 1
defaultStepUnit string The default step unit for the temporal animation, one of ms, s, m, d, M, y, 10y, 100y "d"
defaultTimelineDisplay string The default timeline display mode. One of hidden, minimal, features, layers. undefined
defaultTimelineMode string The default timeline mode. One of fixed, infinite. "fixed"
geometry {
initialWidth: number,
initialHeight: number,
initialX: number,
initialY: number,
initiallyDocked: bool,
}
Default window geometry with size, position and docking status. Positive position values (including '0') are related to top (InitialY) and left (InitialX), negative values (including '-0') to bottom (InitialY) and right (InitialX). {
initialWidth: 800,
initialHeight: 320,
initiallyDocked: true
}
markerConfiguration {
markersAvailable: bool,
gradient: [string],
markerOffset: array,
markerPins: bool,
}
The feature marker configuration. {
markersAvailable: true,
gradient: ["#f7af7d", "#eacc6e", "#fef89a", "#c5e09b", "#a3d29c", "#7cc096", "#79c8c5", "#34afce"],
markerOffset: [0, 0],
markerPins: true
}
stepUnits [string] The available temporal animation step units. ["s", "m", "h", "d", "M", "y"]

TopBar

Top bar, containing the logo, searchbar, task buttons and app menu.

Property Type Description Default value
appMenuClearsTask bool Whether opening the app menu clears the active task. undefined
appMenuCompact bool Whether show an appMenu compact (menu visible on icons hover) - Only available for desktop client. undefined
appMenuFilterField bool Whether to display the filter field in the app menu. undefined
appMenuHidden bool Whether to hide the app menu (useful primarely as a theme specific setting). undefined
appMenuShortcut string The shortcut for tiggering the app menu, i.e. alt+shift+m. undefined
appMenuVisibleOnStartup bool Whether to open the app menu on application startup. undefined
logoFormat string The logo file format. "svg"
logoSrc string The logo image URL if a different source than the default assets/img/logo. and assets/img/logo-mobile. is desired. undefined
logoUrl string The hyperlink to open when the logo is clicked. undefined
menuItems array The menu items. Refer to the corresponding chapter of the viewer documentation and the sample config.json. []
searchOptions {
allowSearchFilters: bool,
hideResultLabels: bool,
highlightStyle: {
strokeColor: array,
strokeWidth: number,
strokeDash: array,
fillColor: array,
},
minScaleDenom: number,
resultLimit: number,
sectionsDefaultCollapsed: bool,
showLayerAfterChangeTheme: bool,
showProviderSelection: bool,
showProvidersInPlaceholder: bool,
providerSelectionAllowAll: bool,
zoomToLayers: bool,
}
Options passed down to the search component. {}
toolbarItems array The toolbar. Refer to the corresponding chapter of the viewer documentation and the sample config.json. []
toolbarItemsShortcutPrefix string The keyboard shortcut prefix for triggering toolbar tasks. I.e. alt+shift. The task are then triggered by +{1,2,3,...} for the 1st, 2nd, 3rd... toolbar icon. undefined

ZoomButton

Map button for zooming the map.

Two specific plugins exist: ZoomInPlugin and ZoomOutPlugin, which are instances of ZoomButton for the respective zoom directions.

Property Type Description Default value
enableZoomByBoxSelection bool Enable zoom in or out by box selection. undefined
position number The position slot index of the map button, from the bottom (0: bottom slot). undefined
themeFlagBlacklist [string] Omit the button in themes matching one of these flags. undefined
themeFlagWhitelist [string] Only show the button in themes matching one of these flags. undefined

EditingSupport

Editing support for the map component.

LocateSupport

GPS locate support for the map component.

MeasurementSupport

Measurement support for the map component.

Property Type Description Default value
options {
geodesic: bool,
}
Options undefined

OverviewMap

Overview map support for the map component.

Property Type Description Default value
options object See OpenLayers API doc for general options.
Additionally, you can specify:
- layer: Custom overview layer, in the same form as background layer definitions ({type: "<wms|wmts>", "url": ...}).
- viewOptions: Options for the OverviewMap View, see OpenLayers API doc.
undefined

RedliningSupport

Redlining support for the map component.

ScaleBarSupport

Scalebar support for the map component.

Property Type Description Default value
options object See OpenLayers API doc undefined

SnappingSupport

Snapping support for the map component.