] && info_key_names[key])
     2425               extra_info = extra_info + info_key_names[key] + ": <b>" + h[key] + "</b></br>";
     2426       }
     2427 
     2428       if(h["flow_status"]) {
     2429           let flow_status = i18n_ext.flow_status + ":</br>";
     2430           for (const prop in h["flow_status"]) {
     2431               flow_status = flow_status + "<b>" + h["flow_status"][prop]["num_flows"] + " Flows, " + h["flow_status"][prop]["label"] + "</b></br>";
     2432           }
     2433           extra_info = extra_info + flow_status;
     2434       }
     2435 
     2436       if(name)
     2437           name_ip = name + "</br>" + name_ip;
     2438 
     2439       analysisPage = new URLSearchParams(window.location.search)
     2440       analysisPage.set('ip', ip + ";eq")
     2441 
     2442       let hostDetails = ""
     2443 
     2444       h.host_in_memory ? hostDetails = `<a href='${http_prefix}/lua/host_details.lua?host=${ip}'> <i class="fas fa-laptop"></i></a>` : ``
     2445 
     2446       const marker = `<div class='infowin'>
     2447                           <a href='${http_prefix}/lua/pro/db_search.lua?${analysisPage.toString()}'>${name_ip}</a>
     2448                           ${hostDetails}
     2449                           <hr>
     2450                           ${extra_info}
     2451                       </div>`
     2452 
     2453       return L.marker(L.latLng(lat, lng), settings).bindPopup(marker);
     2454   }
     2455 
     2456   // return true if the status code is different from 200
     2457   const check_status_code = (status_code, status_text, $error_label) => {
     2458 
     2459       const is_different = (status_code != 200);
     2460 
     2461       if (is_different && $error_label != null) {
     2462           $error_label.find('p').text(`${i18n_ext.request_failed_message}: ${status_code} - ${status_text}`).show();
     2463       }
     2464       else if (is_different && $error_label == null) {
     2465           alert(`${i18n_ext.request_failed_message}: ${status_code} - ${status_text}`);
     2466       }
     2467 
     2468       return is_different;
     2469   }
     2470 
     2471   const display_errors = (errors) => {
     2472       const error_messages = {
     2473           1: 'Permission denied',
     2474           2: 'Position unavailable',
     2475           3: 'Request timeout'
     2476       };
     2477       const error_code = error_messages[errors.code];
     2478 
     2479       show_positions({ coords: { latitude: 0, longitude: 0 }});
     2480 
     2481       if (errors.code != 1) {
     2482           display_localized_error(error_code);
     2483       }
     2484   }
     2485 
     2486   const init_map = (newEndpoint = null, _baseEndpoint = null) => {
     2487       endpoint = newEndpoint || endpoint;
     2488       baseEndpoint = _baseEndpoint;
     2489 
     2490       if (navigator.geolocation) {
     2491           navigator.geolocation.getCurrentPosition(show_positions, display_errors,
     2492                {
     2493                    enableHighAccuracy: true,
     2494                    timeout: 10000,
     2495                    maximumAge: 0
     2496                }
     2497               );
     2498       }
     2499   }
     2500 
     2501   const draw_markers = (hosts, map_markers, map) => {
     2502       hosts.forEach(h => {
     2503           map_markers.addLayer(
     2504               create_marker(h)
     2505           );
     2506 
     2507           // make a transitions to the root host
     2508           if (h.isRoot) {
     2509               map.flyTo([h.lat, h.lng], zoom_level);
     2510           }
     2511       });
     2512       map.addLayer(map_markers);
     2513   }
     2514 
     2515   let hosts = null;
     2516   let map = null;
     2517   let markers = null;
     2518 
     2519   const redraw_hosts = (show_only_alert_hosts, redo_query = false, ex