mirror of
https://github.com/wavelog/wavelog.git
synced 2026-03-22 10:24:14 +00:00
Merge pull request #261 from AndreasK79/public_export_map
Public export map
This commit is contained in:
@@ -22,6 +22,15 @@ class Visitor extends CI_Controller {
|
||||
}
|
||||
elseif($method == "search") {
|
||||
$this->search($method);
|
||||
}
|
||||
elseif($method == "exportmap") {
|
||||
$this->exportmap();
|
||||
}
|
||||
elseif($method == "mapqsos") {
|
||||
$this->mapqsos();
|
||||
}
|
||||
elseif($method == "get_map_custom") {
|
||||
$this->get_map_custom();
|
||||
}
|
||||
else {
|
||||
$this->index($method);
|
||||
@@ -410,4 +419,141 @@ class Visitor extends CI_Controller {
|
||||
}
|
||||
}
|
||||
|
||||
public function exportmap() {
|
||||
$data['page_title'] = "Export Map";
|
||||
$this->load->view('visitor/exportmap/header', $data);
|
||||
$this->load->view('visitor/exportmap/exportmap', $data);
|
||||
$this->load->view('visitor/exportmap/footer');
|
||||
}
|
||||
|
||||
public function mapqsos() {
|
||||
$this->load->model('logbook_model');
|
||||
|
||||
$this->load->library('qra');
|
||||
|
||||
$slug = $this->security->xss_clean($this->input->get('slug'));
|
||||
$qsocount = $this->security->xss_clean($this->input->get('qsocount')) == '' ? '100' : $this->security->xss_clean($this->input->get('qsocount'));
|
||||
$band = $this->security->xss_clean($this->input->get('band'));
|
||||
|
||||
$this->load->model('stationsetup_model');
|
||||
$logbook_id = $this->stationsetup_model->public_slug_exists_logbook_id($slug);
|
||||
if($logbook_id != false)
|
||||
{
|
||||
// Get associated station locations for mysql queries
|
||||
$logbooks_locations_array = $this->stationsetup_model->get_container_relations($logbook_id);
|
||||
|
||||
if (!$logbooks_locations_array) {
|
||||
show_404('Empty Logbook');
|
||||
}
|
||||
} else {
|
||||
log_message('error', $slug.' has no associated station locations');
|
||||
show_404('Unknown Public Page.');
|
||||
}
|
||||
|
||||
$qsos = $this->logbook_model->get_qsos($qsocount, null, $logbooks_locations_array, $band);
|
||||
$userid = $this->stationsetup_model->public_slug_exists_userid($slug);
|
||||
$user_default_confirmation = $this->get_user_default_confirmation($userid);
|
||||
|
||||
$mappedcoordinates = array();
|
||||
foreach ($qsos->result('array') as $qso) {
|
||||
if (!empty($qso['COL_MY_GRIDSQUARE']) || !empty($qso['COL_MY_VUCC_GRIDS'])) {
|
||||
if (!empty($qso['COL_GRIDSQUARE']) || !empty($qso['COL_VUCC_GRIDS'])) {
|
||||
$mappedcoordinates[] = $this->calculate($qso, ($qso['COL_MY_GRIDSQUARE'] ?? '') == '' ? $qso['COL_MY_VUCC_GRIDS'] : $qso['COL_MY_GRIDSQUARE'], ($qso['COL_GRIDSQUARE'] ?? '') == '' ? $qso['COL_VUCC_GRIDS'] : $qso['COL_GRIDSQUARE'], $user_default_confirmation);
|
||||
} else {
|
||||
if (!empty($qso['lat']) || !empty($qso['long'])) {
|
||||
$mappedcoordinates[] = $this->calculateCoordinates($qso, $qso['lat'], $qso['long'], ($qso['COL_MY_GRIDSQUARE'] ?? '') == '' ? $qso['COL_MY_VUCC_GRIDS'] : $qso['COL_MY_GRIDSQUARE'], $user_default_confirmation);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
header('Content-Type: application/json; charset=utf-8');
|
||||
echo json_encode($mappedcoordinates);
|
||||
}
|
||||
|
||||
public function calculate($qso, $locator1, $locator2, $user_default_confirmation) {
|
||||
$this->load->library('Qra');
|
||||
$this->load->model('logbook_model');
|
||||
|
||||
$latlng1 = $this->qra->qra2latlong($locator1);
|
||||
$latlng2 = $this->qra->qra2latlong($locator2);
|
||||
$latlng1[0] = number_format((float)$latlng1[0], 3, '.', '');;
|
||||
$latlng1[1] = number_format((float)$latlng1[1], 3, '.', '');;
|
||||
$latlng2[0] = number_format((float)$latlng2[0], 3, '.', '');;
|
||||
$latlng2[1] = number_format((float)$latlng2[1], 3, '.', '');;
|
||||
|
||||
$data['latlng1'] = $latlng1;
|
||||
$data['latlng2'] = $latlng2;
|
||||
$data['confirmed'] = ($this->qso_is_confirmed($qso, $user_default_confirmation)==true) ? true : false;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function calculateCoordinates($qso, $lat, $long, $mygrid, $user_default_confirmation) {
|
||||
$this->load->library('Qra');
|
||||
$this->load->model('logbook_model');
|
||||
|
||||
$latlng1 = $this->qra->qra2latlong($mygrid);
|
||||
$latlng2[0] = $lat;
|
||||
$latlng2[1] = $long;
|
||||
$latlng1[0] = number_format((float)$latlng1[0], 3, '.', '');;
|
||||
$latlng1[1] = number_format((float)$latlng1[1], 3, '.', '');;
|
||||
$latlng2[0] = number_format((float)$latlng2[0], 3, '.', '');;
|
||||
$latlng2[1] = number_format((float)$latlng2[1], 3, '.', '');;
|
||||
|
||||
$data['latlng1'] = $latlng1;
|
||||
$data['latlng2'] = $latlng2;
|
||||
$data['confirmed'] = ($this->qso_is_confirmed($qso, $user_default_confirmation)==true) ? true : false;
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
// [MAP Custom] //
|
||||
public function get_map_custom() {
|
||||
$this->load->model('stationsetup_model');
|
||||
$slug = $this->security->xss_clean($this->input->post('slug'));
|
||||
$userid = $this->stationsetup_model->public_slug_exists_userid($slug);
|
||||
|
||||
$this->load->model('user_options_model');
|
||||
|
||||
$result=$this->user_options_model->get_options('map_custom', null, $userid);
|
||||
$jsonout=[];
|
||||
foreach($result->result() as $options) {
|
||||
if ($options->option_name=='icon') $jsonout[$options->option_key]=json_decode($options->option_value,true);
|
||||
else $jsonout[$options->option_name.'_'.$options->option_key]=$options->option_value;
|
||||
}
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode($jsonout);
|
||||
}
|
||||
|
||||
function qso_is_confirmed($qso, $user_default_confirmation) {
|
||||
$confirmed = false;
|
||||
$qso = (array) $qso;
|
||||
if (strpos($user_default_confirmation, 'Q') !== false) { // QSL
|
||||
if ($qso['COL_QSL_RCVD']=='Y') { $confirmed = true; }
|
||||
}
|
||||
if (strpos($user_default_confirmation, 'L') !== false) { // LoTW
|
||||
if ($qso['COL_LOTW_QSL_RCVD']=='Y') { $confirmed = true; }
|
||||
}
|
||||
if (strpos($user_default_confirmation, 'E') !== false) { // eQsl
|
||||
if ($qso['COL_EQSL_QSL_RCVD']=='Y') { $confirmed = true; }
|
||||
}
|
||||
if (strpos($user_default_confirmation, 'Z') !== false) { // QRZ
|
||||
if ($qso['COL_QRZCOM_QSO_DOWNLOAD_STATUS']=='Y') { $confirmed = true; }
|
||||
}
|
||||
return $confirmed;
|
||||
}
|
||||
|
||||
function get_user_default_confirmation($userid) {
|
||||
$this->db->where('user_id', $userid);
|
||||
$query = $this->db->get('users');
|
||||
|
||||
if ($query->num_rows() > 0){
|
||||
foreach ($query->result() as $row) {
|
||||
return $row->user_default_confirmation;
|
||||
}
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1697,7 +1697,7 @@ class Logbook_model extends CI_Model {
|
||||
return $query;
|
||||
}
|
||||
|
||||
function get_qsos($num, $offset, $StationLocationsArray = null) {
|
||||
function get_qsos($num, $offset, $StationLocationsArray = null, $band = '') {
|
||||
if($StationLocationsArray == null) {
|
||||
$this->load->model('logbooks_model');
|
||||
$logbooks_locations_array = $this->logbooks_model->list_logbook_relationships($this->session->userdata('active_station_logbook'));
|
||||
@@ -1719,6 +1719,16 @@ class Logbook_model extends CI_Model {
|
||||
$this->db->join('station_profile', 'station_profile.station_id = '.$this->config->item('table_name').'.station_id');
|
||||
$this->db->join('dxcc_entities', $this->config->item('table_name').'.col_dxcc = dxcc_entities.adif', 'left');
|
||||
$this->db->join('lotw_users', 'lotw_users.callsign = '.$this->config->item('table_name').'.col_call', 'left outer');
|
||||
|
||||
if ($band != '') {
|
||||
if ($band == 'SAT') {
|
||||
$this->db->where($this->config->item('table_name').'.col_prop_mode', 'SAT');
|
||||
} else {
|
||||
$this->db->where($this->config->item('table_name').'.col_prop_mode !="SAT"');
|
||||
$this->db->where($this->config->item('table_name').'.col_band', $band);
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->where_in($this->config->item('table_name').'.station_id', $logbooks_locations_array);
|
||||
$this->db->order_by(''.$this->config->item('table_name').'.COL_TIME_ON', "desc");
|
||||
|
||||
|
||||
@@ -156,6 +156,37 @@ class Stationsetup_model extends CI_Model {
|
||||
$this->db->join('dxcc_entities','station_profile.station_dxcc = dxcc_entities.adif','left outer');
|
||||
return $this->db->get('station_profile');
|
||||
}
|
||||
|
||||
function get_container_relations($logbook_id) {
|
||||
|
||||
$relationships_array = array();
|
||||
|
||||
$this->db->where('station_logbook_id', $logbook_id);
|
||||
$query = $this->db->get('station_logbooks_relationship');
|
||||
|
||||
if ($query->num_rows() > 0){
|
||||
foreach ($query->result() as $row) {
|
||||
array_push($relationships_array, $row->station_location_id);
|
||||
}
|
||||
|
||||
return $relationships_array;
|
||||
} else {
|
||||
return array(-1); // Put some default-Value here, if no relation found
|
||||
}
|
||||
}
|
||||
|
||||
function public_slug_exists_userid($slug) {
|
||||
$this->db->where('public_slug', $this->security->xss_clean($slug));
|
||||
$query = $this->db->get('station_logbooks');
|
||||
|
||||
if ($query->num_rows() > 0){
|
||||
foreach ($query->result() as $row) {
|
||||
return $row->user_id;
|
||||
}
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -11,7 +11,7 @@ class User_options_model extends CI_Model {
|
||||
public function set_option($option_type, $option_name, $option_array) {
|
||||
$uid=$this->session->userdata('user_id');
|
||||
$sql='insert into user_options (user_id,option_type,option_name,option_key,option_value) values (?,?,?,?,?) ON DUPLICATE KEY UPDATE option_value=?';
|
||||
foreach($option_array as $option_key => $option_value) {
|
||||
foreach($option_array as $option_key => $option_value) {
|
||||
$query = $this->db->query($sql, array($uid, $option_type, $option_name, $option_key, $option_value, $option_value));
|
||||
}
|
||||
}
|
||||
@@ -31,10 +31,10 @@ class User_options_model extends CI_Model {
|
||||
} else {
|
||||
log_message('error','set_option_at_all_users() failed because users table is empty');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function get_options($option_type, $option_array=null, $uid=null) {
|
||||
if ($uid ?? '' == '') {
|
||||
if (($uid ?? '') == '') {
|
||||
$uid=$this->session->userdata('user_id');
|
||||
}
|
||||
$sql_more = "";
|
||||
@@ -58,7 +58,7 @@ class User_options_model extends CI_Model {
|
||||
$sql_more .= ' and '.$key.'=?';
|
||||
$array_sql_value[] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
$sql='delete from user_options where user_id=? and option_type=? and option_name=?'.$sql_more;
|
||||
return $this->db->query($sql, $array_sql_value);
|
||||
}
|
||||
|
||||
7
application/views/visitor/exportmap/exportmap.php
Normal file
7
application/views/visitor/exportmap/exportmap.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<style>
|
||||
#exportmap {
|
||||
height: 100vh;
|
||||
max-height: 900px !important;
|
||||
}
|
||||
</style>
|
||||
<div id="exportmap" class="map-leaflet"></div>
|
||||
31
application/views/visitor/exportmap/footer.php
Normal file
31
application/views/visitor/exportmap/footer.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<!-- General JS Files used across Wavelog -->
|
||||
<script src="<?php echo base_url(); ?>assets/js/jquery-3.3.1.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/js/jquery.fancybox.min.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/js/bootstrap.bundle.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/leaflet/leaflet.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/leaflet/L.Maidenhead.qrb.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/leaflet/leaflet.geodesic.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url() ;?>assets/js/darkmodehelpers.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/js/bootstrapdialog/js/bootstrap-dialog.min.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url() ;?>assets/js/easyprint.js"></script>
|
||||
<script src="<?php echo base_url(); ?>assets/js/htmx.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
/*
|
||||
*
|
||||
* Define global javascript variables
|
||||
*
|
||||
*/
|
||||
var base_url = "<?php echo base_url(); ?>"; // Base URL
|
||||
var site_url = "<?php echo site_url(); ?>"; // Site URL
|
||||
var icon_dot_url = "<?php echo base_url();?>assets/images/dot.png";
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/L.Maidenhead.js"></script>
|
||||
<script id="leafembed" type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/leafembed.js" tileUrl="<?php echo $this->optionslib->get_option('map_tile_server');?>"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url();?>assets/js/sections/exportmap.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url();?>assets/js/sections/cqmap_geojson.js"></script>
|
||||
<script type="text/javascript" src="<?php echo base_url();?>assets/js/leaflet/leaflet.geodesic.js"></script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
32
application/views/visitor/exportmap/header.php
Normal file
32
application/views/visitor/exportmap/header.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<!-- Required meta tags -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
|
||||
<!-- Bootstrap CSS -->
|
||||
<?php if($this->optionslib->get_theme()) { ?>
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/<?php echo $this->optionslib->get_theme();?>/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/general.css">
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/visitor.css">
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/bootstrap-dialog.css"/>
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/<?php echo $this->optionslib->get_theme();?>/overrides.css">
|
||||
<?php } ?>
|
||||
|
||||
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/fontawesome/css/all.css">
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/js/leaflet/leaflet.css" />
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/loading.min.css" />
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/ldbtn.min.css" />
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/buttons.dataTables.min.css"/>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>assets/css/datatables.min.css"/>
|
||||
|
||||
<link rel="icon" href="<?php echo base_url(); ?>favicon.ico">
|
||||
|
||||
<title><?php if(isset($page_title)) { echo $page_title; } ?> - Wavelog</title>
|
||||
</head>
|
||||
<body>
|
||||
240
assets/js/sections/exportmap.js
Normal file
240
assets/js/sections/exportmap.js
Normal file
@@ -0,0 +1,240 @@
|
||||
var zonemarkers = [];
|
||||
var clicklines = [];
|
||||
|
||||
var iconsList = { 'qso': { 'color': defaultlinecolor, 'icon': 'fas fa-dot-circle', 'iconSize': [5, 5] }, 'qsoconfirm': { 'color': defaultlinecolor, 'icon': 'fas fa-dot-circle', 'iconSize': [5, 5] } };
|
||||
|
||||
var stationIcon = L.divIcon({ className: 'cspot_station', iconSize: [5, 5], iconAnchor: [5, 5]});
|
||||
var qsoIcon = L.divIcon({ className: 'cspot_qso', iconSize: [5, 5], iconAnchor: [5, 5] }); //default (fas fa-dot-circle red)
|
||||
var qsoconfirmIcon = L.divIcon({ className: 'cspot_qsoconfirm', iconSize: [5, 5], iconAnchor: [5, 5] });
|
||||
var redIconImg = L.icon({ iconUrl: icon_dot_url, iconSize: [5, 5] }); // old //
|
||||
|
||||
var defaultlinecolor = 'blue';
|
||||
|
||||
if (isDarkModeTheme()) {
|
||||
defaultlinecolor = 'red';
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
mapQsos();
|
||||
});
|
||||
|
||||
function mapQsos(form) {
|
||||
const queryString = window.location.search;
|
||||
const urlParams = new URLSearchParams(queryString);
|
||||
const slug = urlParams.get('slug');
|
||||
const qsocount = urlParams.get('qsocount');
|
||||
const showgrid = urlParams.get('showgrid');
|
||||
const showcq = urlParams.get('showcq');
|
||||
const band = urlParams.get('band');
|
||||
const showlines = urlParams.get('showlines');
|
||||
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/visitor/mapqsos/',
|
||||
type: 'get',
|
||||
data: {
|
||||
slug: slug,
|
||||
qsocount: qsocount,
|
||||
band: band
|
||||
},
|
||||
success: function(data) {
|
||||
|
||||
loadMapOptions(data, showgrid, showcq, showlines, slug);
|
||||
},
|
||||
error: function() {
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
function loadMapOptions(data, showgrid, showcq, showlines, slug) {
|
||||
$.ajax({
|
||||
url: base_url + 'index.php/visitor/get_map_custom',
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: {
|
||||
slug: slug,
|
||||
},
|
||||
error: function () {
|
||||
},
|
||||
success: function (json_mapinfo) {
|
||||
if (typeof json_mapinfo.qso !== "undefined") {
|
||||
iconsList = json_mapinfo;
|
||||
}
|
||||
loadMap(data, showgrid, showcq, showlines, iconsList);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function loadMap(data, showgrid, showcq, showlines, iconsList) {
|
||||
var osmUrl='https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
|
||||
var osmAttrib='Map data © <a href="https://openstreetmap.org">OpenStreetMap</a> contributors';
|
||||
// If map is already initialized
|
||||
var container = L.DomUtil.get('exportmap');
|
||||
|
||||
var bounds = L.latLngBounds()
|
||||
|
||||
if(container != null){
|
||||
container._leaflet_id = null;
|
||||
container.remove();
|
||||
$("body").append('<div id="exportmap" class="map-leaflet"></div>');
|
||||
}
|
||||
|
||||
map = new L.Map('exportmap', {
|
||||
fullscreenControl: true,
|
||||
fullscreenControlOptions: {
|
||||
position: 'topleft'
|
||||
},
|
||||
});
|
||||
|
||||
var osm = L.tileLayer(
|
||||
osmUrl,
|
||||
{
|
||||
attribution: '© <a href="http://openstreetmap.org">OpenStreetMap</a> contributors, <a href="http://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>',
|
||||
maxZoom: 18,
|
||||
zoom: 3,
|
||||
minZoom: 2,
|
||||
}
|
||||
).addTo(map);
|
||||
|
||||
map.setView([30, 0], 1.5);
|
||||
|
||||
var redIcon = L.icon({
|
||||
iconUrl: icon_dot_url,
|
||||
iconSize: [10, 10], // size of the icon
|
||||
});
|
||||
|
||||
var counter = 0;
|
||||
|
||||
clicklines = [];
|
||||
$.each(data, function(k, v) {
|
||||
|
||||
if (this.latlng2[1] < -170) {
|
||||
this.latlng2[1] = parseFloat(this.latlng2[1])+360;
|
||||
}
|
||||
if (this.latlng1[1] < -170) {
|
||||
this.latlng1[1] = parseFloat(this.latlng1[1])+360;
|
||||
}
|
||||
|
||||
var marker = L.marker([this.latlng1[0], this.latlng1[1]], {icon: stationIcon}, {closeOnClick: false, autoClose: false}).addTo(map);
|
||||
|
||||
// var marker2 = L.marker([this.latlng2[0], this.latlng2[1]], {icon: redIcon},{closeOnClick: false, autoClose: false}).addTo(map);
|
||||
|
||||
if (this.confirmed && iconsList.qsoconfirm.icon !== "0") {
|
||||
var marker2 = L.marker([this.latlng2[0], this.latlng2[1]], {icon: qsoconfirmIcon},{closeOnClick: false, autoClose: false}).addTo(map);
|
||||
linecolor = iconsList.qsoconfirm.color;
|
||||
} else {
|
||||
var marker2 = L.marker([this.latlng2[0], this.latlng2[1]], {icon: qsoIcon},{closeOnClick: false, autoClose: false}).addTo(map);
|
||||
linecolor = iconsList.qso.color;
|
||||
}
|
||||
|
||||
if (showlines === "true") {
|
||||
const multiplelines = [];
|
||||
multiplelines.push(
|
||||
new L.LatLng(this.latlng1[0], this.latlng1[1]),
|
||||
new L.LatLng(this.latlng2[0], this.latlng2[1])
|
||||
)
|
||||
|
||||
const geodesic = L.geodesic(multiplelines, {
|
||||
weight: 1,
|
||||
opacity: 1,
|
||||
color: linecolor,
|
||||
wrap: false,
|
||||
steps: 100
|
||||
}).addTo(map);
|
||||
|
||||
map.addLayer(geodesic);
|
||||
}
|
||||
});
|
||||
|
||||
if (showgrid === "true") {
|
||||
maidenhead = L.maidenheadqrb().addTo(map);
|
||||
}
|
||||
|
||||
if (showcq === "true") {
|
||||
geojson = L.geoJson(zonestuff, {style: style}).addTo(map);
|
||||
for (var i = 0; i < cqzonenames.length; i++) {
|
||||
|
||||
var title = '<span class="grid-text" style="cursor: default"><font style="color: \'white\'; font-size: 1.5em; font-weight: 900;">' + (Number(i)+Number(1)) + '</font></span>';
|
||||
var myIcon = L.divIcon({className: 'my-div-icon', html: title});
|
||||
|
||||
var marker = L.marker(
|
||||
[cqzonenames[i][0], cqzonenames[i][1]], {
|
||||
icon: myIcon,
|
||||
title: (Number(i)+Number(1)),
|
||||
zIndex: 1000,
|
||||
}
|
||||
).addTo(map);
|
||||
zonemarkers.push(marker);
|
||||
}
|
||||
}
|
||||
|
||||
$.each(iconsList, function (icon, data) {
|
||||
$('#exportmap' + ' .cspot_' + icon).addClass(data.icon).css("color", data.color);
|
||||
});
|
||||
|
||||
map.addLayer(osm);
|
||||
|
||||
var printer = L.easyPrint({
|
||||
tileLayer: osm,
|
||||
sizeModes: ['Current', 'A4Landscape', 'A4Portrait'],
|
||||
filename: 'Wavelog',
|
||||
exportOnly: true,
|
||||
hideControlContainer: true
|
||||
}).addTo(map);
|
||||
}
|
||||
|
||||
function style(feature) {
|
||||
var bordercolor = "black";
|
||||
if (isDarkModeTheme()) {
|
||||
bordercolor = "white";
|
||||
}
|
||||
return {
|
||||
fillColor: "white",
|
||||
fillOpacity: 0,
|
||||
opacity: 0.65,
|
||||
color: bordercolor,
|
||||
weight: 1,
|
||||
};
|
||||
}
|
||||
|
||||
const cqzonenames = [
|
||||
[ "75", "-140" ],
|
||||
[ "70", "-82.5" ],
|
||||
[ "45", "-125" ],
|
||||
[ "45", "-100" ],
|
||||
[ "45", "-65" ],
|
||||
[ "25.5", "-115" ],
|
||||
[ "14.5", "-90" ],
|
||||
[ "22", "-60" ],
|
||||
[ "11.5", "-70" ],
|
||||
[ "-5", "-100" ],
|
||||
[ "-9", "-45" ],
|
||||
[ "-45", "-106" ],
|
||||
[ "-45", "-55" ],
|
||||
[ "52", "-14" ],
|
||||
[ "46", "11" ],
|
||||
[ "60", "35" ],
|
||||
[ "55", "65" ],
|
||||
[ "70", "90" ],
|
||||
[ "70", "150" ],
|
||||
[ "42", "29" ],
|
||||
[ "28", "53" ],
|
||||
[ "6", "75" ],
|
||||
[ "44", "93" ],
|
||||
[ "33", "110" ],
|
||||
[ "38", "134" ],
|
||||
[ "16", "100" ],
|
||||
[ "15", "140" ],
|
||||
[ "0", "125" ],
|
||||
[ "-25", "115" ],
|
||||
[ "-25", "145" ],
|
||||
[ "15", "-165" ],
|
||||
[ "-25", "-165" ],
|
||||
[ "32", "-26" ],
|
||||
[ "25", "25.5" ],
|
||||
[ "15", "-6" ],
|
||||
[ "-5", "-6" ],
|
||||
[ "6", "51" ],
|
||||
[ "-45", "8" ],
|
||||
[ "-25", "55"],
|
||||
[ "78", "-10"],
|
||||
];
|
||||
Reference in New Issue
Block a user