A versatile and lightweight toolkit for building a simple web map.
This project is maintained by bcgov
The "viewer"
section of the SMK configuration controls the overall properties of the map.
This includes the type of map engire to use ("type"
property), the starting position of the map ("location"
property), the type of devide the application is running on ("device"
property), and what theme to apply to map’s user interface elements ("themes"
property).
These are the default values for the "viewer"
configuration.
Click on a property name for more information:
{ "viewer": { "type": "leaflet", "device": "auto", "deviceAutoBreakpoint": 500, "themes": null "panelWidth": 300, "baseMap": "BCGov", "esriApiKey": null, "activeTool": null, "minZoom": null, "maxZoom": null, "location": { "extent": [ -139.1782, 47.6039, -110.3533, 60.5939 ], "center": [ -124.76575, 54.0989 ], "zoom": 5, } } }
"type": String
The type of map viewer to use. There is one option:
"leaflet"
- use the Leaflet viewer."device": String
The type of device that the map application is running on. There are three options:
"auto"
- detect the device automatically (see "deviceAutoBreakpoint"
property)."desktop"
- user interface assumes that the device is a desktop computer browser."mobile"
- user interface assumes that the device is a mobile device."deviceAutoBreakpoint": Number
When the "device"
property is "auto"
, this value is used to detect if the device is "desktop"
or "mobile"
.
The width of the browser frame is compared with this property, and if the browser frame width is the larger value, then the "device"
property is "desktop"
; otherwise "mobile"
is used.
"themes": Array
Load additional UI themes at startup. These themes are defined:
"alpha"
"beta"
"gamma"
"delta"
This property and the themes are experimental.
"panelWidth": Number
The width of the UI panel, in pixels.
"baseMap": String
The name of the basemap to display at startup. These are the possible values:
"BCGov"
"BCGovHillshade"
"Topographic"
"Streets"
"Imagery"
"Oceans"
"ShadedRelief"
"DarkGray"
"Gray"
"esriApiKey": String
An Esri API key to use with Esri’s vector basemap service, which is used for all basemaps except BCGov and BCGovHillshade.
To provide an Esri API key, you can create an ArcGIS Developer account for free or use an ArcGIS Online account and then create an API key in the developer dashboard.
If you are not using an Esri basemap, this value can be empty. If you use an empty value with an Esri basemap, no basemap will display.
"activeTool": String
If this property is set to the id of a tool, then this tool will be active when the map is finished initialization.
"minZoom": Number
The map’s minimum zoom level. Set a value to override the default value of 1.
"maxZoom": String
The map’s maximum zoom level. Set a value to override the default value of 22.
"location": String
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.
"location": { "extent": Array }
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.
"location": { "center": Array }
The center point of the map at startup.
The array contains 2 values, which are in order: [LONG]
,[LAT]
.
"location": { "zoom": Number }
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.