Added Flags to Maps Popups
这个提交包含在:
当前提交
02281ae235
共有 3 个文件被更改,包括 18 次插入 和 12 次删除
|
|
@ -4764,19 +4764,23 @@ class Logbook_model extends CI_Model
|
||||||
|
|
||||||
// [JSON PLOT] return array for plot qso for map //
|
// [JSON PLOT] return array for plot qso for map //
|
||||||
public function get_plot_array_for_map($qsos_result, $isVisitor = false)
|
public function get_plot_array_for_map($qsos_result, $isVisitor = false)
|
||||||
{
|
{
|
||||||
$this->load->library('qra');
|
$this->load->library('qra');
|
||||||
|
$CI = &get_instance();
|
||||||
|
$CI->load->library('DxccFlag');
|
||||||
|
|
||||||
$json["markers"] = array();
|
$json["markers"] = array();
|
||||||
|
|
||||||
foreach ($qsos_result as $row) {
|
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['label'] = $row->COL_CALL;
|
||||||
|
$flag = strtolower($CI->dxccflag->getISO($row->COL_DXCC));
|
||||||
$plot['html'] = "Callsign: " . $row->COL_CALL . "<br />Date/Time: " . $row->COL_TIME_ON . "<br />";
|
$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_SAT_NAME != null) ? ("SAT: " . $row->COL_SAT_NAME . "<br />") : ("Band: " . $row->COL_BAND . "<br />");
|
$plot['html'] = ($row->COL_GRIDSQUARE != null ? "<b>Grid:</b> " . $row->COL_GRIDSQUARE . "<br />" : "");
|
||||||
$plot['html'] .= "Mode: " . ($row->COL_SUBMODE == null ? $row->COL_MODE : $row->COL_SUBMODE) . "<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 //
|
// check if qso is confirmed //
|
||||||
if (!$isVisitor) {
|
if (!$isVisitor) {
|
||||||
|
|
|
||||||
|
|
@ -898,17 +898,19 @@ if ($this->session->userdata('user_id') != null) {
|
||||||
var newMarkers = {};
|
var newMarkers = {};
|
||||||
data.markers.forEach(marker => {
|
data.markers.forEach(marker => {
|
||||||
var key = `${marker.lat},${marker.lng}`;
|
var key = `${marker.lat},${marker.lng}`;
|
||||||
|
var html = `<h3>${marker.flag}${marker.label}</h3> ${marker.html}`;
|
||||||
newMarkers[key] = marker;
|
newMarkers[key] = marker;
|
||||||
if (!markers[key]) {
|
if (!markers[key]) {
|
||||||
var icon = L.divIcon({
|
var icon = L.divIcon({
|
||||||
className: 'custom-icon',
|
className: 'custom-icon',
|
||||||
html: `<i class="${iconsList.qso.icon}" style="color:${iconsList.qso.color}"></i>`
|
html: `<i class="${iconsList.qso.icon}" style="color:${iconsList.qso.color}"></i>`
|
||||||
});
|
});
|
||||||
|
|
||||||
L.marker([marker.lat, marker.lng], {
|
L.marker([marker.lat, marker.lng], {
|
||||||
icon: icon
|
icon: icon
|
||||||
})
|
})
|
||||||
.addTo(map)
|
.addTo(map)
|
||||||
.bindPopup(marker.html);
|
.bindPopup(html);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Object.keys(markers).forEach(key => {
|
Object.keys(markers).forEach(key => {
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ function createPlots(_plot) {
|
||||||
plotmark.data=_plot;
|
plotmark.data=_plot;
|
||||||
map.addLayer(plotmark);
|
map.addLayer(plotmark);
|
||||||
if ((typeof _plot.label!=="undefined")&&(typeof _plot.html!=="undefined")) {
|
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); }
|
if ((_plot.label+_plot.html)!="") { plotmark.bindPopup(_plot.label+_plot.html); }
|
||||||
}
|
}
|
||||||
plotlayers.push(plotmark);
|
plotlayers.push(plotmark);
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用