tra_endpoint_params = null) => {
     2520       if (markers == null || map == null || hosts == null) {
     2521     console.error("map isn't initialized!");
     2522     return;
     2523       }
     2524       markers.clearLayers();
     2525 
     2526       if(redo_query == true) {
     2527           $.get(`${baseEndpoint}?${extra_endpoint_params}&ifid=${interfaceID}&${zoomIP || ''}`)
     2528               .then((data) => {
     2529                           hosts = data.rsp;
     2530                   draw_markers(data.rsp, markers, map);
     2531               })
     2532               .fail(({ status, statusText }) => {
     2533                   NtopUtils.check_status_code(status, statusText, $("#geomap-alert"));
     2534               });
     2535       } else {
     2536           //map.removeLayer(markers);
     2537           let temp_hosts = hosts.filter((h) => h.isAlert == true || !show_only_alert_hosts);
     2538           draw_markers(temp_hosts, markers, map);
     2539       }
     2540   }
     2541 
     2542   const show_positions = (current_user_position) => {
     2543       // these are two map providers provided by: https://leaflet-extras.github.io/leaflet-providers/preview/
     2544       const layers = {
     2545           light: "https://tile.openstreetmap.org/{z}/{x}/{y}.png",
     2546           // dark: "https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/{z}/{x}/{y}{r}.png"
     2547       };
     2548       // select the right layer
     2549       const layer = layers.light;
     2550       const user_coords = [current_user_position.coords.latitude, current_user_position.coords.longitude];
     2551 
     2552       if (user_coords[0] == 0 && user_coords[1] == 0) {
     2553           /* Do not even report the info/error to the user, this is
     2554            * not relevant as the map functionality is not impacted */
     2555           //display_localized_no_geolocation_msg();
     2556           console.log("Geolocation unavailable, using default location");
     2557 
     2558           user_coords[0] = default_coords[0], user_coords[1] = default_coords[1];
     2559       }
     2560       //document.getElementById('map-canvas').innerHTML = "<div id='map' style='width: 100%; height: 100%;'></div>";
     2561       const hosts_map = L.map('map-canvas').setView(user_coords || default_coords, zoom_level);
     2562       map = hosts_map;
     2563       const map_markers = L.markerClusterGroup({
     2564           maxClusterRadius: 100,
     2565           spiderLegPolylineOptions: {
     2566               opacity: 0
     2567           }
     2568       });
     2569       markers = map_markers;
     2570       map = hosts_map;
     2571 
     2572       L.tileLayer(layer, {
     2573           attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
     2574       }).addTo(hosts_map);
     2575 
     2576       if (hosts != null) {
     2577           draw_markers(hosts, map_markers, hosts_map);
     2578     return;
     2579       }
     2580 
     2581       $.get(`${endpoint}&ifid=${interfaceID}&${zoomIP || ''}`)
     2582           .then((data) => {
     2583         hosts = data.rsp;
     2584               draw_markers(data.rsp, map_markers, hosts_map);
     2585           })
     2586           .fail(({ status, statusText }) => {
     2587               NtopUtils.check_status_code(status, statusText, $("#geomap-alert"));
     2588           });
     2589 
     2590   }
     2591 
     2592 
     2593 
     2594   $(document).ready(function() {
     2595     init_map();
     2596     $("#hosts-geomap-active-hosts").on("click", function(t) {
     2597   $("#hosts-geomap-default-hosts").text(" Active Hosts ")
     2598   redraw_hosts(false);
     2599     });
     2600     $("#hosts-geomap-alerted-hosts").on("click", function(t) {
     2601   $("#hosts-geomap-default-hosts").text(" Alerted Hosts ")
     2602   redr