Add config option for initial map position and zoom
This commit is contained in:
parent
46ed85be2c
commit
e91b22ede0
2 changed files with 5 additions and 1 deletions
|
|
@ -30,6 +30,10 @@
|
||||||
//BR.conf.profilesUrl = 'file://YOUR_PATH_TO/profiles2/';
|
//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 = [
|
BR.conf.profiles = [
|
||||||
'trekking',
|
'trekking',
|
||||||
'fastbike',
|
'fastbike',
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ BR.Map = {
|
||||||
})
|
})
|
||||||
.addTo(map);
|
.addTo(map);
|
||||||
if (!map.restoreView()) {
|
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
|
// two attribution lines by adding two controls, prevents ugly wrapping on
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue