-
Notifications
You must be signed in to change notification settings - Fork 3
SMK Client Configuration
This section presents a complete, annotated SMK map configuration. The configuration is presented as a JSON structure, because that is how it is stored, and passed into the SMK client.
This is the toplevel structure of the JSON object. Click on a key to get more information.
{ "smkId": "smk-demo-app", "smkRevision": 1, "createdBy": "smk", "published": false, "name": "SMK Demo App", "project": "Demo", "viewer": { ... }, "tools": [ ... ], "layers": [ ... ] }
The configuration metadata is the name of the project, who created it, and where it is in it's lifetime.
The values are controlled by the Admin UI, and there is no reason for the application to change them (except possibly "name"
).
{ "smkId": "smk-demo-app", "smkRevision": 1, "createdBy": "smk", "published": false, "name": "SMK Demo App", "project": "Demo", }
"smkId"
: String (REQUIRED)
The identifer for the Map Configuration.
Derived from the name, and used by the Admin UI.
"name"
: String (REQUIRED)
The name of the SMK configuration.
This name is used to identify the configuration in the Admin UI, as well as the title for the script attribute smk-title-sel
"project"
: String (OPTIONAL)
A optional identifier used to group together related map configurations in the Admin UI.
"smkRevision"
: Integer (REQUIRED)
The current version of the Map Configuration. This will increment when a version is published and a new edit version created.
"createdBy"
: String (REQUIRED)
The name of the user (BCeID or IDIR) that created this Map Configuration.
"published"
: Boolean (REQUIRED)
If true
, this project is a published version; otherwise this is an editable, in progress version.
"viewer"
: Object (OPTIONAL)
The viewer section of configuration controls general aspects of the map viewer itself.
{ "viewer": { "type": "leaflet", "baseMap": "Topographic", "clusterOption": { ... }, "location": { "extent": [ -139.1782, 47.6039, -110.3533, 60.5939 ], "center": [ -124.76575, 54.0989 ], "zoom": 5, } } }
"type"
: String (OPTIONAL)
The type of map viewer to use. There are two options:
-
"leaflet"
Use the Leaflet viewer. (Default) -
"esri3d"
Use the ESRI ArcGIS 3D viewer.
"baseMap"
: String (OPTIONAL)
The name of the default basemap to display.
One of these options:
"Topographic"
(Default),
"Streets"
,
"Imagery"
,
"Oceans"
,
"NationalGeographic"
,
"ShadedRelief"
,
"DarkGray"
,
or
"Gray"
.
"clusterOption"
: Object (OPTIONAL)
This option only applies to the leaflet viewer.
A configuration object that is passed to the clustering object constructor.
The options are defined here.
One use for this configuration is to control if the convex hull of clusters is displayed, (default for this option is false
):
{ "viewer": { "clusterOption" {
"showCoverageOnHover": true
} } }
"location"
: Object (OPTIONAL)
The location that map shows when the map starts.
The default value is the map centered on BC, at zoom level 5, which shows the whole province.
"extent"
: Array[Number] (OPTIONAL)
The extent which must be displayed by the map at startup.
The array contains 4 values, which are in order: [MIN-LONG]
,[MIN-LAT]
,[MAX-LONG]
,[MAX-LAT]
.
This take precedence over any center and zoom settings.
"center"
: Array[Number] (OPTIONAL)
The center point of the map at startup.
The array contains 2 values, which are in order: [LONG]
,[LAT]
.
"zoom"
: Integer (OPTIONAL)
The zoom level of the map at startup.
This is a value from 0 (whole world) to 30.
The default value is 5, which shows the whole province of BC.
"tools"
: Array[Object] (OPTIONAL)
The tools section of configuration controls which tools are available for the user.
The tools
array contains an object for each tool type being configured.
All tool objects have these configuration properties:
{ "tools": [ { "type": "about", "title": "About SMK", "enabled": true, "icon": "help", "order": 1, "position": "toolbar" } ] }
Many of the tools have additional configuration that can set. Some of the tools are only available for certain viewers. Enabling a tool that is not available for a particular viewer will have no effect.
These are all the tool types available, click on one to see all the properties (and their default values) for that tool type:
{ "tools": [ { "type": "about" }, { "type": "baseMaps" }, { "type": "coordinate" }, { "type": "directions" }, { "type": "dropdown" }, { "type": "identify" }, { "type": "layers" }, { "type": "location" }, { "type": "markup" }, { "type": "measure" }, { "type": "menu" } { "type": "minimap" }, { "type": "pan" }, { "type": "query" }, { "type": "scale" }, { "type": "search" }, { "type": "select" }, { "type": "version" }, { "type": "zoom" } ] }
"type"
: String (REQUIRED)
The type of tool to configure.
One of these options:
"about"
,
"baseMaps"
,
"coordinate"
,
"directions"
,
"dropdown"
,
"identify"
,
"layers"
,
"location"
,
"markup"
,
"measure"
,
"menu"
,
"minimap"
,
"pan"
,
"query"
,
"scale"
,
"search"
,
"select"
,
"version"
,
or
"zoom"
.
"title"
: String (OPTIONAL)
The title of this tool.
How this property is used depends on the tool type.
Tools that display a button on a toolbar use this property for the button tooltip.
Tools that show a panel use this property for the panel title.
All tools have a default title, but setting this property will override it.
"enabled"
: Boolean (OPTIONAL)
If true
then the tool will be available when the map starts.
If false
, then the tool will not be available.
Most tools are not enabled by default.
"icon"
: String (OPTIONAL)
If the tool adds a button to a toolbar, this property gives the name of the icon to display on the button.
The icon set used is the Material Design Icons.
Each tool has a default value.
"order"
: Integer (OPTIONAL)
If the tool adds a button to a toolbar, this property controls the order in which the tools are added to the toolbar.
The default value is 1
, but some tools have other values as their default.
The tools are added left-to-right in ascending order.
"position"
: String (OPTIONAL)
If the tool adds a button to a toolbar, this property controls which toolbar gets the tool.
The default is "toolbar"
, but some tools have other default values.
The value of this property is "toolbar"
; or it can be the name of another tool that can act as a tool container. The tools that can be containers are "dropdown"
or "menu"
.
The tool container must be enabled.
Add a button to the toolbar, that shows a panel with content that taken from the configuration. It can be used to show any content that the application needs.
{ "tools": [ { "type": "about", "title": "About SMK", "enabled": false, "icon": "help", "order": 1, "position": "toolbar", "content": null } ] }
"content"
: String (OPTIONAL)
The content to show in the panel.
This is assumed to be formatted in HTML.
Any styling should be inline in the HTML, or refer to classes that are defined by the enclosing application.
Add a button to the toolbar, that shows a panel which lets the user choose which base map they want the map to use. This is the list of base maps to choose from. If there is a need to restrict the set of base maps the user can choose from, then set the choices property for this tool.
{ "tools": [ { "type": "baseMaps", "title": "Base Maps", "enabled": false, "icon": "map", "order": 3, "position": "menu", "choices": null } ] }
"choices"
: Array[String] (OPTIONAL)
The list of base maps to let the user choose from.
The names are taken from this list.
Adds a coordinate display to the bottom-right corner of the map. This display shows the current latitude and longitude of the mouse cursor.
{ "tools": [ { "type": "coordinate", "enabled": false, } ] }
Add a button to the toolbar, that shows a panel that allows the user to pick locations on the map, and calculate the fastest (or shortest) route between them.
This tool interacts with the "identify"
and "location"
tools.
When this tool is enabled, the popups for identify and location will contain a button to start a route from that location.
{ "tools": [ { "type": "directions", "title": "Directions", "enabled": true, "icon": "directions_car", "order": 4, "position": "toolbar", "apiKey": "...", } ] }
"apiKey"
: String (REQUIRED)
The API key used to get access the BC Route Planner API.
The API key is required to access the service, the directions tool won't work without it.
Add a button to the toolbar, that shows a panel that contains other tools. The tools are presented as a drop-down list at the top of the panel, using the titles of the tools. When a tool is selected, it's panel is displayed below the drop-down.
{ "tools": [ { "type": "dropdown", "enabled": false, "icon": "arrow_drop_down_circle", "order": 1, "position": "toolbar", } ] }
Add a button to the toolbar, that can show a panel containing a list of features found on the map. When this tool is enabled, clicking on the map will try to identify all features under the click, within tolerance pixels. The results of this search will be display in the panel, if showPanel is true.
{ "tools": [ { "type": "identify", "title": "Identify", "enabled": false, "icon": "info_outline", "order": 4, "position": "toolbar", "showPanel": false, "tolerance": 5, "style": { ... } } ] }
"showPanel"
: Boolean (OPTIONAL)
If true
, then the identify results will be shown in the panel.
If false
, then the panel won't be shown.
Either way the results are still marked on the map, and clicked on to get a popup with details.
"tolerance"
: Number (OPTIONAL)
The distance in pixels from the click point that feature must intersect to be found by this tool.
"style"
: Object (OPTIONAL)
The style used to render the feature markers.
The object is a style definition.
Add a button to the toolbar, that shows a panel that lists all the layers configured for the map. It allows the user to hide or show any layer, and to see the layer legend. Use the display property to organize the layers into folders and groups.
{ "tools": [ { "type": "layers", "title": "Layers", "enabled": false, "icon": "layers", "order": 3, "position": "menu", "display": [ ... ], } ] }
"display"
: Array[Object] (OPTIONAL)
A collection of layer display objects.
If this tool is enabled, then clicking on the map will show a popup giving the clicked point's location.
If the "identify"
or "directions"
tools are enabled, then buttons are visible on this popup with additional actions.
{ "tools": [ { "type": "location", "title": "Location", "enabled": true, } ] }
This tool only works with the leaflet viewer.
Adds markup tools to the map.
{ "tools": [ { "type": "markup", "enabled": false, } ] }
Add a button to the toolbar, that shows a panel that allows the user to measure distances or areas on the map.
{ "tools": [ { "type": "measure", "enabled": false, "icon": "straighten", "order": 2, "position": "toolbar", } ] }
Add a button to the toolbar, that shows a panel that contains other tools. The tools are arranged in a toolbar across the top of the panel. When a tool is selected, it's panel is displayed below the toolbar.
{ "tools": [ { "type": "menu", "enabled": false, "icon": "menu", "order": 1, "position": "toolbar", } ] }
This tool only works with the leaflet viewer.
Adds an overview map in the bottom-right corner of the map.
{ "tools": [ { "type": "minimap", "enabled": false, } ] }
If this tool is enabled, then the user is able to change the center location of the map.
{ "tools": [ { "type": "pan", "enabled": false, } ] }
Add a button to the toolbar, that shows a panel containing an input form. When user fills out the form and clicks the 'Search' button, a query is performed on a layer, and the results are shown at bottom of the panel, as well as on the map.
The queries are defined on layer objects, this tool needs to know which query to use. The instance property must contain the id of the query object (which is associated with a layer).
This tool is the only one that can appear multiple times in the map configuration, but each one must have a different instance value.
The title of the panel and tool button come from the query. The icon, order, and position can be different for each instance value.
{ "tools": [ { "type": "query", "enabled": false, "icon": "question_answer", "order": 4, "position": "toolbar", "instance": null, "style": { ... } } ] }
"instance"
: String (REQUIRED)
This must be the id of a query object.
"style"
: Object (OPTIONAL)
The style used to render the feature markers.
The object is a style definition.
Adds a scale display to the bottom-right corner of the map. This display shows the current scale, and a ruler showing the real ground distance.
{ "tools": [ { "type": "scale", "enabled": false, "showFactor": true "showBar": true } ] }
"showFactor"
: Boolean (OPTIONAL)
If true
, then the scale display shows the scale factor.
"showBar"
: Boolean (OPTIONAL)
If true
, then the scale display shows the distance ruler.
Add a search input field to the toolbar. The text entered in the input field is used to perform a location search. The results are marked on the map, and displayed in a panel.
{ "tools": [ { "type": "search", "title": "Search", "enabled": true, "icon": "search", "order": 2, "position": "toolbar", } ] }
Add a button to the toolbar, that shows a panel containing the current selection set.
When this tool is enabled, the "identify"
tool has an additional action available for features.
The feature can be copied to the selection, so it appears in this panel.
{ "tools": [ { "type": "baseMaps", "title": "Base Maps", "enabled": false, "icon": "map", "order": 3, "position": "menu", "style": { ... } } ] }
"style"
: Object (OPTIONAL)
The style used to render the feature markers.
The object is a style definition.
Add a button to the toolbar, that shows a panel containing the version of SMK, and build information. This is for debugging purposes.
{ "tools": [ { "type": "version", "title": "SMK Build Info", "enabled": false, "icon": "build", "order": 1, "position": "menu" } ] }
If this tool is enabled, then the user is able to change the zoom level of the map.
{ "tools": [ { "type": "zoom", "enabled": false, "mouseWheel": true, "doubleClick": true, "box": true, "control": true } ] }
"mouseWheel"
: Boolean (OPTIONAL)
If true
, then the map can be zoomed with the mouse wheel.
"doubleClick"
: Boolean (OPTIONAL)
If true
, then the map will zoom-in on a double-click.
"box"
: Boolean (OPTIONAL)
If true
, then the user can hold the shift key and drag a box on the map to zoom in.
"control"
: Boolean (OPTIONAL)
If true
, then there are zoom-in, zoom-out buttons on the map.
"layers"
: Array[Object] (OPTIONAL)
The layers section of the configuration determines the layers that displayed above the base map.
The layers
array contains an object for each layer that can be shown on the map.
The first layer object in the array is the top-most layer shown on the map, and the first layer in the "layers"
panel.
All layer objects have these configuration properties:
{ "layers": [ { "id": "layer1", "type": "esri-dynamic", "title": "Layer 1", "opacity": 0.65, "isVisible": true, "isQueryable": true, "minScale": 500000, "maxScale": 0, "attribution": "Copyright 2018", "metadataUrl": "http://catalogue/dataset/aca81811-4b08-4382-9af7-204e0b9d2448", "popupTemplate": "<div class=\"smk-header\"><h3>{{ layer.title }}</h3></div>", "titleAttribute":"INTRID_SID", "attributes": [ ... ], "queries": [ ... ] } ] }
There are the types of layers that can configured:
"id"
: String (REQUIRED)
The unique identifier for the layer.
This MUST be unique within the configuration.
Conventionally it is all lowercase with -
separating words.
"type"
: String (REQUIRED)
The type of layer object.
One of these options:
"esri-dynamic"
,
"wms"
,
or
"vector"
.
"title"
: String (REQUIRED)
The title to show in the "layers"
panel.
"opacity"
: Number (REQUIRED)
The value can be from 0 (completely transparent, invisible) to 1 (opaque).
This opacity value is applied over any opacity that may already configured for the layer on the server where it rendered.
"isVisible"
: Boolean (OPTIONAL)
Should the layer be visible on startup?
Default is false
.
"isQueryable"
: Boolean (OPTIONAL)
Is the layer able to be used for "identify"
tool?
Default is true
.
"minScale"
: Number (OPTIONAL)
This value is the denominator of the scale value.
The default is 0
, which means it is not used.
The layer is visible if the current scale is greater than the minimum scale value for the layer.
"maxScale"
: Number (OPTIONAL)
This value is the denominator of the scale value.
The default is 0
, which means it is not used.
The layer is visible if the current scale is less than the maximum scale value for the layer.
"attribution"
: String (OPTIONAL)
Copyright details and attribution to be displayed in the map viewer container.
"metadataUrl"
: String (OPTIONAL)
The URL used for linking to a metadata source.
"popupTemplate"
: String (OPTIONAL)
A string that contains a Vue template.
The template is used to construct the popup that appears when presenting a feature, in the "identify"
, "query"
, and "select"
tools.
The model that is available to the template:
// layer configuration
layer.id
layer.title
layer.attributes // array of objects: { visible, title, name }
// current feature
feature.id
feature.title
feature.properties // object: attribute key:value
"titleAttribute"
: String (OPTIONAL)
The name of the attribute to use as the title for a feature from this layer.
"attributes"
: Array[Object] (OPTIONAL)
An array of layer attribute objects.
Used to control how feature attributes appear in the popup that is used by the "identify"
, "query"
, and "select"
tools.
The order of the attribute objects, is the order they will appear in the popup.
If this property is null
or missing, then the popup will show all the attributes of the feature, using the internal field names.
If this property is an empty array ([]
), then no attributes will be shown for the feature.
"queries"
: Array[Object] (OPTIONAL)
An array of layer query objects.
Used to define the queries that be executed against this layer.
{ "layers": [ { "id": "fish-points", attributes: [ { "id": "species-code", "name": "SPECIES_CODE", "title": "Species Code", "visible": true } ] } ] }
"id"
: String (REQUIRED)
The unique identifier for the layer attribute.
This MUST be unique within the layer attribute list.
Conventionally it is all lowercase with -
separating words.
"name"
: String (REQUIRED)
The internal name of the attribute.
This must match an attribute name in the feature.
"title"
: String (REQUIRED)
The title for the attribute to show the feature popup.
"visible"
: Boolean (OPTIONAL)
Should the attribute be visible in the popup?
Default is true
.
{ "layers": [ { "id": "fish-points", queries: [ { "id": "species", "title": "Find by species", "description": "Find fish points that match by species code or name.", "parameters": [ ... ], "predicate": { ... } } ] } ] }
"id"
: String (REQUIRED)
The unique identifier for the query.
This MUST be unique within the layer query list.
Conventionally it is all lowercase with -
separating words.
"title"
: String (REQUIRED)
The title for the query, that will be uses for the "query"
tool button.
"description"
: String (REQUIRED)
A longer description of the query, that is shown on the panel above the query parameter form.
"parameters"
: Array[Object] (REQUIRED)
An array of layer query parameter objects.
Used to define the parameters that the user must provide the query.
"predicate"
: Object (REQUIRED)
A layer query predicate object.
Used to define the query that is to be executed against the layer.
Configures a parameter that will be used by the query predicate.
{ "layers": [ { "id": "fish-points", queries: [ { "id": "species", parameters: [ { "id": "species-name", "title": "Species Name or Code", "value": "salmon", "type": "input" } ] } ] } ] }
"id"
: String (REQUIRED)
The unique identifier for the parameter.
This MUST be unique within the layer query parameter list.
Conventionally it is all lowercase with -
separating words.
"title"
: String (REQUIRED)
The title to show in query form for this parameter.
"value"
: String (OPTIONAL)
The default value for the parameter.
If not provided, the user MUST provide a value to execute the query.
"type"
: String (REQUIRED)
The type of form entry field to use.
One of these options:
"constant"
,
"input"
,
"select"
,
or
"select-unique"
.
Use a constant parameter to provide a constant value to the query predicate. If the title is configured, then the constant is shown in query form, otherwise it is hidden.
{ "layers": [ { "id": "fish-points", queries: [ { "id": "species", parameters: [ { "id": "species-name", "value": "salmon", "type": "constant" } ] } ] } ] }
Use an input parameter to provide a value to the query predicate that comes from the user entering into an input field.
{ "layers": [ { "id": "fish-points", queries: [ { "id": "species", parameters: [ { "id": "species-name", "title": "Species Name or Code", "value": "salmon", "type": "input" } ] } ] } ] }
Use a select parameter to provide a value to the query predicate that comes from the user picking a value from a drop-down list.
{ "layers": [ { "id": "fish-points", queries: [ { "id": "species", parameters: [ { "id": "species-name", "title": "Species Name or Code", "value": "salmon", "type": "select", "choices": [ ... ] } ] } ] } ] }
"choices"
: Array[Object] (REQUIRED)
An array of { title, value }
objects to populate a drop-down list.
The title
is optional.
Use a select parameter to provide a value to the query predicate that comes from the user picking a value from a drop-down list. The drop-down list is populated dynamically from the layer by finding all unique values for uniqueAttribute. If the request to populate the drop-down fails, the drop-down field changes to an input field. The choices property may be used as well to provide a fall-back.
DO NOT use this parameter type if you know the number of unique values will be more than a few hundred.
{ "layers": [ { "id": "fish-points", queries: [ { "id": "species", parameters: [ { "id": "species-name", "title": "Species Code", "type": "select-unique", "uniqueAttribute": "SPECIES_CODE" } ] } ] } ] }
"uniqueAttribute"
: Array[Object] (REQUIRED)
The name of the attribute on the layer that will be queried to find all unique values.
Defines the query to be executed against the layer.
{ "layers": [ { "id": "fish-points", queries: [ { "id": "species", predicate: { "operator": "or", "arguments": [ ... ], } ] } ] } ] }
"operator"
: String (REQUIRED)
The operation to apply to the arguments.
One of these options:
"and"
,
"or"
,
"not"
,
"equals"
,
"less-than"
,
"greater-than"
,
"contains"
,
"starts-with"
,
or
"ends-with"
.
The query predicate holds if ALL of it's arguments hold. There must be at least one argument. The arguments are layer query predicate objects.
{ "layers": [ { "id": "fish-points", queries: [ { "id": "species", predicate: { "operator": "and", "arguments": [ ... ], } ] } ] } ] }
The query predicate holds if AT LEAST ONE of it's arguments hold. There must be at least one argument. The argument are layer query predicate objects.
{ "layers": [ { "id": "fish-points", queries: [ { "id": "species", predicate: { "operator": "or", "arguments": [ ... ], } ] } ] } ] }
The query predicate holds if it's argument fails. There must be EXACTLY one argument. The argument is a layer query predicate object.
{ "layers": [ { "id": "fish-points", queries: [ { "id": "species", predicate: { "operator": "not", "arguments": [ ... ], } ] } ] } ] }
The query predicate holds if the first operand equals the second operand. There must be exactly 2 arguments. The arguments are layer query predicate operand objects.
{ "layers": [ { "id": "fish-points", queries: [ { "id": "species", predicate: { "operator": "equals", "arguments": [ ... ], } ] } ] } ] }
The query predicate holds if the first operand is strictly less than the second operand. There must be exactly 2 arguments. The arguments are layer query predicate operand objects.
{ "layers": [ { "id": "fish-points", queries: [ { "id": "species", predicate: { "operator": "less-than", "arguments": [ ... ], } ] } ] } ] }
The query predicate holds if the first operand is strictly greater than the second operand. There must be exactly 2 arguments. The arguments are layer query predicate operand objects.
{ "layers": [ { "id": "fish-points", queries: [ { "id": "species", predicate: { "operator": "greater-than", "arguments": [ ... ], } ] } ] } ] }
The query predicate holds if the first operand contains the second operand. There must be exactly 2 arguments. The arguments are layer query predicate operand objects.
{ "layers": [ { "id": "fish-points", queries: [ { "id": "species", predicate: { "operator": "contains", "arguments": [ ... ], } ] } ] } ] }
The query predicate holds if the first operand starts with the second operand. There must be exactly 2 arguments. The arguments are layer query predicate operand objects.
{ "layers": [ { "id": "fish-points", queries: [ { "id": "species", predicate: { "operator": "starts-with", "arguments": [ ... ], } ] } ] } ] }
The query predicate holds if the first operand ends with the second operand. There must be exactly 2 arguments. The arguments are layer query predicate operand objects.
{ "layers": [ { "id": "fish-points", queries: [ { "id": "species", predicate: { "operator": "ends-with", "arguments": [ ... ], } ] } ] } ] }
Defines an operand of a predicate of a query to be executed against the layer.
{ "layers": [ { "id": "fish-points", queries: [ { "id": "species", predicate: { "operator": "equals", arguments: [ { "operand": "attribute", "name": "FISH_SPECIES" }, { "operand": "parameter", "id": "species" } ] } } ] } ] } ] }
"operand"
: String (REQUIRED)
If the operand is "attribute"
, the name property is the name of an attribute for the layer.
If the operand is "parameter"
, the id property is the id of a parameter defined in this query.
"name"
: String (REQUIRED)
The name of an attribute for this layer.
"id"
: String (REQUIRED)
The id of a parameter defined in this query.
{ "layers": [ { "id": "layer1", "type": "esri-dynamic", "title": "Layer 1", "opacity": 0.65, "isVisible": true, "isQueryable": true, "minScale": 500000, "maxScale": 0, "attribution": "Copyright 2018", "metadataUrl": "http://catalogue/dataset/aca81811-4b08-4382-9af7-204e0b9d2448", "popupTemplate": "<div class=\"smk-header\"><h3>{{ layer.title }}</h3></div>", "titleAttribute":"INTRID_SID", "attributes": [ ... ], "queries": [ ... ], "mpcmId": 123, "mpcmWorkspace": "MPCM_ALL_PUB", "serviceUrl": "https://maps.gov.bc.ca/arcgis/rest/services/mpcm/bcgw/MapServer", "dynamicLayers": [ ... ], } ] }
"mpcmId"
: String (REQUIRED)
The ID used for this layer in the DataBC Layer Catalog.
"mpcmWorkspace"
: String (REQUIRED)
The workspace used for this layer in the DataBC Layer Catalog.
"serviceUrl"
: String (REQUIRED)
The URL for the DataBC Layer Catalog.
"dynamicLayers"
: Array[String] (REQUIRED)
A listing of dynamic layer configurations.
This will typically only contain one dynamic feature, which can be derived from the MPCM Layer Catalog.
{ "layers": [ { "id": "layer1", "type": "wms", "title": "Layer 1", "opacity": 0.65, "isVisible": true, "isQueryable": true, "minScale": 500000, "maxScale": 0, "attribution": "Copyright 2018", "metadataUrl": "http://catalogue/dataset/aca81811-4b08-4382-9af7-204e0b9d2448", "popupTemplate": "<div class=\"smk-header\"><h3>{{ layer.title }}</h3></div>", "titleAttribute":"INTRID_SID", "attributes": [ ... ], "queries": [ ... ], "version": 1.0.0, "layerName": "WHSE_TANTALIS.TA_CROWN_LEASES_SVW", "styleName": "Lease_Applications_Tantalis_Colour_Filled", "serviceUrl": "https://openmaps.gov.bc.ca/geo/pub/wms", "geometryAttribute": "SHAPE" } ] }
"version"
: String (OPTIONAL)
The WMS version used for GetMap, GetFeatureInfo and GetCapabilities WMS requests.
"layerName"
: String (REQUIRED)
The name of the layer to use when making get map requests for the WMS layer.
"styleName"
: String (OPTIONAL)
The name of the style to use when making get map requests for the WMS layer.
"serviceUrl"
: String (REQUIRED)
The URL for the WMS service.
"geometryAttribute"
: String (OPTIONAL)
The name of the layer attribute that contains the geometry.
(Needed by the "identify"
tool).
{ "layers": [ { "id": "layer1", "type": "vector", "title": "Layer 1", "opacity": 0.65, "isVisible": true, "isQueryable": true, "minScale": 500000, "maxScale": 0, "attribution": "Copyright 2018", "metadataUrl": "http://catalogue/dataset/aca81811-4b08-4382-9af7-204e0b9d2448", "popupTemplate": "<div class=\"smk-header\"><h3>{{ layer.title }}</h3></div>", "titleAttribute":"INTRID_SID", "attributes": [ ... ], "queries": [ ... ], "useClustering": false, "useHeatmap": false, "useRaw": true, "style": { ... }, "dataUrl": "@layer1", } ] }
"useClustering"
: Boolean (OPTIONAL)
Indicates if the layer should also include point clustering.
Only relevant for point geometry layers.
The default is false
.
"useHeatmap"
: Boolean (OPTIONAL)
Indicates if the layer should also include heatmap clustering.
Only relevant for point geometry layers.
The default is false
.
"useRaw"
: Boolean (OPTIONAL)
Indicates if the layer should be displayed in its native form, with no heatmapping or clustering.
The default is true
, unless clustering or heatmapping is enabled.
"style"
: Object (OPTIONAL)
The style used to render the layer.
The object is a style definition.
"dataUrl"
: String (OPTIONAL)
The URL that points to a GeoJSON file containing the vector data.
If this property is missing, the id of layer identifies an attachment.
The style definition object.
style: { "strokeWidth": 2, "strokeStyle": "solid", "strokeColor": "red", "strokeOpacity": 0.75, "fillColor": "#3a8f74" "fillOpacity": 0.4, "markerUrl": "foo.com/marker.png", "markerSize": [ 30, 20 ], "markerOffset": [ 15, 10 ] }
"strokeWidth"
: Number (OPTIONAL)
Width of a line or polygon outline.
"strokeStyle"
: String (OPTIONAL)
Display style for a line or polygon outline (solid, dashed, dotted).
"strokeColor"
: String (OPTIONAL)
The CSS-style color code for the line or polygon outline.
"strokeOpacity"
: Number (OPTIONAL)
The opacity of the line or polygon outline.
"fillColor"
: String (OPTIONAL)
The CSS-style color code for the polygon fill.
"fillOpacity"
: Number (OPTIONAL)
The opacity for the polygon fill.
"markerUrl"
: String (OPTIONAL)
The URL or attachment ID to use for custom point marker symbols.
The attachment ID is prefixed with @
.
"markerSize"
: Array[Integer] (OPTIONAL)
The size of the marker image, as array [ [WIDTH]
, [HEIGHT]
].
"markerOffset"
: Array[Integer] (OPTIONAL)
The offset of the marker image from the origin, as array [ [OFFSET-X]
, [OFFSET-Y]
].
The layer display defines how the layers configured for the map are organized when shown in the "layers"
tool).
This configuration allows layers to be organized into folders, which can be nested arbitrarily.
Layers can also be put together into groups, which behave as a single layer, and don't expose their internal structure to user.
This configuration will also control the order in which layers are painted on the map, the top-most layer in this configuration is drawn on top of all other layers.
There are 3 types of objects that make up the layer display definition:
{ "id": "layer1", "type": "layer", "title": "Layer 1", "isVisible": true, }
"id"
: String (REQUIRED)
The id of a layer from the layers section of the configuration.
"type"
: String (REQUIRED)
The type must be "layer"
.
"title"
: String (OPTIONAL)
The title to show for the layer.
Defaults to the title defined in the layers section.
"isVisible"
: Boolean (OPTIONAL)
If the layer is to be visible initially.
Defaults to the isVisible flag defined in the layers section.
{ "id": "folder1", "type": "folder", "title": "Folder 1", "isVisible": true, "isExpanded": false, "items": [ ... ], }
"id"
: String (OPTIONAL)
The id of the folder, which must be unique.
"type"
: String (REQUIRED)
The type must be "folder"
.
"title"
: String (REQUIRED)
The title to show for the folder.
"isVisible"
: Boolean (OPTIONAL)
If the folder is to be visible initially.
Default is true
.
"isExpanded"
: Boolean (OPTIONAL)
If the folder is to be expanded initially
Default is false
.
"items"
: Array[Object] (REQUIRED)
The (layer display objects)[#layer-display-definition] that are contained in the folder.
{ "id": "group1", "type": "group", "title": "Group 1", "isVisible": true, "items": [ ... ], }
"id"
: String (REQUIRED)
The id of the group, which must be unique.
"type"
: String (REQUIRED)
The type must be "group"
.
"title"
: String (REQUIRED)
The title to show for the group.
"isVisible"
: Boolean (OPTIONAL)
If the group is to be visible initially.
Default is true
.
"items"
: Array[Object] (REQUIRED)
The (layer display objects)[#layer-display-definition] that are contained in the group.