Skip to content

Commit a3f9754

Browse files
committed
move VUE_APP_MAPBOX_ACCESSTOKEN to docker-compose env var, move hardcoded styleLayer to VUE_APP_MAPBOX_DEFAULT_STYLES
1 parent 1ffb4cf commit a3f9754

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ services:
2828
- TERM=xterm-256color
2929
- START_SCREENSHOTSERVICE=NO
3030
- PUBLIC_URL=http://localhost:8080
31+
- VUE_APP_MAPBOX_ACCESSTOKEN=pk.eyJ1IjoiZ2VtZWluZGVzY2FuIiwiYSI6ImNrNXdrOXV2ZjEwdXcza28wcXNoYXE1ZGMifQ.P-nCvxNRK4AOs7YdRbHCLg
32+
- VUE_APP_MAPBOX_DEFAULT_STYLES=mapbox://styles/gemeindescan/ck6rp249516tg1iqkmt48o4pz
3133
working_dir: /opt/vue
3234
volumes:
3335
- ./vue:/opt/vue

vue/.env

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
VUE_APP_GRAPHQL_URI=http://localhost:8080/graphql/
2-
VUE_APP_MAPBOX_ACCESSTOKEN=pk.eyJ1IjoiZ2VtZWluZGVzY2FuIiwiYSI6ImNrNXdrOXV2ZjEwdXcza28wcXNoYXE1ZGMifQ.P-nCvxNRK4AOs7YdRbHCLg
3-
VUE_APP_DJANGOBASEURL=http://localhost:8080
1+
VUE_APP_GRAPHQL_URI=http://www:8000/graphql/
2+
VUE_APP_DJANGOBASEURL=http://www:8000

vue/.env.production

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
VUE_APP_GRAPHQL_URI=/graphql/
2-
VUE_APP_MAPBOX_ACCESSTOKEN=pk.eyJ1IjoiZ2VtZWluZGVzY2FuIiwiYSI6ImNrNXdrOXV2ZjEwdXcza28wcXNoYXE1ZGMifQ.P-nCvxNRK4AOs7YdRbHCLg
32
VUE_APP_DJANGOBASEURL=

vue/src/components/SnapshotMap.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ export default {
201201
const bounds = geoViewport.viewport(this.geobounds.flat(), [boxSize, boxSize]);
202202
this.map = L.mapbox.map('map').setView(bounds.center, bounds.zoom);
203203
this.layerContainer = new L.LayerGroup();
204+
// default test layer // this.layerContainer.addLayer(L.mapbox.styleLayer('mapbox://styles/mapbox/light-v10'));
204205
if (this.hash) { // full snapshot with hash
205206
this.layers.forEach((layer) => {
206207
if (layer.mediatype === 'application/vnd.mapbox-vector-tile') {
@@ -219,7 +220,11 @@ export default {
219220
this.geojson.coordinates.forEach((polygon) => {
220221
this.layerContainer.addLayer(L.polygon(polygon, { color: '#543076' }));
221222
});
222-
this.layerContainer.addLayer(L.mapbox.styleLayer('mapbox://styles/gemeindescan/ck6rp249516tg1iqkmt48o4pz'));
223+
if (process.env.VUE_APP_MAPBOX_DEFAULT_STYLES) {
224+
this.layerContainer.addLayer(L.mapbox.styleLayer(
225+
process.env.VUE_APP_MAPBOX_DEFAULT_STYLES
226+
));
227+
}
223228
}
224229
this.layerContainer.addTo(this.map);
225230
L.control.scale({

0 commit comments

Comments
 (0)