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

Commit

Permalink
feat: navigation bar now includes 2D/3D buton and dense location input
Browse files Browse the repository at this point in the history
closes #129
  • Loading branch information
claustres committed Nov 28, 2019
1 parent 3c547fd commit ead4917
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/client/i18n/kMap_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
"TOGGLE_SIDENAV": "Menu",
"TOGGLE_FULLSCREEN": "Fullscreen",
"TOGGLE_CATALOG": "Catalog",
"TOGGLE_MAP": "2D",
"TOGGLE_GLOBE": "3D",
"TOGGLE_VR": "VR",
"TRACK_LOCATION": "Track location",
"PROBE": "Probe"
Expand Down
2 changes: 2 additions & 0 deletions src/client/i18n/kMap_fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
"TOGGLE_SIDENAV": "Menu",
"TOGGLE_FULLSCREEN": "Plein écran",
"TOGGLE_CATALOG": "Catalogue",
"TOGGLE_MAP": "2D",
"TOGGLE_GLOBE": "3D",
"TOGGLE_VR": "VR",
"TRACK_LOCATION": "Suivi de coordonnées",
"PROBE": "Sonder"
Expand Down
17 changes: 15 additions & 2 deletions src/client/mixins/mixin.activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,12 @@ export default function (name) {
}
// Nav bar
let defaultTools = ['side-nav', 'zoom', 'track-location', 'location-bar', 'fullscreen', 'catalog']
if (this.engine === 'cesium') defaultTools = defaultTools.concat(['vr'])
if (this.engine === 'cesium') defaultTools = defaultTools.concat(['globe', 'vr'])
else defaultTools = defaultTools.concat(['map'])
const tools = _.get(this, 'activityOptions.tools', defaultTools)
const hasSideNavTool = tools.includes('side-nav')
const hasMapTool = tools.includes('map')
const hasGlobeTool = tools.includes('globe')
const hasVrTool = tools.includes('vr')
const hasFullscreenTool = (typeof this.onToggleFullscreen === 'function') && tools.includes('fullscreen')
const hasZoomTool = tools.includes('zoom')
Expand Down Expand Up @@ -100,9 +103,19 @@ export default function (name) {
})
}
const afterActions = []
if (hasMapTool) {
afterActions.push({
name: 'map-toggle', label: this.$t('mixins.activity.TOGGLE_MAP'), icon: 'map', route: { name: 'map', query: true }
})
}
if (hasGlobeTool) {
afterActions.push({
name: 'globe-toggle', label: this.$t('mixins.activity.TOGGLE_GLOBE'), icon: 'terrain', route: { name: 'globe', query: true }
})
}
if (hasVrTool) {
afterActions.push({
name: 'vr-toggle', label: this.$t('mixins.activity.TOGGLE_VR'), icon: 'terrain', handler: this.onToggleVr
name: 'vr-toggle', label: this.$t('mixins.activity.TOGGLE_VR'), icon: 'burst_mode', handler: this.onToggleVr
})
}
if (hasFullscreenTool) {
Expand Down

0 comments on commit ead4917

Please sign in to comment.