Skip to content

Commit

Permalink
Merge pull request #81 from bcgov/geomark_feature
Browse files Browse the repository at this point in the history
Geomark feature
  • Loading branch information
michaelpnelson authored Nov 29, 2021
2 parents 716ff2b + 2469955 commit 32c8a51
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 12 deletions.
9 changes: 9 additions & 0 deletions docs/edit-tool.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand Down
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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 <benjubb@gmail.com>",
Expand All @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion smk-create/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' ]
}
] )
Expand Down
9 changes: 9 additions & 0 deletions smk-create/template-default/resources/smk-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
}
]
}
9 changes: 9 additions & 0 deletions smk-create/template-mobile/resources/smk-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
]
}
12 changes: 12 additions & 0 deletions smk-edit/static/components/edit-tool-details-geomark.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div>
<edit-tool-details
v-bind:toolType="toolType"
v-bind:toolInstance="toolInstance"
></edit-tool-details>

<div class="row">
<input-checkbox class="col s6"
v-model="enableCreateFromFile"
>Enable option to create a geomark from a file</input-checkbox>
</div>
</div>
19 changes: 19 additions & 0 deletions smk-edit/static/components/edit-tool-details-geomark.js
Original file line number Diff line number Diff line change
@@ -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 } )
}
}
}
} )
} )
1 change: 1 addition & 0 deletions smk-edit/static/components/edit-tool.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
5 changes: 5 additions & 0 deletions smk-edit/static/components/presentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
15 changes: 15 additions & 0 deletions smk-edit/static/store/config-tool-geomark.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export default {
filters: {
'geomark': {
get: function ( tool ) {
return Object.assign( {
title: 'Geomark',
order: 3,
enableCreateFromFile: false
}, tool )
},
}
},
actions: {
}
}
2 changes: 2 additions & 0 deletions smk-edit/static/store/config-tools.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -20,6 +21,7 @@ export default mix( [
configToolBaseMaps,
configToolBespoke,
configToolDirections,
configToolGeomark,
configToolIdentify,
configToolLayers,
configToolListMenu,
Expand Down

0 comments on commit 32c8a51

Please sign in to comment.