mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 08:02:51 +02:00
Mapping should be complete
This commit is contained in:
@@ -732,3 +732,12 @@ $config['unix-agent-connection-time-out'] = 10;
|
||||
// seconds
|
||||
$config['unix-agent-read-time-out'] = 10;
|
||||
// seconds
|
||||
|
||||
// Lat / Lon support for maps
|
||||
$config['geoloc']['latlng'] = false; // True to enable translation of location to latlng co-ordinates
|
||||
$config['geoloc']['engine'] = 'google';
|
||||
$config['map']['engine'] = 'leaflet';
|
||||
$config['mapael']['default_map'] = 'maps/world_countries.js';
|
||||
$config['leaflet']['default_lat'] = '50.898482';
|
||||
$config['leaflet']['default_lng'] = '-3.401402';
|
||||
$config['leaflet']['default_zoom'] = 2;
|
||||
|
||||
@@ -427,7 +427,7 @@ function location_to_latlng($device) {
|
||||
$bad_loc = false;
|
||||
$device_location = $device['location'];
|
||||
if (!empty($device_location)) {
|
||||
$device_location = preg_replace("/ /","+",$device_location);
|
||||
$new_device_location = preg_replace("/ /","+",$device_location);
|
||||
// We have a location string for the device.
|
||||
$loc = dbFetchRow("SELECT `lat`,`lng` FROM `coordinates` WHERE `location`=? LIMIT 1", array($device_location));
|
||||
if (is_array($loc) === false) {
|
||||
@@ -436,7 +436,7 @@ function location_to_latlng($device) {
|
||||
case "google":
|
||||
default:
|
||||
d_echo("Google geocode engine being used\n");
|
||||
$api_url = "https://maps.googleapis.com/maps/api/geocode/json?address=$device_location";
|
||||
$api_url = "https://maps.googleapis.com/maps/api/geocode/json?address=$new_device_location";
|
||||
break;
|
||||
}
|
||||
$curl_init = curl_init($api_url);
|
||||
|
||||
Reference in New Issue
Block a user