mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fixed openstreetmap support in device not using custom tiles (#9536)
* Fixed openstreetmap support in device not using custom tiles * Updated blade template for locations * Removed console.log()
This commit is contained in:
committed by
Tony Murray
parent
fad0bffc43
commit
dd695dde53
@@ -307,7 +307,7 @@ function loadScript(src, callback) {
|
||||
script.src = src;
|
||||
}
|
||||
|
||||
function init_map(id, engine, api_key) {
|
||||
function init_map(id, engine, api_key, config) {
|
||||
var leaflet = L.map(id);
|
||||
var baseMaps = {};
|
||||
leaflet.setView([0, 0], 15);
|
||||
@@ -361,7 +361,7 @@ function init_map(id, engine, api_key) {
|
||||
roads.addTo(leaflet);
|
||||
});
|
||||
} else {
|
||||
var osm = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
var osm = L.tileLayer('//' + config.tile_url + '/{z}/{x}/{y}.png', {
|
||||
maxZoom: 19,
|
||||
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
||||
});
|
||||
@@ -435,7 +435,6 @@ function update_location(id, latlng, callback) {
|
||||
|
||||
function http_fallback(link) {
|
||||
var url = link.getAttribute('href');
|
||||
console.log(url);
|
||||
try {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('GET', url, false);
|
||||
@@ -446,7 +445,6 @@ function http_fallback(link) {
|
||||
url = url.replace(/^https:\/\//, 'http://');
|
||||
}
|
||||
} catch (e) {
|
||||
// console.log(e);
|
||||
url = url.replace(/^https:\/\//, 'http://');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user