Handle absent colors in award maps

This commit is contained in:
phl0
2025-12-10 12:40:59 +01:00
parent 76492ad000
commit 6de5cff097
9 changed files with 73 additions and 41 deletions

View File

@@ -20,7 +20,7 @@ class Awards extends CI_Controller {
if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('error', __("You're not allowed to do that!")); redirect('dashboard'); }
$map_custom = json_decode($this->optionslib->get_map_custom());
$this->user_map_color_qso = $map_custom->qso->color;
$this->user_map_color_qso = $map_custom->qso->color ?? '';
$this->user_map_color_qsoconfirm = $map_custom->qsoconfirm->color ?? '';
$this->user_map_color_unworked = $map_custom->unworked->color ?? '';
}

View File

@@ -4,13 +4,17 @@ var geojson;
var map;
var info;
let confirmedColor = user_map_custom.qsoconfirm.color;
let workedColor = user_map_custom.qso.color;
let unworkedColor = '';
let unworkedColor = 'red';
if (typeof(user_map_custom.unworked) !== 'undefined') {
unworkedColor = user_map_custom.unworked.color;
} else {
unworkedColor = 'red';
}
let workedColor = 'rgba(255, 0, 0)';
if (typeof(user_map_custom.qso) !== 'undefined') {
workedColor = user_map_custom.qso.color;
}
let confirmedColor = 'rgba(144,238,144)';
if (typeof(user_map_custom.qsoconfirm) !== 'undefined') {
confirmedColor = user_map_custom.qsoconfirm.color;
}
document.addEventListener("DOMContentLoaded", function() {

View File

@@ -1,10 +1,14 @@
let confirmedColor = user_map_custom.qsoconfirm.color;
let workedColor = user_map_custom.qso.color;
let unworkedColor = '';
let unworkedColor = 'red';
if (typeof(user_map_custom.unworked) !== 'undefined') {
unworkedColor = user_map_custom.unworked.color;
} else {
unworkedColor = 'red';
}
let workedColor = 'rgba(255, 0, 0)';
if (typeof(user_map_custom.qso) !== 'undefined') {
workedColor = user_map_custom.qso.color;
}
let confirmedColor = 'rgba(144,238,144)';
if (typeof(user_map_custom.qsoconfirm) !== 'undefined') {
confirmedColor = user_map_custom.qsoconfirm.color;
}
var osmUrl = $('#iotamapjs').attr("tileUrl");

View File

@@ -4,13 +4,17 @@ let geojson;
let map;
let info;
let confirmedColor = user_map_custom.qsoconfirm.color;
let workedColor = user_map_custom.qso.color;
let unworkedColor = '';
let unworkedColor = 'red';
if (typeof(user_map_custom.unworked) !== 'undefined') {
unworkedColor = user_map_custom.unworked.color;
} else {
unworkedColor = 'red';
}
let workedColor = 'rgba(255, 0, 0)';
if (typeof(user_map_custom.qso) !== 'undefined') {
workedColor = user_map_custom.qso.color;
}
let confirmedColor = 'rgba(144,238,144)';
if (typeof(user_map_custom.qsoconfirm) !== 'undefined') {
confirmedColor = user_map_custom.qsoconfirm.color;
}
function load_itu_map() {

View File

@@ -1,11 +1,15 @@
let osmUrl = tileUrl;
let confirmedColor = user_map_custom.qsoconfirm.color;
let workedColor = user_map_custom.qso.color;
let unworkedColor = '';
let unworkedColor = 'red';
if (typeof(user_map_custom.unworked) !== 'undefined') {
unworkedColor = user_map_custom.unworked.color;
} else {
unworkedColor = 'red';
}
let workedColor = 'rgba(255, 0, 0)';
if (typeof(user_map_custom.qso) !== 'undefined') {
workedColor = user_map_custom.qso.color;
}
let confirmedColor = 'rgba(144,238,144)';
if (typeof(user_map_custom.qsoconfirm) !== 'undefined') {
confirmedColor = user_map_custom.qsoconfirm.color;
}
function load_jcc_map() {

View File

@@ -5,13 +5,17 @@ let map;
let info;
let clickmarkers = [];
let confirmedColor = user_map_custom.qsoconfirm.color;
let workedColor = user_map_custom.qso.color;
let unworkedColor = '';
let unworkedColor = 'red';
if (typeof(user_map_custom.unworked) !== 'undefined') {
unworkedColor = user_map_custom.unworked.color;
} else {
unworkedColor = 'red';
}
let workedColor = 'rgba(255, 0, 0)';
if (typeof(user_map_custom.qso) !== 'undefined') {
workedColor = user_map_custom.qso.color;
}
let confirmedColor = 'rgba(144,238,144)';
if (typeof(user_map_custom.qsoconfirm) !== 'undefined') {
confirmedColor = user_map_custom.qsoconfirm.color;
}
const states = 'AB,BC,MB,NB,NL,NT,NS,NU,ON,PE,QC,SK,YT';

View File

@@ -5,13 +5,17 @@ let map;
let info;
let clickmarkers = [];
let confirmedColor = user_map_custom.qsoconfirm.color;
let workedColor = user_map_custom.qso.color;
let unworkedColor = '';
let unworkedColor = 'red';
if (typeof(user_map_custom.unworked) !== 'undefined') {
unworkedColor = user_map_custom.unworked.color;
} else {
unworkedColor = 'red';
}
let workedColor = 'rgba(255, 0, 0)';
if (typeof(user_map_custom.qso) !== 'undefined') {
workedColor = user_map_custom.qso.color;
}
let confirmedColor = 'rgba(144,238,144)';
if (typeof(user_map_custom.qsoconfirm) !== 'undefined') {
confirmedColor = user_map_custom.qsoconfirm.color;
}
const states = '01,02,03,04,05,06,07,08,09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47';

View File

@@ -5,13 +5,17 @@ var map;
var info;
var clickmarkers = [];
let confirmedColor = user_map_custom.qsoconfirm.color;
let workedColor = user_map_custom.qso.color;
let unworkedColor = '';
let unworkedColor = 'red';
if (typeof(user_map_custom.unworked) !== 'undefined') {
unworkedColor = user_map_custom.unworked.color;
} else {
unworkedColor = 'red';
}
let workedColor = 'rgba(255, 0, 0)';
if (typeof(user_map_custom.qso) !== 'undefined') {
workedColor = user_map_custom.qso.color;
}
let confirmedColor = 'rgba(144,238,144)';
if (typeof(user_map_custom.qsoconfirm) !== 'undefined') {
confirmedColor = user_map_custom.qsoconfirm.color;
}
const states = 'DR,FL,FR,GD,GR,LB,NB,NH,OV,UT,ZH,ZL';

View File

@@ -5,13 +5,17 @@ let map;
let info;
let clickmarkers = [];
let confirmedColor = user_map_custom.qsoconfirm.color;
let workedColor = user_map_custom.qso.color;
let unworkedColor = '';
let unworkedColor = 'red';
if (typeof(user_map_custom.unworked) !== 'undefined') {
unworkedColor = user_map_custom.unworked.color;
} else {
unworkedColor = 'red';
}
let workedColor = 'rgba(255, 0, 0)';
if (typeof(user_map_custom.qso) !== 'undefined') {
workedColor = user_map_custom.qso.color;
}
let confirmedColor = 'rgba(144,238,144)';
if (typeof(user_map_custom.qsoconfirm) !== 'undefined') {
confirmedColor = user_map_custom.qsoconfirm.color;
}
const states = 'AK,AL,AR,AZ,CA,CO,CT,DE,FL,GA,HI,IA,ID,IL,IN,KS,KY,LA,MA,MD,ME,MI,MN,MO,MS,MT,NC,ND,NE,NH,NJ,NM,NV,NY,OH,OK,OR,PA,RI,SC,SD,TN,TX,UT,VA,VT,WA,WI,WV,WY';