Browse Source

Change config handling

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

3
conf.php-dist

@ -1,2 +1,3 @@
<?php
$categories_dir = 'node_modules/openstreetbrowser-categories-main';
// Directory from which to read the categories.
$config['categoriesDir'] = 'node_modules/openstreetbrowser-categories-main';

2
index.php

@ -3,7 +3,7 @@
<?php call_hooks("init"); /* initialize submodules */ ?>
<?php
html_export_var(array(
'categories_dir' => $categories_dir,
'config' => $config,
));
?>
<!DOCTYPE html>

2
src/OpenStreetBrowserLoader.js

@ -33,7 +33,7 @@ OpenStreetBrowserLoader.prototype.getCategory = function (id, callback) {
var req = new XMLHttpRequest()
req.addEventListener("load", reqListener.bind(this, req))
req.open("GET", categories_dir + '/' + id + ".json")
req.open("GET", config.categoriesDir + '/' + id + ".json")
req.send()
}

Loading…
Cancel
Save