Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ or build the docker file locally:
docker build -t <your username>/uavlogviewer .

# Run Docker Image
docker run -e VUE_APP_CESIUM_TOKEN=<Your cesium ion token> -it -p 8080:8080 -v ${PWD}:/usr/src/app <your username>/uavlogviewer
docker run -e VUE_APP_CESIUM_TOKEN=<Your cesium ion token> \
-e VUE_APP_MAPTILER_KEY=<Your maptiler key> \
-it -p 8080:8080 -v ${PWD}:/usr/src/app <your username>/uavlogviewer

# Navigate to localhost:8080 in your web browser

Expand Down
4 changes: 3 additions & 1 deletion config/dev.env.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,7 @@ const prodEnv = require('./prod.env')

module.exports = merge(prodEnv, {
NODE_ENV: '"development"',
VUE_APP_CESIUM_TOKEN: JSON.stringify(process.env.VUE_APP_CESIUM_TOKEN || '')
VUE_APP_CESIUM_TOKEN: JSON.stringify(process.env.VUE_APP_CESIUM_TOKEN || ''),
VUE_APP_CESIUM_RESOURCE_ID: JSON.stringify(process.env.VUE_APP_CESIUM_RESOUR_ID || 3),
VUE_APP_MAPTILER_KEY: JSON.stringify(process.env.VUE_APP_MAPTILER_KEY || '')
})
4 changes: 3 additions & 1 deletion config/prod.env.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
'use strict'
module.exports = {
NODE_ENV: '"production"',
VUE_APP_CESIUM_TOKEN: JSON.stringify(process.env.VUE_APP_CESIUM_TOKEN || '')
VUE_APP_CESIUM_TOKEN: JSON.stringify(process.env.VUE_APP_CESIUM_TOKEN || ''),
VUE_APP_CESIUM_RESOURCE_ID: JSON.stringify(process.env.VUE_APP_CESIUM_RESOUR_ID || 3),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
VUE_APP_CESIUM_RESOURCE_ID: JSON.stringify(process.env.VUE_APP_CESIUM_RESOUR_ID || 3),
VUE_APP_CESIUM_RESOURCE_ID: JSON.stringify(process.env.VUE_APP_CESIUM_RESOURCE_ID || 3),

VUE_APP_MAPTILER_KEY: JSON.stringify(process.env.VUE_APP_MAPTILER_KEY || 'o3JREHNnXex8WSPPm2BU')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this your key?

}
9 changes: 7 additions & 2 deletions src/components/CesiumViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ import {

// Set Cesium token from environment variable
Ion.defaultAccessToken = process.env.VUE_APP_CESIUM_TOKEN || ''
const cesiumResurceId = process.env.VUE_APP_CESIUM_RESOURCE_ID || 3
const mapTilerKey = process.env.VUE_APP_MAPTILER_KEY || ''

console.log('mapTilerKey: ' + mapTilerKey)
const colorCoderMode = new ColorCoderMode(store)
const colorCoderRange = new ColorCoderRange(store)

Expand All @@ -110,6 +113,7 @@ export default {
lastEmitted: 0,
colorCoder: null,
selectedColorCoder: 'Mode'

}
},
components: {
Expand Down Expand Up @@ -263,7 +267,7 @@ export default {
shadows: true,
// eslint-disable-next-line
baseLayer: new ImageryLayer.fromProviderAsync(
IonImageryProvider.fromAssetId(3954)
IonImageryProvider.fromAssetId(cesiumResurceId)
),
imageryProviderViewModels: imageryProviders,
orderIndependentTranslucency: false,
Expand Down Expand Up @@ -315,7 +319,8 @@ export default {
tooltip: 'Maptiler satellite imagery http://maptiler.com/',
creationFunction: function () {
return new UrlTemplateImageryProvider({
url: 'https://api.maptiler.com/tiles/satellite-v2/{z}/{x}/{y}.jpg?key=o3JREHNnXex8WSPPm2BU',
// eslint-disable-next-line quotes
url: `https://api.maptiler.com/tiles/satellite-v2/{z}/{x}/{y}.jpg?key=${mapTilerKey}`,
minimumLevel: 0,
maximumLevel: 20,
credit: 'https://www.maptiler.com/copyright'
Expand Down