mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Added ability to specify a different tile url
This commit is contained in:
@@ -35,6 +35,11 @@ $config['leaflet']['default_lng'] = "-3.401402";
|
||||
$config['leaflet']['default_zoom'] = 8;
|
||||
```
|
||||
|
||||
If you can't access OpenStreet map directly you can run a local [tile server](http://wiki.openstreetmap.org/wiki/Tile_servers). To specify a different url you can set:
|
||||
|
||||
```php
|
||||
$config['leaflet']['tile_url'] = 'localhost.com';
|
||||
```
|
||||
|
||||
### Jquery-Mapael config
|
||||
Further custom options are available to load different maps of the world, set default coordinates of where the map will zoom and the zoom level by default. An example of
|
||||
|
||||
@@ -131,7 +131,7 @@ if ($config['map']['engine'] == 'leaflet') {
|
||||
}
|
||||
$map_init = "[" . $init_lat . ", " . $init_lng . "], " . sprintf("%01.0f", $init_zoom);
|
||||
$temp_output .= 'var map = L.map(\'leaflet-map\').setView('.$map_init.');
|
||||
L.tileLayer(\'//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\', {
|
||||
L.tileLayer(\'//'.$config['leaflet']['tile_url'].'/{z}/{x}/{y}.png\', {
|
||||
attribution: \'© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors\'
|
||||
}).addTo(map);
|
||||
|
||||
|
||||
@@ -844,7 +844,8 @@ $config['map']['engine'] = 'leaflet';
|
||||
$config['mapael']['default_map'] = 'maps/world_countries.js';
|
||||
$config['leaflet']['default_lat'] = '51.4800';
|
||||
$config['leaflet']['default_lng'] = '0';
|
||||
$config['leaflet']['default_zoom'] = 2;
|
||||
$config['leaflet']['default_zoom'] = 2;
|
||||
$config['leaflet']['tile_url'] = "{s}.tile.openstreetmap.org";
|
||||
|
||||
// General GUI options
|
||||
$config['gui']['network-map']['style'] = 'new';//old is also valid
|
||||
|
||||
Reference in New Issue
Block a user