diff --git a/application/models/Logbook_model.php b/application/models/Logbook_model.php index 570f5063..61f3129b 100755 --- a/application/models/Logbook_model.php +++ b/application/models/Logbook_model.php @@ -4764,19 +4764,23 @@ class Logbook_model extends CI_Model // [JSON PLOT] return array for plot qso for map // public function get_plot_array_for_map($qsos_result, $isVisitor = false) - { +{ $this->load->library('qra'); - + $CI = &get_instance(); + $CI->load->library('DxccFlag'); + $json["markers"] = array(); - + foreach ($qsos_result as $row) { - $plot = array('lat' => 0, 'lng' => 0, 'html' => '', 'label' => '', 'confirmed' => 'N'); - + $plot = array('lat' => 0, 'lng' => 0, 'html' => '', 'label' => '', 'flag' => '', 'confirmed' => 'N'); + $plot['label'] = $row->COL_CALL; - - $plot['html'] = "Callsign: " . $row->COL_CALL . "
Date/Time: " . $row->COL_TIME_ON . "
"; - $plot['html'] .= ($row->COL_SAT_NAME != null) ? ("SAT: " . $row->COL_SAT_NAME . "
") : ("Band: " . $row->COL_BAND . "
"); - $plot['html'] .= "Mode: " . ($row->COL_SUBMODE == null ? $row->COL_MODE : $row->COL_SUBMODE) . "
"; + $flag = strtolower($CI->dxccflag->getISO($row->COL_DXCC)); + $plot['flag'] = 'name))) . '"> '; + $plot['html'] = ($row->COL_GRIDSQUARE != null ? "Grid: " . $row->COL_GRIDSQUARE . "
" : ""); + $plot['html'] .= "Date/Time: " . $row->COL_TIME_ON . "
"; + $plot['html'] .= ($row->COL_SAT_NAME != null) ? ("SAT: " . $row->COL_SAT_NAME . "
") : ("Band: " . $row->COL_BAND . " "); + $plot['html'] .= "Mode: " . ($row->COL_SUBMODE == null ? $row->COL_MODE : $row->COL_SUBMODE) . "
"; // check if qso is confirmed // if (!$isVisitor) { diff --git a/application/views/interface_assets/footer.php b/application/views/interface_assets/footer.php index ce10ab4a..846d6167 100644 --- a/application/views/interface_assets/footer.php +++ b/application/views/interface_assets/footer.php @@ -898,17 +898,19 @@ if ($this->session->userdata('user_id') != null) { var newMarkers = {}; data.markers.forEach(marker => { var key = `${marker.lat},${marker.lng}`; + var html = `

${marker.flag}${marker.label}

${marker.html}`; newMarkers[key] = marker; if (!markers[key]) { var icon = L.divIcon({ className: 'custom-icon', html: `` - }); + }); + L.marker([marker.lat, marker.lng], { icon: icon }) .addTo(map) - .bindPopup(marker.html); + .bindPopup(html); } }); Object.keys(markers).forEach(key => { diff --git a/assets/js/leaflet/leafembed.js b/assets/js/leaflet/leafembed.js index ff6c908f..b2a59bf9 100644 --- a/assets/js/leaflet/leafembed.js +++ b/assets/js/leaflet/leafembed.js @@ -92,7 +92,7 @@ function createPlots(_plot) { plotmark.data=_plot; map.addLayer(plotmark); if ((typeof _plot.label!=="undefined")&&(typeof _plot.html!=="undefined")) { - _plot.label = (_plot.label!="")?("

"+_plot.label+"

"):""; + _plot.label = (_plot.label!="")?("

"+ _plot.flag + _plot.label+"

"):""; if ((_plot.label+_plot.html)!="") { plotmark.bindPopup(_plot.label+_plot.html); } } plotlayers.push(plotmark);