Browse Source

Configure defaultView

master
parent
commit
d8584d65c0
  1. 3
      conf.php-dist
  2. 2
      src/index.js

3
conf.php-dist

@ -4,3 +4,6 @@ $config['categoriesDir'] = 'node_modules/openstreetbrowser-categories-main';
// URL of the Overpass API
$config['overpassUrl'] = '//overpass-api.de/api/interpreter';
// Location of the initial view if no IP-location can be resolved. 'zoom' is optional.
$config['defaultView'] = array('lat' => 51.505, 'lon' => -0.09, 'zoom' => 18);

2
src/index.js

@ -23,7 +23,7 @@ window.onload = function() {
if (typeof ipLoc === 'object' && 'latitude' in ipLoc) {
map.setView([ ipLoc.latitude, ipLoc.longitude ], 14)
} else {
map.setView([ 51.505, -0.09 ], 14)
map.setView(config.defaultView, 'zoom' in config.defaultView ? config.defaultView.zoom : 14)
}
})

Loading…
Cancel
Save