mirror of
https://github.com/magicbug/Cloudlog
synced 2024-11-22 00:07:14 +00:00
Added Flags to Maps Popups
This commit is contained in:
commit
02281ae235
@ -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 . "<br />Date/Time: " . $row->COL_TIME_ON . "<br />";
|
||||
$plot['html'] .= ($row->COL_SAT_NAME != null) ? ("SAT: " . $row->COL_SAT_NAME . "<br />") : ("Band: " . $row->COL_BAND . "<br />");
|
||||
$plot['html'] .= "Mode: " . ($row->COL_SUBMODE == null ? $row->COL_MODE : $row->COL_SUBMODE) . "<br />";
|
||||
$flag = strtolower($CI->dxccflag->getISO($row->COL_DXCC));
|
||||
$plot['flag'] = '<span data-bs-toggle="tooltip" title="' . ucwords(strtolower(($row->name==null?"- NONE -":$row->name))) . '"><span class="fi fi-' . $flag .'"></span></span> ';
|
||||
$plot['html'] = ($row->COL_GRIDSQUARE != null ? "<b>Grid:</b> " . $row->COL_GRIDSQUARE . "<br />" : "");
|
||||
$plot['html'] .= "<b>Date/Time:</b> " . $row->COL_TIME_ON . "<br />";
|
||||
$plot['html'] .= ($row->COL_SAT_NAME != null) ? ("<b>SAT:</b> " . $row->COL_SAT_NAME . "<br />") : ("<b>Band:</b> " . $row->COL_BAND . " ");
|
||||
$plot['html'] .= "<b>Mode:</b> " . ($row->COL_SUBMODE == null ? $row->COL_MODE : $row->COL_SUBMODE) . "<br />";
|
||||
|
||||
// check if qso is confirmed //
|
||||
if (!$isVisitor) {
|
||||
|
@ -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 = `<h3>${marker.flag}${marker.label}</h3> ${marker.html}`;
|
||||
newMarkers[key] = marker;
|
||||
if (!markers[key]) {
|
||||
var icon = L.divIcon({
|
||||
className: 'custom-icon',
|
||||
html: `<i class="${iconsList.qso.icon}" style="color:${iconsList.qso.color}"></i>`
|
||||
});
|
||||
});
|
||||
|
||||
L.marker([marker.lat, marker.lng], {
|
||||
icon: icon
|
||||
})
|
||||
.addTo(map)
|
||||
.bindPopup(marker.html);
|
||||
.bindPopup(html);
|
||||
}
|
||||
});
|
||||
Object.keys(markers).forEach(key => {
|
||||
|
@ -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!="")?("<h3>"+_plot.label+"</h3>"):"";
|
||||
_plot.label = (_plot.label!="")?("<h3>"+ _plot.flag + _plot.label+"</h3>"):"";
|
||||
if ((_plot.label+_plot.html)!="") { plotmark.bindPopup(_plot.label+_plot.html); }
|
||||
}
|
||||
plotlayers.push(plotmark);
|
||||
|
Loading…
Reference in New Issue
Block a user