Browse Source

Configure URL of OpenStreetMap website

master
parent
commit
1dc9cb7c4f
  1. 3
      conf.php-dist
  2. 1
      modulekit.php
  3. 2
      src/CategoryOverpass.js
  4. 4
      src/defaults.php
  5. 2
      src/index.js

3
conf.php-dist

@ -27,6 +27,9 @@ $config['categoriesAlwaysReload'] = true;
// (optional) URL, which points to the OpenStreetBrowser Editor
#$config['urlCategoriesEditor'] = 'editor/';
// URL of OpenStreetMap website - change this for other services
$config['urlOpenStreetMap'] = 'https://www.openstreetmap.org';
// URL of the Overpass API
$config['overpassUrl'] = array(
'//overpass-api.de/api/interpreter',

1
modulekit.php

@ -11,6 +11,7 @@ $depend = array(
);
$include = array(
'php' => array(
'src/defaults.php',
'src/options.php',
'src/language.php',
'src/ip-location.php',

2
src/CategoryOverpass.js

@ -564,7 +564,7 @@ CategoryOverpass.prototype.updatePopupContent = function (object, popup) {
}
var footerContent = '<li><a class="showDetails" href="#' + this.id + '/' + id_with_sublayer + '/details">' + lang('show details') + '</a></li>'
footerContent += '<li><a target="_blank" class="editLink" href="https://www.openstreetmap.org/edit?editor=id&' + object.object.type + '=' + object.object.osm_id + '">' + lang('edit') + '</a></li>'
footerContent += '<li><a target="_blank" class="editLink" href="' + config.urlOpenStreetMap + '/edit?editor=id&' + object.object.type + '=' + object.object.osm_id + '">' + lang('edit') + '</a></li>'
footer.innerHTML = footerContent
}

4
src/defaults.php

@ -0,0 +1,4 @@
<?php
if (!array_key_exists('urlOpenStreetMap', $config)) {
$config['urlOpenStreetMap'] = 'https://www.openstreetmap.arg';
}

2
src/index.js

@ -339,7 +339,7 @@ window.showDetails = function (data, category) {
dd = document.createElement('dd')
a = document.createElement('a')
a.appendChild(document.createTextNode(data.object.type + '/' + data.object.osm_id))
a.href = 'https://openstreetmap.org/' + data.object.type + '/' + data.object.osm_id
a.href = config.urlOpenStreetMap + '/' + data.object.type + '/' + data.object.osm_id
a.target = '_blank'
dd.appendChild(a)

Loading…
Cancel
Save