From 0d54fa29a93a0ad279da47cfcca88dd7922bf1fe Mon Sep 17 00:00:00 2001 From: "Phyks (Lucas Verney)" Date: Tue, 26 Jun 2018 16:03:14 +0200 Subject: [PATCH] Add customizable tile server --- README.md | 2 ++ config/prod.env.js | 1 + src/components/Map.vue | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fecc845..a9e4332 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,8 @@ adapt the behavior to your needs. * `PUBLIC_PATH=https://.../foobar` to serve the app from a subdirectory. * `API_BASE_URL=https://...` to specify the location of the server (defaults to `/`). The value should end with a trailing slash. +* `TILE_SERVER=` to pass a specific tile server to use rather than the default + one. ## Server part diff --git a/config/prod.env.js b/config/prod.env.js index 493ebe2..a86e7d4 100644 --- a/config/prod.env.js +++ b/config/prod.env.js @@ -2,4 +2,5 @@ module.exports = { NODE_ENV: '"production"', API_BASE_URL: JSON.stringify(process.env.API_BASE_URL), + TILE_SERVER: JSON.stringify(process.env.TILE_SERVER), } diff --git a/src/components/Map.vue b/src/components/Map.vue index be1a605..a7f2be5 100644 --- a/src/components/Map.vue +++ b/src/components/Map.vue @@ -26,7 +26,7 @@ L.Icon.Default.mergeOptions({ export const DEFAULT_ZOOM = 17; export const MIN_ZOOM = 15; export const MAX_ZOOM = 18; -export const TILE_SERVER = 'http://a.tile.opencyclemap.org/cycle/{z}/{x}/{y}.png'; +export const TILE_SERVER = process.env.TILE_SERVER || 'https://a.tile.thunderforest.com/cycle/{z}/{x}/{y}.png'; export default {