Add customizable tile server

This commit is contained in:
Lucas Verney 2018-06-26 16:03:14 +02:00
parent 6fad8b7fac
commit 0d54fa29a9
3 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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),
}

View File

@ -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 {