Merge branch 'dev' into iota_map

这个提交包含在:
Andreas Kristiansen 2022-12-12 09:30:59 +01:00 提交者 GitHub
当前提交 4da2227002
找不到此签名对应的密钥
GPG 密钥 ID: 4AEE18F83AFDEB23
共有 7 个文件被更改,包括 340 次插入86 次删除

查看文件

@ -620,6 +620,54 @@ class Awards extends CI_Controller {
echo json_encode($zones); echo json_encode($zones);
} }
/*
function dxcc_map
This displays the DXCC map
*/
public function dxcc_map() {
$this->load->model('dxcc');
$this->load->model('bands');
$bands[] = $this->input->post('band');
$postdata['lotw'] = $this->input->post('lotw') == 0 ? NULL: 1;
$postdata['qsl'] = $this->input->post('qsl') == 0 ? NULL: 1;
$postdata['worked'] = $this->input->post('worked') == 0 ? NULL: 1;
$postdata['confirmed'] = $this->input->post('confirmed') == 0 ? NULL: 1;
$postdata['notworked'] = $this->input->post('notworked') == 0 ? NULL: 1;
$postdata['band'] = $this->input->post('band');
$postdata['mode'] = $this->input->post('mode');
$postdata['includedeleted'] = $this->input->post('includedeleted') == 0 ? NULL: 1;
$postdata['Africa'] = $this->input->post('Africa') == 0 ? NULL: 1;
$postdata['Asia'] = $this->input->post('Asia') == 0 ? NULL: 1;
$postdata['Europe'] = $this->input->post('Europe') == 0 ? NULL: 1;
$postdata['NorthAmerica'] = $this->input->post('NorthAmerica') == 0 ? NULL: 1;
$postdata['SouthAmerica'] = $this->input->post('SouthAmerica') == 0 ? NULL: 1;
$postdata['Oceania'] = $this->input->post('Oceania') == 0 ? NULL: 1;
$postdata['Antarctica'] = $this->input->post('Antarctica') == 0 ? NULL: 1;
$dxcclist = $this->dxcc->fetchdxcc($postdata);
$dxcc_array = $this->dxcc->get_dxcc_array($dxcclist, $bands, $postdata);
$i = 0;
foreach ($dxcclist as $dxcc) {
$newdxcc[$i]['adif'] = $dxcc->adif;
$newdxcc[$i]['prefix'] = $dxcc->prefix;
$newdxcc[$i]['name'] = ucwords(strtolower($dxcc->name), "- (/");
if ($dxcc->Enddate!=null) {
$newdxcc[$i]['name'] .= ' (deleted)';
}
$newdxcc[$i]['lat'] = $dxcc->lat;
$newdxcc[$i]['long'] = $dxcc->long;
$newdxcc[$i++]['status'] = isset($dxcc_array[$dxcc->adif]) ? $this->returnStatus($dxcc_array[$dxcc->adif]) : 'x';
}
header('Content-Type: application/json');
echo json_encode($newdxcc);
}
/* /*
function iota function iota
This displays the IOTA map This displays the IOTA map

查看文件

@ -82,7 +82,6 @@ class DXCC extends CI_Model {
if ($postdata['worked'] != NULL) { if ($postdata['worked'] != NULL) {
$workedDXCC = $this->getDxccBandWorked($location_list, $band, $postdata); $workedDXCC = $this->getDxccBandWorked($location_list, $band, $postdata);
foreach ($workedDXCC as $wdxcc) { foreach ($workedDXCC as $wdxcc) {
//function displayContacts(searchphrase, band, mode, type) {
$dxccMatrix[$wdxcc->dxcc][$band] = '<div class="alert-danger"><a href=\'javascript:displayContacts("'.str_replace("&", "%26", $wdxcc->name).'","'. $band . '","'. $postdata['mode'] . '","DXCC")\'>W</a></div>'; $dxccMatrix[$wdxcc->dxcc][$band] = '<div class="alert-danger"><a href=\'javascript:displayContacts("'.str_replace("&", "%26", $wdxcc->name).'","'. $band . '","'. $postdata['mode'] . '","DXCC")\'>W</a></div>';
} }
} }
@ -131,13 +130,7 @@ class DXCC extends CI_Model {
where station_id in (" . $location_list . where station_id in (" . $location_list .
") and col_dxcc > 0"; ") and col_dxcc > 0";
if ($band == 'SAT') { $sql .= $this->addBandToQuery($band);
$sql .= " and col_prop_mode ='" . $band . "'";
}
else {
$sql .= " and col_prop_mode !='SAT'";
$sql .= " and col_band ='" . $band . "'";
}
if ($postdata['mode'] != 'All') { if ($postdata['mode'] != 'All') {
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')"; $sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
@ -166,13 +159,7 @@ class DXCC extends CI_Model {
where station_id in (" . $location_list . where station_id in (" . $location_list .
") and col_dxcc > 0"; ") and col_dxcc > 0";
if ($band == 'SAT') { $sql .= $this->addBandToQuery($band);
$sql .= " and col_prop_mode ='" . $band . "'";
}
else {
$sql .= " and col_prop_mode !='SAT'";
$sql .= " and col_band ='" . $band . "'";
}
if ($postdata['mode'] != 'All') { if ($postdata['mode'] != 'All') {
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')"; $sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
@ -192,6 +179,19 @@ class DXCC extends CI_Model {
return $query->result(); return $query->result();
} }
function addBandToQuery($band) {
$sql = '';
if ($band != 'All') {
if ($band == 'SAT') {
$sql .= " and col_prop_mode ='" . $band . "'";
} else {
$sql .= " and col_prop_mode !='SAT'";
$sql .= " and col_band ='" . $band . "'";
}
}
return $sql;
}
function fetchDxcc($postdata) { function fetchDxcc($postdata) {
$CI =& get_instance(); $CI =& get_instance();
$CI->load->model('logbooks_model'); $CI->load->model('logbooks_model');
@ -203,7 +203,7 @@ class DXCC extends CI_Model {
$location_list = "'".implode("','",$logbooks_locations_array)."'"; $location_list = "'".implode("','",$logbooks_locations_array)."'";
$sql = "select adif, prefix, name, date(end) Enddate, date(start) Startdate $sql = "select adif, prefix, name, date(end) Enddate, date(start) Startdate, lat, `long`
from dxcc_entities"; from dxcc_entities";
if ($postdata['notworked'] == NULL) { if ($postdata['notworked'] == NULL) {
@ -248,15 +248,7 @@ class DXCC extends CI_Model {
where station_id in (" . $location_list . where station_id in (" . $location_list .
") and col_dxcc > 0"; ") and col_dxcc > 0";
if ($postdata['band'] != 'All') { $sql .= $this->addBandToQuery($postdata['band']);
if ($postdata['band'] == 'SAT') {
$sql .= " and col_prop_mode ='" . $postdata['band'] . "'";
}
else {
$sql .= " and col_prop_mode !='SAT'";
$sql .= " and col_band ='" . $postdata['band'] . "'";
}
}
if ($postdata['mode'] != 'All') { if ($postdata['mode'] != 'All') {
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')"; $sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
@ -264,15 +256,7 @@ class DXCC extends CI_Model {
$sql .= " and not exists (select 1 from ".$this->config->item('table_name')." where station_id in (". $location_list .") and col_dxcc = thcv.col_dxcc and col_dxcc > 0"; $sql .= " and not exists (select 1 from ".$this->config->item('table_name')." where station_id in (". $location_list .") and col_dxcc = thcv.col_dxcc and col_dxcc > 0";
if ($postdata['band'] != 'All') { $sql .= $this->addBandToQuery($postdata['band']);
if ($postdata['band'] == 'SAT') {
$sql .= " and col_prop_mode ='" . $postdata['band'] . "'";
}
else {
$sql .= " and col_prop_mode !='SAT'";
$sql .= " and col_band ='" . $postdata['band'] . "'";
}
}
if ($postdata['mode'] != 'All') { if ($postdata['mode'] != 'All') {
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')"; $sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";
@ -305,15 +289,7 @@ class DXCC extends CI_Model {
where station_id in (". $location_list . where station_id in (". $location_list .
") and col_dxcc > 0"; ") and col_dxcc > 0";
if ($postdata['band'] != 'All') { $sql .= $this->addBandToQuery($postdata['band']);
if ($postdata['band'] == 'SAT') {
$sql .= " and col_prop_mode ='" . $postdata['band'] . "'";
}
else {
$sql .= " and col_prop_mode !='SAT'";
$sql .= " and col_band ='" . $postdata['band'] . "'";
}
}
if ($postdata['mode'] != 'All') { if ($postdata['mode'] != 'All') {
$sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')"; $sql .= " and (col_mode = '" . $postdata['mode'] . "' or col_submode = '" . $postdata['mode'] . "')";

查看文件

@ -1,4 +1,36 @@
<style>
#dxccmap {
height: calc(100vh - 500px) !important;
max-height: 900px !important;
}
/*Legend specific*/
.legend {
padding: 6px 8px;
font: 14px Arial, Helvetica, sans-serif;
background: white;
background: rgba(255, 255, 255, 0.8);
line-height: 24px;
color: #555;
}
.legend h4 {
text-align: center;
font-size: 16px;
margin: 2px 12px 8px;
color: #777;
}
.legend span {
position: relative;
bottom: 3px;
}
.legend i {
width: 18px;
height: 18px;
float: left;
margin: 0 8px 0 0;
opacity: 0.7;
}
</style>
<div class="container"> <div class="container">
<h2><?php echo $page_title; ?></h2> <h2><?php echo $page_title; ?></h2>
@ -121,13 +153,37 @@
<div class="form-group row"> <div class="form-group row">
<label class="col-md-2 control-label" for="button1id"></label> <label class="col-md-2 control-label" for="button1id"></label>
<div class="col-md-10"> <div class="col-md-10">
<button id="button2id" type="reset" name="button2id" class="btn-sm btn-warning">Reset</button> <button id="button2id" type="reset" name="button2id" class="btn btn-sm btn-warning">Reset</button>
<button id="button1id" type="submit" name="button1id" class="btn-sm btn-primary">Show</button> <button id="button1id" type="submit" name="button1id" class="btn btn-sm btn-primary">Show</button>
<?php if ($dxcc_array) {
?><button type="button" onclick="load_dxcc_map();" class="btn btn-info btn-sm"><i class="fas fa-globe-americas"></i> Show DXCC Map</button>
<?php }?>
</div> </div>
</div> </div>
</fieldset> </fieldset>
</form> </form>
<ul class="nav nav-tabs" id="myTab" role="tablist">
<li class="nav-item">
<a class="nav-link active" id="table-tab" data-toggle="tab" href="#table" role="tab" aria-controls="table" aria-selected="true">Table</a>
</li>
<li class="nav-item">
<a class="nav-link" id="map-tab" data-toggle="tab" href="#dxccmaptab" role="tab" aria-controls="home" aria-selected="false">Map</a>
</li>
</ul>
<br />
<div class="tab-content" id="myTabContent">
<div class="tab-pane fade" id="dxccmaptab" role="tabpanel" aria-labelledby="home-tab">
<br />
<div id="dxccmap"></div>
</div>
<div class="tab-pane fade show active" id="table" role="tabpanel" aria-labelledby="table-tab">
<?php <?php
$i = 1; $i = 1;
if ($dxcc_array) { if ($dxcc_array) {
@ -191,4 +247,6 @@
echo '<div class="alert alert-danger" role="alert"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>Nothing found!</div>'; echo '<div class="alert alert-danger" role="alert"><a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>Nothing found!</div>';
} }
?> ?>
</div>
</div>
</div> </div>

查看文件

@ -1,7 +1,7 @@
Cloudlog ADIF export Cloudlog ADIF export
<ADIF_VER:5>3.1.2 <ADIF_VER:5>3.1.2
<PROGRAMID:<?php echo strlen($this->config->item('app_name')); ?>><?php echo $this->config->item('app_name')."\n"; ?> <PROGRAMID:<?php echo strlen($this->config->item('app_name')); ?>><?php echo $this->config->item('app_name')."\n"; ?>
<PROGRAMVERSION:<?php echo strlen($this->config->item('app_version')); ?>>Version <?php echo $this->config->item('app_version')."\n"; ?> <PROGRAMVERSION:<?php echo strlen('Version' . ' ' .$this->config->item('app_version')); ?>>Version <?php echo $this->config->item('app_version')."\n"; ?>
<EOH> <EOH>
<?php <?php

查看文件

@ -48,6 +48,10 @@ function load_was_map() {
<script id="iotamapjs" type="text/javascript" src="<?php echo base_url(); ?>assets/js/sections/iotamap.js" tileUrl="<?php echo $this->optionslib->get_option('option_map_tile_server');?>"></script> <script id="iotamapjs" type="text/javascript" src="<?php echo base_url(); ?>assets/js/sections/iotamap.js" tileUrl="<?php echo $this->optionslib->get_option('option_map_tile_server');?>"></script>
<?php } ?> <?php } ?>
<?php if ($this->uri->segment(1) == "awards" && ($this->uri->segment(2) == "dxcc") ) { ?>
<script id="dxccmapjs" type="text/javascript" src="<?php echo base_url(); ?>assets/js/sections/dxccmap.js" tileUrl="<?php echo $this->optionslib->get_option('option_map_tile_server');?>"></script>
<?php } ?>
<?php if ($this->uri->segment(1) == "statistics") { ?> <?php if ($this->uri->segment(1) == "statistics") { ?>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/chart.js"></script> <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/chart.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/chartjs-plugin-piechart-outlabels.js"></script> <script type="text/javascript" src="<?php echo base_url(); ?>assets/js/chartjs-plugin-piechart-outlabels.js"></script>
@ -2580,6 +2584,19 @@ function deleteQsl(id) {
message: html, message: html,
onshown: function(dialog) { onshown: function(dialog) {
$('[data-toggle="tooltip"]').tooltip(); $('[data-toggle="tooltip"]').tooltip();
$('.contacttable').DataTable({
"pageLength": 25,
responsive: false,
ordering: false,
"scrollY": "550px",
"scrollCollapse": true,
"paging": false,
"scrollX": true,
dom: 'Bfrtip',
buttons: [
'csv'
]
});
}, },
buttons: [{ buttons: [{
label: 'Close', label: 'Close',

查看文件

@ -1,19 +1,18 @@
<?php <?php
function echo_table_header_col($ctx, $name) { function echo_table_header_col($ctx, $name) {
switch($name) { switch($name) {
case 'Mode': echo '<td>'.$ctx->lang->line('gen_hamradio_mode').'</td>'; break; case 'Mode': echo '<th>'.$ctx->lang->line('gen_hamradio_mode').'</th>'; break;
case 'RSTS': echo '<td>'.$ctx->lang->line('gen_hamradio_rsts').'</td>'; break; case 'RSTS': echo '<th>'.$ctx->lang->line('gen_hamradio_rsts').'</th>'; break;
case 'RSTR': echo '<td>'.$ctx->lang->line('gen_hamradio_rstr').'</td>'; break; case 'RSTR': echo '<th>'.$ctx->lang->line('gen_hamradio_rstr').'</th>'; break;
case 'Country': echo '<td>'.$ctx->lang->line('general_word_country').'</td>'; break; case 'Country': echo '<th>'.$ctx->lang->line('general_word_country').'</th>'; break;
case 'IOTA': echo '<td>'.$ctx->lang->line('gen_hamradio_iota').'</td>'; break; case 'IOTA': echo '<th>'.$ctx->lang->line('gen_hamradio_iota').'</th>'; break;
case 'SOTA': echo '<td>'.$ctx->lang->line('gen_hamradio_sota').'</td>'; break; case 'SOTA': echo '<th>'.$ctx->lang->line('gen_hamradio_sota').'</th>'; break;
case 'WWFF': echo '<td>'.$ctx->lang->line('gen_hamradio_wwff').'</td>'; break; case 'WWFF': echo '<th>'.$ctx->lang->line('gen_hamradio_wwff').'</th>'; break;
case 'POTA': echo '<td>'.$ctx->lang->line('gen_hamradio_pota').'</td>'; break; case 'POTA': echo '<th>'.$ctx->lang->line('gen_hamradio_pota').'</th>'; break;
case 'State': echo '<td>'.$ctx->lang->line('gen_hamradio_state').'</td>'; break; case 'State': echo '<th>'.$ctx->lang->line('gen_hamradio_state').'</th>'; break;
case 'Grid': echo '<td>'.$ctx->lang->line('gen_hamradio_gridsquare').'</td>'; break; case 'Grid': echo '<th>'.$ctx->lang->line('gen_hamradio_gridsquare').'</th>'; break;
case 'Band': echo '<td>'.$ctx->lang->line('gen_hamradio_band').'</td>'; break; case 'Band': echo '<th>'.$ctx->lang->line('gen_hamradio_band').'</td>'; break;
case 'Operator': echo '<td>'.$ctx->lang->line('gen_hamradio_operator').'</td>'; break; case 'Operator': echo '<th>'.$ctx->lang->line('gen_hamradio_operator').'</th>'; break;
} }
} }
@ -46,13 +45,14 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {
<?php if ($results) { ?> <?php if ($results) { ?>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-hover"> <table style="width:100%" class="table contacttable table-striped table-hover">
<thead>
<tr class="titles"> <tr class="titles">
<td><?php echo $this->lang->line('general_word_date'); ?></td> <th><?php echo $this->lang->line('general_word_date'); ?></th>
<?php if(($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE || ($this->config->item('show_time'))) { ?> <?php if(($this->config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE || ($this->config->item('show_time'))) { ?>
<td><?php echo $this->lang->line('general_word_time'); ?></td> <th><?php echo $this->lang->line('general_word_time'); ?></th>
<?php } ?> <?php } ?>
<td><?php echo $this->lang->line('gen_hamradio_call'); ?></td> <th><?php echo $this->lang->line('gen_hamradio_call'); ?></th>
<?php <?php
echo_table_header_col($this, $this->session->userdata('user_column1')==""?'Mode':$this->session->userdata('user_column1')); echo_table_header_col($this, $this->session->userdata('user_column1')==""?'Mode':$this->session->userdata('user_column1'));
echo_table_header_col($this, $this->session->userdata('user_column2')==""?'RSTS':$this->session->userdata('user_column2')); echo_table_header_col($this, $this->session->userdata('user_column2')==""?'RSTS':$this->session->userdata('user_column2'));
@ -61,19 +61,21 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {
echo_table_header_col($this, $this->session->userdata('user_column5')==""?'Country':$this->session->userdata('user_column5')); echo_table_header_col($this, $this->session->userdata('user_column5')==""?'Country':$this->session->userdata('user_column5'));
if(($this->config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?> if(($this->config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?>
<td>QSL</td> <th>QSL</th>
<?php if($this->session->userdata('user_eqsl_name') != "") { ?> <?php if($this->session->userdata('user_eqsl_name') != "") { ?>
<td>eQSL</td> <th>eQSL</th>
<?php } ?> <?php } ?>
<?php if($this->session->userdata('user_lotw_name') != "") { ?> <?php if($this->session->userdata('user_lotw_name') != "") { ?>
<td>LoTW</td> <th>LoTW</th>
<?php } ?> <?php } ?>
<?php } ?> <?php } ?>
<td><?php echo $this->lang->line('gen_hamradio_station'); ?></td> <th><?php echo $this->lang->line('gen_hamradio_station'); ?></th>
<?php if(($this->config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?> <?php if(($this->config->item('use_auth')) && ($this->session->userdata('user_type') >= 2)) { ?>
<td></td> <th></th>
<?php } ?> <?php } ?>
</tr> </tr>
</thead>
<tbody>
<?php $i = 0; <?php $i = 0;
foreach ($results->result() as $row) { foreach ($results->result() as $row) {
@ -248,7 +250,7 @@ function echoQrbCalcLink($mygrid, $grid, $vucc) {
<?php } ?> <?php } ?>
</tr> </tr>
<?php $i++; } ?> <?php $i++; } ?>
</tbody>
</table></div> </table></div>
<?php } ?> <?php } ?>

查看文件

@ -0,0 +1,153 @@
var osmUrl = $('#dxccmapjs').attr("tileUrl");
function load_dxcc_map() {
$('.nav-tabs a[href="#dxccmaptab"]').tab('show');
$.ajax({
url: base_url + 'index.php/awards/dxcc_map',
type: 'post',
data: {
band: $('#band2').val(),
mode: $('#mode').val(),
worked: +$('#worked').prop('checked'),
confirmed: +$('#confirmed').prop('checked'),
notworked: +$('#notworked').prop('checked'),
qsl: +$('#qsl').prop('checked'),
lotw: +$('#lotw').prop('checked'),
includedeleted: +$('#includedeleted').prop('checked'),
Africa: +$('#Africa').prop('checked'),
Asia: +$('#Asia').prop('checked'),
Europe: +$('#Europe').prop('checked'),
NorthAmerica: +$('#NorthAmerica').prop('checked'),
SouthAmerica: +$('#SouthAmerica').prop('checked'),
Oceania: +$('#Oceania').prop('checked'),
Antarctica: +$('#Antarctica').prop('checked'),
},
success: function(data) {
load_dxcc_map2(data, worked, confirmed, notworked);
},
error: function() {
},
});
}
function load_dxcc_map2(data, worked, confirmed, notworked) {
// If map is already initialized
var container = L.DomUtil.get('dxccmap');
if(container != null){
container._leaflet_id = null;
container.remove();
$("#dxccmaptab").append('<div id="dxccmap"></div>');
}
var map = L.map('dxccmap');
L.tileLayer(
osmUrl,
{
attribution: '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
maxZoom: 18
}
).addTo(map);
var notworkedcount = data.length;
var confirmedcount = 0;
var workednotconfirmedcount = 0;
for (var i = 0; i < data.length; i++) {
var D = data[i];
if (D['status'] != 'x') {
var mapColor = 'red';
if (D['status'] == 'C') {
mapColor = 'green';
if (confirmed != '0') {
addMarker(L, D, mapColor, map);
confirmedcount++;
notworkedcount--;
}
}
if (D['status'] == 'W') {
mapColor = 'orange';
if (worked != '0') {
addMarker(L, D, mapColor, map);
workednotconfirmedcount++;
notworkedcount--;
}
}
// Make a check here and hide what I don't want to show
if (notworked != '0') {
if (mapColor == 'red') {
addMarker(L, D, mapColor, map);
}
}
}
}
/*Legend specific*/
var legend = L.control({ position: "topright" });
if (notworked.checked == false) {
notworkedcount = 0;
}
legend.onAdd = function(map) {
var div = L.DomUtil.create("div", "legend");
div.innerHTML += "<h4>Colors</h4>";
div.innerHTML += '<i style="background: green"></i><span>Confirmed ('+confirmedcount+')</span><br>';
div.innerHTML += '<i style="background: orange"></i><span>Worked not confirmed ('+workednotconfirmedcount+')</span><br>';
div.innerHTML += '<i style="background: red"></i><span>Not worked ('+notworkedcount+')</span><br>';
return div;
};
legend.addTo(map);
map.setView([20, 0], 2);
}
function addMarker(L, D, mapColor, map) {
var title = '<span><font style="color: ' +mapColor+ '; text-shadow: 1px 0 #fff, -1px 0 #fff, 0 1px #fff, 0 -1px #fff, 1px 1px #fff, -1px -1px #fff, 1px -1px #fff, -1px 1px #fff;font-size: 14px; font-weight: 900;">' + D['prefix'] + '</font></span>';
var myIcon = L.divIcon({className: 'my-div-icon', html: title});
const markerHtmlStyles = `
background-color: ${mapColor};
width: 1rem;
height: 1rem;
display: block;
position: relative;
border-radius: 3rem 3rem 0;
transform: rotate(45deg);
border: 1px solid #FFFFFF`
const icon = L.divIcon({
className: "my-custom-pin",
iconAnchor: [0, 24],
labelAnchor: [-6, 0],
popupAnchor: [0, -36],
html: `<span style="${markerHtmlStyles}" />`
})
L.marker(
[D['lat'], D['long']], {
icon: myIcon,
adif: D['adif'],
title: D['prefix'] + ' - ' + D['name'],
}
).addTo(map).on('click', onClick);
L.marker(
[D['lat'], D['long']], {
icon: icon,
adif: D['adif'],
title: D['prefix'] + ' - ' + D['name'],
}
).addTo(map).on('click', onClick);
}
function onClick(e) {
var marker = e.target;
displayContacts(marker.options.adif, $('#band2').val(), $('#mode').val(), 'DXCC2');
}