mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Don't escape leaflet tile url in location edit map (#15695)
* Don't escape leaflet tile url * encode config as json and get config value in controller * fixed array style
This commit is contained in:
@@ -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'] = '';
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user