diff --git a/app/Http/Controllers/LocationController.php b/app/Http/Controllers/LocationController.php index 1e8ea4f67f..f42f4f3611 100644 --- a/app/Http/Controllers/LocationController.php +++ b/app/Http/Controllers/LocationController.php @@ -12,9 +12,11 @@ class LocationController extends Controller public function index() { $maps_api = Config::get('geoloc.api_key'); + $maps_config = ['tile_url' => Config::get('leaflet.tile_url', '{s}.tile.openstreetmap.org')]; $data = [ 'maps_api' => $maps_api, 'maps_engine' => $maps_api ? Config::get('geoloc.engine') : '', + 'maps_config' => $maps_config, ]; $data['graph_template'] = ''; diff --git a/resources/views/locations.blade.php b/resources/views/locations.blade.php index 56f0f9e114..f1a3cdf226 100644 --- a/resources/views/locations.blade.php +++ b/resources/views/locations.blade.php @@ -148,7 +148,7 @@ locationId = $btn.data('id'); if (locationMap === null) { - config = {"tile_url": "{{ \LibreNMS\Config::get('leaflet.tile_url', '{s}.tile.openstreetmap.org') }}"}; + config = {{ Js::from($maps_config) }} locationMap = init_map('location-edit-map', '{{ $maps_engine }}', '{{ $maps_api }}', config); locationMarker = init_map_marker(locationMap, location); }