From e91b22ede0cd9251bef6b9308f97495fa5456ec1 Mon Sep 17 00:00:00 2001 From: Robert Sacks Date: Wed, 18 Mar 2020 20:56:50 -0400 Subject: [PATCH] Add config option for initial map position and zoom --- config.template.js | 4 ++++ js/Map.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config.template.js b/config.template.js index 18510c0..93e9bfe 100644 --- a/config.template.js +++ b/config.template.js @@ -30,6 +30,10 @@ //BR.conf.profilesUrl = 'file://YOUR_PATH_TO/profiles2/'; } + // Set the initial position and zoom level of the map + BR.conf.initialMapLocation = [50.99, 9.86]; + BR.conf.initialMapZoom = 5; + BR.conf.profiles = [ 'trekking', 'fastbike', diff --git a/js/Map.js b/js/Map.js index f4042b8..9ddfaf1 100644 --- a/js/Map.js +++ b/js/Map.js @@ -19,7 +19,7 @@ BR.Map = { }) .addTo(map); if (!map.restoreView()) { - map.setView([50.99, 9.86], 5); + map.setView(BR.conf.initialMapLocation, BR.conf.initialMapZoom); } // two attribution lines by adding two controls, prevents ugly wrapping on