Skip to content

Commit

Permalink
wip: Refactor the layout using new KDK capabilities #154
Browse files Browse the repository at this point in the history
  • Loading branch information
Christophe Nouguier committed Feb 10, 2021
1 parent f2ab1ca commit b1ffcd3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 24 deletions.
12 changes: 12 additions & 0 deletions config/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ const globeEngine = {
}
}

const widgets = [
{ id: 'information-box', icon: 'las la-digital-tachograph', component: 'widget/KInformationBox', bind: '$data.selection' },
{ id: 'time-series', icon: 'las la-chart-line', component: 'widget/KTimeSeries', bind: '$data' },
{ id: 'mapillary-viewer', icon: 'img:statics/mapillary-icon.svg', component: 'widget/KMapillaryViewer' }
]

module.exports = {
// Special alias to host loopback interface in cordova
// domain: 'http://10.0.2.2:8081',
Expand Down Expand Up @@ -365,6 +371,9 @@ module.exports = {
{ component: 'KTimeline' }
]
},
window: {
widgets: widgets
},
fab: {
actions: [
{ id: 'create-layer', icon: 'las la-plus', label: 'mixins.activity.CREATE_LAYER', handler: { name: 'onCreateLayer' } },
Expand Down Expand Up @@ -421,6 +430,9 @@ module.exports = {
{ component: 'KTimeline' }
]
},
window: {
widget: widgets
},
fab: {
actions: [
{ id: 'probe-location', icon: 'las la-eye-dropper', tooltip: 'mixins.activity.PROBE', handler: { name: 'onProbeLocation' } }
Expand Down
14 changes: 2 additions & 12 deletions src/components/GlobeActivity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,13 @@ export default {
},
methods: {
async refreshActivity () {
this.clearActivity()
this.condifureActivity()
const token = this.$store.get('capabilities.api.cesium.token')
// Not yet ready wait for capabilities to be there
if (!token) return
// Wait until viewer is ready
await this.initializeGlobe(token)
// Setup the panes
this.configureTopPane()
this.configureBottomPane()
this.configureRightPane()
this.configureFab()
const widgets = [
{ name: 'information-box', icon: 'las la-digital-tachograph', component: 'widget/KInformationBox', props: this.selection },
{ name: 'time-series', icon: 'las la-chart-line', component: 'widget/KTimeSeries', props: this.$data }
]
if (this.mapillaryClientID) widgets.push({ name: 'mapillary-viewer', icon: 'img:statics/mapillary-icon.svg', component: 'widget/KMapillaryViewer' })
this.setWindow(widgets)
// Notifie the listener
utils.sendEmbedEvent('globe-ready')
},
getViewKey () {
Expand Down
13 changes: 1 addition & 12 deletions src/components/MapActivity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,9 @@ export default {
},
methods: {
async refreshActivity () {
this.clearActivity()
this.configureActivity()
// Wait until map is ready
await this.initializeMap()
// Setup the panes
this.configureTopPane()
this.configureBottomPane()
this.configureRightPane()
this.configureFab()
const widgets = [
{ name: 'information-box', icon: 'las la-digital-tachograph', component: 'widget/KInformationBox', props: this.selection },
{ name: 'time-series', icon: 'las la-chart-line', component: 'widget/KTimeSeries', props: this.$data }
]
if (this.mapillaryClientID) widgets.push({ name: 'mapillary-viewer', icon: 'img:statics/mapillary-icon.svg', component: 'widget/KMapillaryViewer' })
this.setWindow(widgets)
// Notifie the listener
utils.sendEmbedEvent('map-ready')
},
Expand Down

0 comments on commit b1ffcd3

Please sign in to comment.