Skip to content
This repository has been archived by the owner on Aug 27, 2021. It is now read-only.

Startup Parameters

QQNLUAQ edited this page Jun 1, 2018 · 3 revisions

Configuration

<script src="smk-bootstrap.js" smk-config="[CONFIG]"> where [CONFIG] is a list of configuration specifiers separated by |, which can be:

  • a URL pointing to a configuration JSON file.
  • a literal JSON-encoded configuration blob.
  • a [OPTION]=[VALUE] sequence, where valid patterns for [OPTION]=[VALUE] are defined below.
  • a ?[PREFIX] sequence, which indicates that the document URLs parameters should be parsed, and any keys that start with [PREFIX] interpreted as SMK configuration. The [PREFIX] can be an zero-length string.

URL arguments

Arguments parsed from the URL are of the form: [PREFIX][OPTION]=[VALUE] where [PREFIX] is as above, and valid patterns for [OPTION]=[VALUE] are defined below.

Options

  • config=[CONFIG], where [CONFIG] is a URL or a literal JSON blob
  • viewer=leafet|esri3d
  • extent=[MIN-X],[MIN-Y],[MAX-X],[MAX-Y]
  • center=[X],[Y],[ZOOM]
  • active-tool=[TOOL-TYPE]{,[TOOL-INSTANCE]}
  • query=[LAYER-ID],[CONJUNCTION],[CLAUSE]{,[CLAUSE]...}
  • query=[LAYER-ID],[CONJUNCTION],[CLAUSE]{,[CLAUSE]...}
  • layer=esri-dynamic,[URL],[MPCM-ID]{,[TITLE]} (currently not functional)
  • layer=wms,[URL],[LAYER-NAME]{,[STYLE-NAME]{,[TITLE]}}
  • layer=vector,[URL]{,[TITLE]}
  • show-tool=all|[TOOL-TYPE]{,[TOOL-TYPE]...}
  • hide-tool=all|[TOOL-TYPE]{,[TOOL-TYPE]...}
  • show-layer=all|[LAYER-ID]{,[LAYER-ID]...}
  • hide-layer=all|[LAYER-ID]{,[LAYER-ID]...}
  • ll=[X],[Y]
  • z=[ZOOM]

Notes

If not specified, smk-config is defined like smk-config="?smk-", so that by default SMK is looking at the URL for config. The default for the viewer in the admin UI is to set smk-config="?" so that SMK parameters don't need a prefix.

Specify an non-blank value for smk-config attribute, like smk-config="configuration.json" to prevent the URL arguments from being examined.

Add "?smk-" to smk-config attribute at position the configuration it should be merged. Usually this will be after the configuration file url, so smk-config attribute might look like: smk-config="configuration.json|?smk-"

The configuration settings are merged together strictly from left to right in smk-config, and recursively in the URL arguments.

[X] is longitude, [Y] is latitude. No other coordinate systems are supported.

The show-tool=all has maybe surprising behaviour. It enables all tools that have already defined by previous configurations. It does not add all tools to the configuration. It is exactly the opposite of hide-tools=all, which disables all tools currently configured.