diff --git a/README.md b/README.md index 5b3f8ee98..792d1262f 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,9 @@ or build the docker file locally: docker build -t /uavlogviewer . # Run Docker Image -docker run -e VUE_APP_CESIUM_TOKEN= -it -p 8080:8080 -v ${PWD}:/usr/src/app /uavlogviewer +docker run -e VUE_APP_CESIUM_TOKEN= \ + -e VUE_APP_MAPTILER_KEY= \ + -it -p 8080:8080 -v ${PWD}:/usr/src/app /uavlogviewer # Navigate to localhost:8080 in your web browser diff --git a/config/dev.env.js b/config/dev.env.js index 332814a81..475b1e843 100644 --- a/config/dev.env.js +++ b/config/dev.env.js @@ -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 || '') }) diff --git a/config/prod.env.js b/config/prod.env.js index cf6d3ab32..b301a7d82 100644 --- a/config/prod.env.js +++ b/config/prod.env.js @@ -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), + VUE_APP_MAPTILER_KEY: JSON.stringify(process.env.VUE_APP_MAPTILER_KEY || 'o3JREHNnXex8WSPPm2BU') } diff --git a/src/components/CesiumViewer.vue b/src/components/CesiumViewer.vue index 55c5caa12..e073c2342 100644 --- a/src/components/CesiumViewer.vue +++ b/src/components/CesiumViewer.vue @@ -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) @@ -110,6 +113,7 @@ export default { lastEmitted: 0, colorCoder: null, selectedColorCoder: 'Mode' + } }, components: { @@ -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, @@ -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'