diff --git a/docs/edit-tool.md b/docs/edit-tool.md index 701c1d4..78b743c 100644 --- a/docs/edit-tool.md +++ b/docs/edit-tool.md @@ -6,6 +6,7 @@ Several tools have unique configurations that allow you to tailor their behaviou - [Base Maps](#base-maps) - [Bespoke](#bespoke) - [Directions](#directions) +- [Geomark](#geomark) - [Identify](#identify) - [Layers](#layers) - [List Menu](#list-menu) @@ -154,6 +155,14 @@ In Addtional to the default settings for a tool, you can specify the following o ![Route Planner Panel](route-planner.png) +## Geomark + +The Geomark tool allows creating and loading geomarks. A geomark is an area of interest that is stored in a web service and can be shared by a URL. A geomark can be created in SMK by drawing one or more shapes and saving the drawing as a geomark. A geomark can also be loaded by its URL. + +### Enable Option to Create a Geomark from a File + +When checked, `Enable Option to Create a Geomark from a File` will add an option to the panel that opens a browser tab to the page of the geomark web service where a file can be uploaded to create a new geomark. The geomark's URL can then be used to load a geomark in SMK. This is an alternative to drawing a shape in SMK and saving it as a geomark. + ## Identify The Identify tool allows users to receive attribute details about layers in your application by clicking on the map. See [Edit Layers](edit-layer.md) for information on settings visible attributes and allowing a layer to be identifiable. diff --git a/package-lock.json b/package-lock.json index 3044ca0..9a41be9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,15 +1,15 @@ { "name": "@bcgov/smk-cli", - "version": "1.0.2", + "version": "1.0.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@bcgov/smk-cli", - "version": "1.0.2", + "version": "1.0.3", "license": "(MIT OR Apache-2.0)", "dependencies": { - "@bcgov/smk": ">=1.0.6", + "@bcgov/smk": ">=1.0.7", "@tmcw/togeojson": "^4.1.0", "chalk": "^4.1.0", "cors": "^2.8.5", @@ -46,9 +46,9 @@ } }, "node_modules/@bcgov/smk": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@bcgov/smk/-/smk-1.0.6.tgz", - "integrity": "sha512-+KDt6AouL7cOvJloSg4nPnwMXlLzE9A+GmJx2/ieG2XaHEQ2XmmtcOyDW0sRVYR/kgc/JeBp9XH+Uo7VztyvJg==" + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@bcgov/smk/-/smk-1.0.7.tgz", + "integrity": "sha512-AXBEYMZoEjtVSJW4c52mSpkiYoz1XHWZ7Y7z36l4brpWB2bZmJTXh2IK+a8G3C7bnQ/lGHoJjSM1lPfmsHEDxQ==" }, "node_modules/@tmcw/togeojson": { "version": "4.5.0", @@ -3072,9 +3072,9 @@ }, "dependencies": { "@bcgov/smk": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/@bcgov/smk/-/smk-1.0.6.tgz", - "integrity": "sha512-+KDt6AouL7cOvJloSg4nPnwMXlLzE9A+GmJx2/ieG2XaHEQ2XmmtcOyDW0sRVYR/kgc/JeBp9XH+Uo7VztyvJg==" + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/@bcgov/smk/-/smk-1.0.7.tgz", + "integrity": "sha512-AXBEYMZoEjtVSJW4c52mSpkiYoz1XHWZ7Y7z36l4brpWB2bZmJTXh2IK+a8G3C7bnQ/lGHoJjSM1lPfmsHEDxQ==" }, "@tmcw/togeojson": { "version": "4.5.0", diff --git a/package.json b/package.json index 4abfc51..f657ae4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@bcgov/smk-cli", - "version": "1.0.2", + "version": "1.0.3", "description": "A utility for creating and configuring a Simple Map Kit project", "main": "index.js", "author": "Ben Jubb ", @@ -16,7 +16,7 @@ "debug": "./index.js edit --open no --base build/test-app --ping 300000" }, "dependencies": { - "@bcgov/smk": ">=1.0.6", + "@bcgov/smk": ">=1.0.7", "@tmcw/togeojson": "^4.1.0", "chalk": "^4.1.0", "cors": "^2.8.5", diff --git a/smk-create/index.js b/smk-create/index.js index 056b2b9..f8deeed 100644 --- a/smk-create/index.js +++ b/smk-create/index.js @@ -161,7 +161,7 @@ async function inquireAppInfo( name, baseDir, package, version ) { name: 'tools', type: 'checkbox', message: 'Select the tools:', - choices: [ 'about', 'coordinate', 'layers', 'pan', 'zoom', 'measure', 'markup', 'scale', 'minimap', 'directions', 'location', 'select', 'identify', 'search' ], + choices: [ 'about', 'coordinate', 'layers', 'pan', 'zoom', 'measure', 'markup', 'scale', 'minimap', 'directions', 'location', 'select', 'identify', 'search', 'geomark' ], default: [ 'about', 'coordinate', 'layers', 'pan', 'zoom', 'scale', 'minimap', 'identify', 'search' ] } ] ) diff --git a/smk-create/template-default/resources/smk-config.json b/smk-create/template-default/resources/smk-config.json index e4e0652..a71c03c 100755 --- a/smk-create/template-default/resources/smk-config.json +++ b/smk-create/template-default/resources/smk-config.json @@ -111,6 +111,15 @@ { "type": "select", "enabled": <%= !!app.tool.select %> + }, + { + "type": "geomark", + "geomarkService": { + "url": "https://apps.gov.bc.ca/pub/geomark" + }, + "enableCreateFromFile": false, + "position": "list-menu", + "enabled": <%= !!app.tool.geomark %> } ] } \ No newline at end of file diff --git a/smk-create/template-mobile/resources/smk-config.json b/smk-create/template-mobile/resources/smk-config.json index 6d27922..08bb99c 100755 --- a/smk-create/template-mobile/resources/smk-config.json +++ b/smk-create/template-mobile/resources/smk-config.json @@ -123,6 +123,15 @@ "type": "select", "enabled": <%= !!app.tool.select %>, "position": "list-menu" + }, + { + "type": "geomark", + "geomarkService": { + "url": "https://apps.gov.bc.ca/pub/geomark" + }, + "enableCreateFromFile": false, + "position": "list-menu", + "enabled": false } ] } \ No newline at end of file diff --git a/smk-edit/static/components/edit-tool-details-geomark.html b/smk-edit/static/components/edit-tool-details-geomark.html new file mode 100644 index 0000000..d8972db --- /dev/null +++ b/smk-edit/static/components/edit-tool-details-geomark.html @@ -0,0 +1,12 @@ +
+ + +
+ Enable option to create a geomark from a file +
+
diff --git a/smk-edit/static/components/edit-tool-details-geomark.js b/smk-edit/static/components/edit-tool-details-geomark.js new file mode 100644 index 0000000..3b58209 --- /dev/null +++ b/smk-edit/static/components/edit-tool-details-geomark.js @@ -0,0 +1,19 @@ +import { vueComponent, importComponents } from '../vue-util.js' + +export default importComponents( [ + './components/edit-tool-details.js', +] ).then( function () { + return vueComponent( import.meta.url, { + props: [ 'toolType', 'toolInstance' ], + computed: { + enableCreateFromFile: { + get: function () { + return this.$store.getters.configTool( this.toolType, this.toolInstance ).enableCreateFromFile + }, + set: function ( val ) { + this.$store.dispatch( 'configTool', { type: this.toolType, instance: this.toolInstance, enableCreateFromFile: val } ) + } + } + } + } ) +} ) \ No newline at end of file diff --git a/smk-edit/static/components/edit-tool.js b/smk-edit/static/components/edit-tool.js index aeb71d3..2d792da 100644 --- a/smk-edit/static/components/edit-tool.js +++ b/smk-edit/static/components/edit-tool.js @@ -9,6 +9,7 @@ export default importComponents( [ './components/edit-tool-content-bespoke.js', './components/edit-tool-details-bespoke.js', './components/edit-tool-details-directions.js', + './components/edit-tool-details-geomark.js', './components/edit-tool-details-identify.js', './components/edit-tool-details-layers.js', './components/edit-tool-details-query.js', diff --git a/smk-edit/static/components/presentation.js b/smk-edit/static/components/presentation.js index 480f6fb..fd1c103 100644 --- a/smk-edit/static/components/presentation.js +++ b/smk-edit/static/components/presentation.js @@ -74,6 +74,11 @@ export const toolTypePresentation = { // icon: '', // instance: false // }, + 'geomark': { + title: 'Geomark', + details: 'edit-tool-details-geomark', + default: {} + }, 'identify': { title: 'Identify', details: 'edit-tool-details-identify', diff --git a/smk-edit/static/store/config-tool-geomark.js b/smk-edit/static/store/config-tool-geomark.js new file mode 100644 index 0000000..de36f62 --- /dev/null +++ b/smk-edit/static/store/config-tool-geomark.js @@ -0,0 +1,15 @@ +export default { + filters: { + 'geomark': { + get: function ( tool ) { + return Object.assign( { + title: 'Geomark', + order: 3, + enableCreateFromFile: false + }, tool ) + }, + } + }, + actions: { + } +} diff --git a/smk-edit/static/store/config-tools.js b/smk-edit/static/store/config-tools.js index 7441b92..2efaa37 100644 --- a/smk-edit/static/store/config-tools.js +++ b/smk-edit/static/store/config-tools.js @@ -2,6 +2,7 @@ import configToolAbout from './config-tool-about.js' import configToolBaseMaps from './config-tool-baseMaps.js' import configToolBespoke from './config-tool-bespoke.js' import configToolDirections from './config-tool-directions.js' +import configToolGeomark from './config-tool-geomark.js' import configToolIdentify from './config-tool-identify.js' import configToolLayers from './config-tool-layers.js' import configToolListMenu from './config-tool-list-menu.js' @@ -20,6 +21,7 @@ export default mix( [ configToolBaseMaps, configToolBespoke, configToolDirections, + configToolGeomark, configToolIdentify, configToolLayers, configToolListMenu,