JA gridmaster and a more generalized approach serving as blueprint for
future gridmaster map pages
这个提交包含在:
父节点
10f7f9ca6e
当前提交
3e18f50a90
共有 20 个文件被更改,包括 673 次插入 和 1 次删除
|
|
@ -587,7 +587,111 @@ class Awards extends CI_Controller {
|
|||
$this->load->view('interface_assets/footer',$footerData);
|
||||
}
|
||||
|
||||
public function getFfmaGridsjs() {
|
||||
public function ja_gridmaster() {
|
||||
$data['page_title']= lang('menu_ja_gridmaster');
|
||||
|
||||
$this->load->model('bands');
|
||||
$this->load->model('ja_gridmaster_model');
|
||||
$this->load->model('stations');
|
||||
|
||||
$data['homegrid']= explode(',', $this->stations->find_gridsquare());
|
||||
|
||||
$data['layer']= $this->optionslib->get_option('option_map_tile_server');
|
||||
|
||||
$data['attribution']= $this->optionslib->get_option('option_map_tile_server_copyright');
|
||||
|
||||
$data['gridsquares_gridsquares']= lang('gridsquares_gridsquares');
|
||||
$data['gridsquares_gridsquares_worked']= lang('gridsquares_gridsquares_worked');
|
||||
$data['gridsquares_gridsquares_lotw']= lang('gridsquares_gridsquares_lotw');
|
||||
$data['gridsquares_gridsquares_paper']= lang('gridsquares_gridsquares_paper');
|
||||
|
||||
$footerData = [];
|
||||
$footerData['scripts']= [
|
||||
'assets/js/leaflet/geocoding.js',
|
||||
'assets/js/leaflet/L.MaidenheadColouredJaGridmasterMap.js',
|
||||
'assets/js/sections/ja_gridmaster.js?'
|
||||
];
|
||||
|
||||
$this->load->view('interface_assets/header',$data);
|
||||
$this->load->view('awards/ja_gridmaster/index');
|
||||
$this->load->view('interface_assets/footer',$footerData);
|
||||
}
|
||||
|
||||
public function getJaGridmasterGridsjs() {
|
||||
$this->load->model('ja_gridmaster_model');
|
||||
|
||||
$array_grid_4char = array();
|
||||
$array_grid_4char_lotw = array();
|
||||
$array_grid_4char_paper = array();
|
||||
|
||||
$grid_4char = "";
|
||||
$grid_4char_lotw = "";
|
||||
|
||||
$query = $this->ja_gridmaster_model->get_lotw();
|
||||
if ($query && $query->num_rows() > 0) {
|
||||
foreach ($query->result() as $row) {
|
||||
$grid_4char_lotw = strtoupper(substr($row->GRID_SQUARES,0,4));
|
||||
if(!in_array($grid_4char_lotw, $array_grid_4char_lotw)){
|
||||
array_push($array_grid_4char_lotw, $grid_4char_lotw);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$query = $this->ja_gridmaster_model->get_paper();
|
||||
if ($query && $query->num_rows() > 0) {
|
||||
foreach ($query->result() as $row) {
|
||||
$grid_4char_paper = strtoupper(substr($row->GRID_SQUARES,0,4));
|
||||
if(!in_array($grid_4char_paper, $array_grid_4char_paper)){
|
||||
array_push($array_grid_4char_paper, $grid_4char_paper);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$query = $this->ja_gridmaster_model->get_worked();
|
||||
if ($query && $query->num_rows() > 0) {
|
||||
foreach ($query->result() as $row) {
|
||||
$grid_four = strtoupper(substr($row->GRID_SQUARES,0,4));
|
||||
if(!in_array($grid_four, $array_grid_4char)){
|
||||
array_push($array_grid_4char, $grid_four);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$vucc_grids = $this->ja_gridmaster_model->get_vucc_lotw();
|
||||
foreach($vucc_grids as $key) {
|
||||
$grid_four_lotw = strtoupper(substr($key,0,4));
|
||||
if(!in_array($grid_four_lotw, $array_grid_4char_lotw)){
|
||||
array_push($array_grid_4char_lotw, $grid_four_lotw);
|
||||
}
|
||||
}
|
||||
|
||||
$vucc_grids = $this->ja_gridmaster_model->get_vucc_paper();
|
||||
foreach($vucc_grids as $key) {
|
||||
$grid_four_paper = strtoupper(substr($key,0,4));
|
||||
if(!in_array($grid_four_paper, $array_grid_4char_paper)){
|
||||
array_push($array_grid_4char_paper, $grid_four_paper);
|
||||
}
|
||||
}
|
||||
|
||||
$vucc_grids = $this->ja_gridmaster_model->get_vucc_worked();
|
||||
foreach($vucc_grids as $key) {
|
||||
$grid_four = strtoupper(substr($key,0,4));
|
||||
if(!in_array($grid_four, $array_grid_4char)){
|
||||
array_push($array_grid_4char, $grid_four);
|
||||
}
|
||||
}
|
||||
|
||||
$data['grid_4char_lotw'] = ($array_grid_4char_lotw);
|
||||
$data['grid_4char_paper'] = ($array_grid_4char_paper);
|
||||
$data['grid_4char'] = ($array_grid_4char);
|
||||
$data['grid_count'] = $this->ja_gridmaster_model->get_grid_count();
|
||||
$data['grids'] = $this->ja_gridmaster_model->get_grids();
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
public function getFfmaGridsjs() {
|
||||
$this->load->model('ffma_model');
|
||||
|
||||
$array_grid_4char = array();
|
||||
|
|
|
|||
|
|
@ -86,4 +86,5 @@ $lang['menu_forum'] = 'Forum';
|
|||
$lang['menu_logout'] = 'Logout';
|
||||
|
||||
$lang['menu_ffma'] = "Fred Fish Memorial Award";
|
||||
$lang['menu_ja_gridmaster'] = 'JA Gridmaster';
|
||||
$lang['menu_maintenance']='Maintenance';
|
||||
|
|
|
|||
|
|
@ -86,4 +86,5 @@ $lang['menu_forum'] = '论坛';
|
|||
$lang['menu_logout'] = '注销';
|
||||
|
||||
$lang['menu_ffma'] = "Fred Fish Memorial Award";
|
||||
$lang['menu_ja_gridmaster'] = 'JA Gridmaster';
|
||||
$lang['menu_maintenance']='Maintenance';
|
||||
|
|
|
|||
|
|
@ -86,4 +86,5 @@ $lang['menu_forum'] = 'Fórum';
|
|||
$lang['menu_logout'] = 'Odhlásit se';
|
||||
|
||||
$lang['menu_ffma'] = "Fred Fish Memorial Award";
|
||||
$lang['menu_ja_gridmaster'] = 'JA Gridmaster';
|
||||
$lang['menu_maintenance']='Maintenance';
|
||||
|
|
|
|||
|
|
@ -86,4 +86,5 @@ $lang['menu_forum'] = 'Forum';
|
|||
$lang['menu_logout'] = 'Logout';
|
||||
|
||||
$lang['menu_ffma'] = "Fred Fish Memorial Award";
|
||||
$lang['menu_ja_gridmaster'] = 'JA Gridmaster';
|
||||
$lang['menu_maintenance']='Maintenance';
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ $lang['menu_cq'] = 'CQ';
|
|||
$lang['menu_dok'] = 'DOK';
|
||||
$lang['menu_dxcc'] = 'DXCC';
|
||||
$lang['menu_ffma'] = 'Fred Fish Memorial Award';
|
||||
$lang['menu_ja_gridmaster'] = 'JA Gridmaster';
|
||||
$lang['menu_iota'] = 'IOTA';
|
||||
$lang['menu_pota'] = 'POTA';
|
||||
$lang['menu_sig'] = 'SIG';
|
||||
|
|
|
|||
|
|
@ -86,4 +86,5 @@ $lang['menu_forum'] = 'Foorumi';
|
|||
$lang['menu_logout'] = 'Kirjaudu ulos';
|
||||
|
||||
$lang['menu_ffma'] = "Fred Fish Memorial Award";
|
||||
$lang['menu_ja_gridmaster'] = 'JA Gridmaster';
|
||||
$lang['menu_maintenance']='Maintenance';
|
||||
|
|
|
|||
|
|
@ -86,4 +86,5 @@ $lang['menu_forum'] = 'Forum';
|
|||
$lang['menu_logout'] = 'Logout';
|
||||
|
||||
$lang['menu_ffma'] = "Fred Fish Memorial Award";
|
||||
$lang['menu_ja_gridmaster'] = 'JA Gridmaster';
|
||||
$lang['menu_maintenance'] = 'Wartung';
|
||||
|
|
|
|||
|
|
@ -86,4 +86,5 @@ $lang['menu_forum'] = 'Forum';
|
|||
$lang['menu_logout'] = 'Logout';
|
||||
|
||||
$lang['menu_ffma'] = "Fred Fish Memorial Award";
|
||||
$lang['menu_ja_gridmaster'] = 'JA Gridmaster';
|
||||
$lang['menu_maintenance']='Maintenance';
|
||||
|
|
|
|||
|
|
@ -86,4 +86,5 @@ $lang['menu_forum'] = 'Forum';
|
|||
$lang['menu_logout'] = 'Logout';
|
||||
|
||||
$lang['menu_ffma'] = "Fred Fish Memorial Award";
|
||||
$lang['menu_ja_gridmaster'] = 'JA Gridmaster';
|
||||
$lang['menu_maintenance']='Maintenance';
|
||||
|
|
|
|||
|
|
@ -86,4 +86,5 @@ $lang['menu_forum'] = 'Forum';
|
|||
$lang['menu_logout'] = 'Logout';
|
||||
|
||||
$lang['menu_ffma'] = "Fred Fish Memorial Award";
|
||||
$lang['menu_ja_gridmaster'] = 'JA Gridmaster';
|
||||
$lang['menu_maintenance']='Maintenance';
|
||||
|
|
|
|||
|
|
@ -86,4 +86,5 @@ $lang['menu_forum'] = 'Форум';
|
|||
$lang['menu_logout'] = 'Выход';
|
||||
|
||||
$lang['menu_ffma'] = "Fred Fish Memorial Award";
|
||||
$lang['menu_ja_gridmaster'] = 'JA Gridmaster';
|
||||
$lang['menu_maintenance']='Maintenance';
|
||||
|
|
|
|||
|
|
@ -86,4 +86,5 @@ $lang['menu_forum'] = 'Forum';
|
|||
$lang['menu_logout'] = 'Logout';
|
||||
|
||||
$lang['menu_ffma'] = "Fred Fish Memorial Award";
|
||||
$lang['menu_ja_gridmaster'] = 'JA Gridmaster';
|
||||
$lang['menu_maintenance']='Maintenance';
|
||||
|
|
|
|||
|
|
@ -86,4 +86,5 @@ $lang['menu_forum'] = 'Forum';
|
|||
$lang['menu_logout'] = 'Logga ut';
|
||||
|
||||
$lang['menu_ffma'] = "Fred Fish Memorial Award";
|
||||
$lang['menu_ja_gridmaster'] = 'JA Gridmaster';
|
||||
$lang['menu_maintenance']='Underhåll';
|
||||
|
|
|
|||
|
|
@ -86,4 +86,5 @@ $lang['menu_forum'] = 'Forum';
|
|||
$lang['menu_logout'] = 'Logout';
|
||||
|
||||
$lang['menu_ffma'] = "Fred Fish Memorial Award";
|
||||
$lang['menu_ja_gridmaster'] = 'JA Gridmaster';
|
||||
$lang['menu_maintenance']='Maintenance';
|
||||
|
|
|
|||
|
|
@ -0,0 +1,172 @@
|
|||
<?php
|
||||
|
||||
class Ja_gridmaster_model extends CI_Model {
|
||||
|
||||
private $ja_grids = ['PL14', 'PL24', 'PL36', 'PL37', 'PL46', 'PL47', 'PL48', 'PL49', 'PL55', 'PL58', 'PM40', 'PM41', 'PM42', 'PM43',
|
||||
'PM44', 'PM50', 'PM51', 'PM52', 'PM53', 'PM54', 'PM62', 'PM63', 'PM64', 'PM65', 'PM66', 'PM73', 'PM74', 'PM75', 'PM76', 'PM83',
|
||||
'PM84', 'PM85', 'PM86', 'PM87', 'PM92', 'PM93', 'PM94', 'PM95', 'PM96', 'PM97', 'PM98', 'PM99', 'PN90', 'PN91', 'PN92', 'QL16',
|
||||
'QL17', 'QM05', 'QM06', 'QM07', 'QM08', 'QM09', 'QM19', 'QN00', 'QN01', 'QN02', 'QN03', 'QN04', 'QN05', 'QN11', 'QN12', 'QN13',
|
||||
'QN14', 'QN15', 'QN22', 'QN23', 'QN24', 'PL80', 'PM91', 'QL04', 'QL05', 'QL07', 'QL09', 'QL64', 'QM00', 'QM01', 'PL15', 'PL25',
|
||||
'PL54', 'PM57', 'QN33', 'QN34', 'QN35', 'QN45'
|
||||
];
|
||||
|
||||
function get_lotw() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$sql = 'SELECT distinct substring(COL_GRIDSQUARE,1,4) as GRID_SQUARES FROM '
|
||||
.$this->config->item('table_name')
|
||||
.' WHERE station_id in ('.$location_list.')'
|
||||
." and COL_LOTW_QSL_RCVD = 'Y'"
|
||||
." and COL_PROP_MODE = 'SAT'"
|
||||
.' AND substring(COL_GRIDSQUARE,1,4) in (\''.implode('\',\'', $this->ja_grids).'\')';
|
||||
return $this->db->query($sql);
|
||||
}
|
||||
|
||||
function get_paper() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$sql = 'SELECT distinct substring(COL_GRIDSQUARE,1,4) as GRID_SQUARES FROM '
|
||||
.$this->config->item('table_name')
|
||||
.' WHERE station_id in ('.$location_list.')'
|
||||
." and COL_QSL_RCVD = 'Y'"
|
||||
." and COL_PROP_MODE = 'SAT'"
|
||||
.' AND substring(COL_GRIDSQUARE,1,4) in (\''.implode('\',\'', $this->ja_grids).'\')';
|
||||
return $this->db->query($sql);
|
||||
}
|
||||
|
||||
function get_worked() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$sql = 'SELECT distinct substring(COL_GRIDSQUARE,1,4) as GRID_SQUARES FROM '
|
||||
.$this->config->item('table_name')
|
||||
.' WHERE station_id in ('.$location_list.')'
|
||||
." and COL_PROP_MODE = 'SAT'"
|
||||
.' AND substring(COL_GRIDSQUARE,1,4) in (\''.implode('\',\'', $this->ja_grids).'\')';
|
||||
return $this->db->query($sql);
|
||||
}
|
||||
|
||||
function get_vucc_lotw() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$sql = 'SELECT distinct COL_VUCC_GRIDS as VUCC_GRIDS FROM '
|
||||
.$this->config->item('table_name')
|
||||
.' WHERE station_id in ('.$location_list.')'
|
||||
." and COL_LOTW_QSL_RCVD = 'Y'"
|
||||
." and COL_VUCC_GRIDS != ''"
|
||||
." and COL_VUCC_GRIDS IS NOT NULL"
|
||||
." and COL_PROP_MODE = 'SAT'";
|
||||
$query = $this->db->query($sql);
|
||||
$vucc_grids = [];
|
||||
foreach ($query->result() as $row) {
|
||||
$grids = explode(',', $row->VUCC_GRIDS);
|
||||
foreach ($grids as $grid) {
|
||||
if (in_array(substr($grid, 0, 4), $this->ja_grids)) {
|
||||
if (!in_array(substr($grid, 0, 4), $vucc_grids)) {
|
||||
$vucc_grids[] = substr($grid, 0, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $vucc_grids;
|
||||
}
|
||||
|
||||
function get_vucc_paper() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$sql = 'SELECT distinct COL_VUCC_GRIDS as VUCC_GRIDS FROM '
|
||||
.$this->config->item('table_name')
|
||||
.' WHERE station_id in ('.$location_list.')'
|
||||
." and COL_QSL_RCVD = 'Y'"
|
||||
." and COL_VUCC_GRIDS != ''"
|
||||
." and COL_VUCC_GRIDS IS NOT NULL"
|
||||
." and COL_PROP_MODE = 'SAT'";
|
||||
$query = $this->db->query($sql);
|
||||
$vucc_grids = [];
|
||||
foreach ($query->result() as $row) {
|
||||
$grids = explode(',', $row->VUCC_GRIDS);
|
||||
foreach ($grids as $grid) {
|
||||
if (in_array(substr($grid, 0, 4), $this->ja_grids)) {
|
||||
if (!in_array(substr($grid, 0, 4), $vucc_grids)) {
|
||||
$vucc_grids[] = substr($grid, 0, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $vucc_grids;
|
||||
}
|
||||
|
||||
function get_vucc_worked() {
|
||||
$CI =& get_instance();
|
||||
$CI->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $CI->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
return null;
|
||||
}
|
||||
$location_list = "'".implode("','",$logbooks_locations_array)."'";
|
||||
|
||||
$sql = 'SELECT distinct COL_VUCC_GRIDS as VUCC_GRIDS FROM '
|
||||
.$this->config->item('table_name')
|
||||
.' WHERE station_id in ('.$location_list.')'
|
||||
." and COL_VUCC_GRIDS != ''"
|
||||
." and COL_VUCC_GRIDS IS NOT NULL"
|
||||
." and COL_PROP_MODE = 'SAT'";
|
||||
$query = $this->db->query($sql);
|
||||
$vucc_grids = [];
|
||||
foreach ($query->result() as $row) {
|
||||
$grids = explode(',', $row->VUCC_GRIDS);
|
||||
foreach ($grids as $grid) {
|
||||
if (in_array(substr($grid, 0, 4), $this->ja_grids)) {
|
||||
if (!in_array(substr($grid, 0, 4), $vucc_grids)) {
|
||||
$vucc_grids[] = substr($grid, 0, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return $vucc_grids;
|
||||
}
|
||||
|
||||
function get_grid_count() {
|
||||
return count($this->ja_grids);
|
||||
}
|
||||
|
||||
function get_grids() {
|
||||
return $this->ja_grids;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
|
||||
|
||||
<style>
|
||||
/*Legend specific*/
|
||||
.legend {
|
||||
padding: 10px 10px 10px 10px;
|
||||
font: 14px Arial, Helvetica, sans-serif;
|
||||
background: white;
|
||||
line-height: 24px;
|
||||
color: #555;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.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;
|
||||
}
|
||||
.coordinates {
|
||||
justify-content: center;
|
||||
align-items: stretch;
|
||||
}
|
||||
.cohidden {
|
||||
display:none;
|
||||
}
|
||||
#latDeg, #lngDeg {
|
||||
width: 170px;
|
||||
}
|
||||
#locator, #distance, #bearing {
|
||||
width: 120px;
|
||||
}
|
||||
</style>
|
||||
<div class="container">
|
||||
|
||||
<br>
|
||||
|
||||
<h2><?php echo $page_title; ?></h2>
|
||||
|
||||
<?php if($this->session->flashdata('message')) { ?>
|
||||
<!-- Display Message -->
|
||||
<div class="alert-message error">
|
||||
<p><?php echo $this->session->flashdata('message'); ?></p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div id="gridmapcontainer">
|
||||
<div id="gridsquare_map" style="width: 100%; height: 800px"></div>
|
||||
</div>
|
||||
<div class="coordinates d-flex">
|
||||
<div class="cohidden">Latitude: </div>
|
||||
<div class="cohidden col-auto text-success font-weight-bold" id="latDeg"></div>
|
||||
<div class="cohidden">Longitude: </div>
|
||||
<div class="cohidden col-auto text-success font-weight-bold" id="lngDeg"></div>
|
||||
<div class="cohidden">Gridsquare: </div>
|
||||
<div class="cohidden col-auto text-success font-weight-bold" id="locator"></div>
|
||||
<div class="cohidden">Distance: </div>
|
||||
<div class="cohidden col-auto text-success font-weight-bold" id="distance"></div>
|
||||
<div class="cohidden">Bearing: </div>
|
||||
<div class="cohidden col-auto text-success font-weight-bold" id="bearing"></div>
|
||||
</div>
|
||||
<script>var gridsquaremap = true;
|
||||
var type = "worked";
|
||||
<?php
|
||||
echo 'var jslayer ="' . $layer .'";';
|
||||
echo "var jsattribution ='" . $attribution . "';";
|
||||
echo "var homegrid ='" . strtoupper($homegrid[0]) . "';";
|
||||
|
||||
echo 'var gridsquares_gridsquares = "' . $gridsquares_gridsquares . '";';
|
||||
echo 'var gridsquares_gridsquares_worked = "' . $gridsquares_gridsquares_worked . '";';
|
||||
echo 'var gridsquares_gridsquares_lotw = "' . $gridsquares_gridsquares_lotw . '";';
|
||||
echo 'var gridsquares_gridsquares_paper = "' . $gridsquares_gridsquares_paper . '";';
|
||||
?>
|
||||
</script>
|
||||
|
|
@ -141,6 +141,8 @@
|
|||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="<?php echo site_url('awards/iota'); ?>"><i class="fas fa-trophy"></i> <?php echo lang('menu_iota'); ?></a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="<?php echo site_url('awards/ja_gridmaster'); ?>"><i class="fas fa-trophy"></i> <?php echo lang('menu_ja_gridmaster'); ?></a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="<?php echo site_url('awards/pota'); ?>"><i class="fas fa-trophy"></i> <?php echo lang('menu_pota'); ?></a>
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="<?php echo site_url('awards/sig'); ?>"><i class="fas fa-trophy"></i> <?php echo lang('menu_sig'); ?></a>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,153 @@
|
|||
/*
|
||||
* L.Maidenhead displays a Maidenhead Locator of lines on the map.
|
||||
*/
|
||||
|
||||
L.Maidenhead = L.LayerGroup.extend({
|
||||
|
||||
|
||||
options: {
|
||||
// Line and label color
|
||||
color: 'rgba(255, 0, 0, 0.4)',
|
||||
|
||||
// Redraw on move or moveend
|
||||
redraw: 'move'
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
L.LayerGroup.prototype.initialize.call(this);
|
||||
L.Util.setOptions(this, options);
|
||||
},
|
||||
|
||||
onAdd: function (map) {
|
||||
this._map = map;
|
||||
var grid = this.redraw();
|
||||
this._map.on('viewreset '+ this.options.redraw, function () {
|
||||
grid.redraw();
|
||||
});
|
||||
|
||||
this.eachLayer(map.addLayer, map);
|
||||
},
|
||||
|
||||
onRemove: function (map) {
|
||||
// remove layer listeners and elements
|
||||
map.off('viewreset '+ this.options.redraw, this.map);
|
||||
this.eachLayer(this.removeLayer, this);
|
||||
},
|
||||
|
||||
redraw: function () {
|
||||
var d3 = new Array(20, 10, 10, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1);
|
||||
var lat_cor = new Array(0, 8, 8, 8, 2.5, 2.2, 6, 8, 8, 8, 8, 8, 8); // Used for gridsquare text offset
|
||||
var bounds = map.getBounds();
|
||||
var zoom = map.getZoom();
|
||||
var unit = d3[zoom];
|
||||
var lcor = lat_cor[zoom];
|
||||
var w = bounds.getWest();
|
||||
var e = bounds.getEast();
|
||||
var n = bounds.getNorth();
|
||||
var s = bounds.getSouth();
|
||||
var c = 0.2;
|
||||
if (n > 85) n = 85;
|
||||
if (s < -85) s = -85;
|
||||
var left = Math.floor(w/(unit*2))*(unit*2);
|
||||
var right = Math.ceil(e/(unit*2))*(unit*2);
|
||||
var top = Math.ceil(n/unit)*unit;
|
||||
var bottom = Math.floor(s/unit)*unit;
|
||||
this.eachLayer(this.removeLayer, this);
|
||||
|
||||
for (var lon = left; lon < right; lon += (unit*2)) {
|
||||
if (lon > -180 || lon < 180) {
|
||||
for (var lat = bottom; lat < top; lat += unit) {
|
||||
var bounds = [[lat,lon],[lat+unit,lon+(unit*2)]];
|
||||
var locator = this._getLocator(lon,lat);
|
||||
|
||||
if(grid_four.includes(locator)) {
|
||||
|
||||
if(grid_four_lotw.includes(locator)) {
|
||||
var rectConfirmed = L.rectangle(bounds, {className: 'grid-rectangle grid-confirmed', color: 'rgba(144,238,144, 0.6)', weight: 1, fillOpacity: 1, fill:true, interactive: false});
|
||||
this.addLayer(rectConfirmed);
|
||||
} else if (grid_four_paper.includes(locator)) {
|
||||
var rectPaper = L.rectangle(bounds, {className: 'grid-rectangle grid-confirmed', color: 'rgba(0,176,240, 0.6)', weight: 1, fillOpacity: 1, fill:true, interactive: false});
|
||||
this.addLayer(rectPaper);
|
||||
} else {
|
||||
var rectWorked = L.rectangle(bounds, {className: 'grid-rectangle grid-worked', color: 'rgba(255,215,87, 0.6)', weight: 1, fillOpacity: 1, fill:true, interactive: false})
|
||||
this.addLayer(rectWorked);
|
||||
}
|
||||
// Controls text on grid on various zoom levels
|
||||
this.addLayer(this._getLabel(lon+unit-(unit/lcor),lat+(unit/2)+(unit/lcor*c)));
|
||||
} else if (grids.includes(locator)) {
|
||||
var rect = L.rectangle(bounds, {className: 'grid-rectangle grid-unworked', color: 'rgba(0,0,0, 0.3)', weight: 1, fillOpacity: 0.15, fill:true, interactive: false})
|
||||
this.addLayer(rect);
|
||||
this.addLayer(this._getLabel(lon+unit-(unit/lcor),lat+(unit/2)+(unit/lcor*c)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// Added this to print fields and field name, while still showing worked/confirmed gridsquares
|
||||
unit = 10;
|
||||
var left = Math.floor(w / (unit * 2)) * (unit * 2);
|
||||
var right = Math.ceil(e / (unit * 2)) * (unit * 2);
|
||||
var top = Math.ceil(n / unit) * unit;
|
||||
var bottom = Math.floor(s / unit) * unit;
|
||||
for (var lon = left; lon < right; lon += (unit * 2)) {
|
||||
for (var lat = bottom; lat < top; lat += unit) {
|
||||
var bounds = [[lat, lon], [lat + unit, lon + (unit * 2)]];
|
||||
|
||||
this.addLayer(L.rectangle(bounds, {
|
||||
className: 'grid-rectangle',
|
||||
color: this.options.color,
|
||||
weight: 1,
|
||||
fill: false,
|
||||
interactive: false
|
||||
}));
|
||||
}
|
||||
}
|
||||
return this;
|
||||
},
|
||||
|
||||
_getLabel: function(lon,lat) {
|
||||
var title_size = new Array(0, 10, 14, 16, 8.5, 13, 14, 16, 24, 36, 36, 64, 128); // Controls text size on labels
|
||||
var zoom = map.getZoom();
|
||||
var size = title_size[zoom]+'px';
|
||||
var title = '';
|
||||
var locator = this._getLocator(lon,lat);
|
||||
title = '<span class="grid-text" style="cursor: default;"><font style="color:'+this.options.color+'; font-size:'+size+'; font-weight: 900; ">' + locator + '</font></span>';
|
||||
var myIcon = L.divIcon({className: 'my-div-icon', html: title});
|
||||
var marker = L.marker([lat,lon], {icon: myIcon}, clickable=false);
|
||||
if (typeof gridsquaremap !== 'undefined' && gridsquaremap == true) {
|
||||
marker.on('click', function(event) {
|
||||
spawnGridsquareModal(locator);
|
||||
});
|
||||
}
|
||||
return marker;
|
||||
},
|
||||
|
||||
_getLocator: function(lon,lat) {
|
||||
var ydiv_arr=new Array(10, 1, 1/24, 1/240, 1/240/24);
|
||||
var d1 = "ABCDEFGHIJKLMNOPQR".split("");
|
||||
var d4 = new Array(0, 1, 1, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5);
|
||||
var locator = "";
|
||||
var x = lon;
|
||||
var y = lat;
|
||||
var precision = d4[map.getZoom()];
|
||||
while (x < -180) {x += 360;}
|
||||
while (x > 180) {x -=360;}
|
||||
x = x + 180;
|
||||
y = y + 90;
|
||||
locator = locator + d1[Math.floor(x/20)] + d1[Math.floor(y/10)];
|
||||
for (var i=0; i<4; i=i+1) {
|
||||
if (precision > i+1) {
|
||||
rlon = x%(ydiv_arr[i]*2);
|
||||
rlat = y%(ydiv_arr[i]);
|
||||
if ((i%2)==0) {
|
||||
locator += Math.floor(rlon/(ydiv_arr[i+1]*2)) +""+ Math.floor(rlat/(ydiv_arr[i+1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
return locator;
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
L.maidenhead = function (options) {
|
||||
return new L.Maidenhead(options);
|
||||
};
|
||||
143
assets/js/sections/ja_gridmaster.js
普通文件
143
assets/js/sections/ja_gridmaster.js
普通文件
|
|
@ -0,0 +1,143 @@
|
|||
var map;
|
||||
var grid_four = '';
|
||||
var grid_four_lotw = '';
|
||||
var grid_four_paper = '';
|
||||
|
||||
function gridPlot(form) {
|
||||
$(".ld-ext-right-plot").addClass('running');
|
||||
$(".ld-ext-right-plot").prop('disabled', true);
|
||||
$('#plot').prop("disabled", true);
|
||||
// If map is already initialized
|
||||
var container = L.DomUtil.get('gridsquare_map');
|
||||
|
||||
if(container != null){
|
||||
container._leaflet_id = null;
|
||||
container.remove();
|
||||
$("#gridmapcontainer").append('<div id="gridsquare_map" style="width: 100%; height: 800px"></div>');
|
||||
}
|
||||
|
||||
ajax_url = site_url + '/awards/getJaGridmasterGridsjs';
|
||||
|
||||
$.ajax({
|
||||
url: ajax_url,
|
||||
type: 'get',
|
||||
success: function (data) {
|
||||
$('.cohidden').show();
|
||||
$(".ld-ext-right-plot").removeClass('running');
|
||||
$(".ld-ext-right-plot").prop('disabled', false);
|
||||
$('#plot').prop("disabled", false);
|
||||
grids = data.grids;
|
||||
grid_max = data.grid_count;
|
||||
grid_four = data.grid_4char;
|
||||
grid_four_lotw = data.grid_4char_lotw;
|
||||
grid_four_paper = data.grid_4char_paper;
|
||||
paper_count = 0;
|
||||
grid_four_paper.forEach((element) => {
|
||||
if (!grid_four_lotw.includes(element)) {
|
||||
paper_count++;
|
||||
}
|
||||
});
|
||||
var layer = L.tileLayer(jslayer, {
|
||||
maxZoom: 12,
|
||||
attribution: jsattribution,
|
||||
id: 'mapbox.streets'
|
||||
});
|
||||
|
||||
map = L.map('gridsquare_map', {
|
||||
layers: [layer],
|
||||
center: [35, 140],
|
||||
zoom: 5,
|
||||
minZoom: 4,
|
||||
maxZoom: 12,
|
||||
fullscreenControl: true,
|
||||
fullscreenControlOptions: {
|
||||
position: 'topleft'
|
||||
},
|
||||
});
|
||||
|
||||
var printer = L.easyPrint({
|
||||
tileLayer: layer,
|
||||
sizeModes: ['Current'],
|
||||
filename: 'myMap',
|
||||
exportOnly: true,
|
||||
hideControlContainer: true
|
||||
}).addTo(map);
|
||||
|
||||
/*Legend specific*/
|
||||
var legend = L.control({ position: "topright" });
|
||||
|
||||
legend.onAdd = function(map) {
|
||||
var div = L.DomUtil.create("div", "legend");
|
||||
//div.innerHTML += "<h4>" + gridsquares_gridsquares + "</h4>";
|
||||
html = "<table border=\"0\">";
|
||||
html += '<tr><td><i style="background: #90ee90"></i><span>' + gridsquares_gridsquares_lotw + ':</span></td><td style=\"padding-left: 1em; text-align: right;\"><span>'+grid_four_lotw.length+' / '+grid_max+'</span></td></tr>';
|
||||
html += '<tr><td><i style="background: #00b0f0"></i><span>' + gridsquares_gridsquares_paper + ':</span></td><td style=\"padding-left: 1em; text-align: right;\"><span>'+paper_count+' / '+grid_max+'</span></td></tr>';
|
||||
html += '<tr><td><i style="background: #ffd757"></i><span>' + gridsquares_gridsquares_worked + ' ('+(Math.round((grid_four.length / grid_max) * 10000) / 100)+'%):</span></td><td style=\"padding-left: 1em; text-align: right;\"><span>'+(grid_four.length)+' / '+grid_max+'</span></td></tr>';
|
||||
html += "</table>";
|
||||
div.innerHTML = html;
|
||||
return div;
|
||||
};
|
||||
|
||||
legend.addTo(map);
|
||||
|
||||
var maidenhead = L.maidenhead().addTo(map);
|
||||
map.on('mousemove', onMapMove);
|
||||
|
||||
},
|
||||
error: function (data) {
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
function spawnGridsquareModal(loc_4char) {
|
||||
var ajax_data = ({
|
||||
'Searchphrase': loc_4char,
|
||||
'Band': 'SAT',
|
||||
'Type': 'VUCC'
|
||||
})
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/awards/qso_details_ajax',
|
||||
type: 'post',
|
||||
data: ajax_data,
|
||||
success: function (html) {
|
||||
BootstrapDialog.show({
|
||||
title: lang_general_word_qso_data,
|
||||
cssClass: 'qso-dialog',
|
||||
size: BootstrapDialog.SIZE_WIDE,
|
||||
nl2br: false,
|
||||
message: html,
|
||||
onshown: function(dialog) {
|
||||
|
||||
$('[data-toggle="tooltip"]').tooltip();
|
||||
$('.contacttable').DataTable({
|
||||
"pageLength": 25,
|
||||
responsive: false,
|
||||
ordering: false,
|
||||
"scrollY": "550px",
|
||||
"scrollCollapse": true,
|
||||
"paging": false,
|
||||
"scrollX": true,
|
||||
dom: 'Bfrtip',
|
||||
buttons: [
|
||||
'csv'
|
||||
]
|
||||
});
|
||||
// change color of csv-button if dark mode is chosen
|
||||
if (isDarkModeTheme()) {
|
||||
$(".buttons-csv").css("color", "white");
|
||||
}
|
||||
},
|
||||
buttons: [{
|
||||
label: 'Close',
|
||||
action: function(dialogItself) {
|
||||
dialogItself.close();
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
gridPlot(this.form);
|
||||
})
|
||||
正在加载…
在新工单中引用