Merge pull request #1015 from AndreasK79/was_map_more_tweaks

[WAS Map] Added JS from this fork https://github.com/kcaran/us-map to…
pull/1019/head
Peter Goodhall 2021-05-02 22:16:58 +01:00 zatwierdzone przez GitHub
commit 141f3243d1
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 99 dodań i 30 usunięć

Wyświetl plik

@ -346,12 +346,14 @@ class Logbook_model extends CI_Model {
$this->db->where('station_id', $station_id);
$this->db->where('COL_STATE', $state);
$this->db->where_in('COL_DXCC', ['291', '6', '110']);
if($band != "SAT") {
$this->db->where('COL_PROP_MODE !=', 'SAT');
$this->db->where('COL_BAND', $band);
} else {
$this->db->where('COL_PROP_MODE', "SAT");
}
if($band != 'All') {
if($band != "SAT") {
$this->db->where('COL_PROP_MODE !=', 'SAT');
$this->db->where('COL_BAND', $band);
} else {
$this->db->where('COL_PROP_MODE', "SAT");
}
}
return $this->db->get($this->config->item('table_name'));
}

Wyświetl plik

@ -2,7 +2,7 @@
<html>
<head>
<title>US Map Demo</title>
<style>
#alert {
font-family: Arial, Helvetica, sans-serif;
@ -13,18 +13,18 @@
font-weight: bold;
}
</style>
<script src="<?php echo base_url(); ?>assets/js/raphael.js"></script>
<script src="<?php echo base_url(); ?>assets/js/jquery-3.3.1.min.js"></script>
<script src="<?php echo base_url(); ?>assets/js/color.jquery.js"></script>
<script src="<?php echo base_url(); ?>assets/js/jquery.usmap.js"></script>
<script src="<?php echo base_url(); ?>assets/js/jquery.usmap.min.js"></script>
<script>
$(document).ready(function() {
$('#map').usmap({
showLabels: false,
showLabels: true,
'stateStyles': {
fill: '#4ECDC4',
fill: '#4ECDC4',
"stroke-width": 1,
'stroke' : '#036'
},
@ -34,7 +34,7 @@
'stateSpecificStyles': {
<?php foreach ($was_array as $was => $value) { ?>
'<?php echo $was; ?>' :
<?php
<?php
foreach ($value as $key) {
if($key != "") {
if (strpos($key, '>W<') !== false) {
@ -54,31 +54,97 @@
}
?>
},
'stateSpecificHoverStyles': {
'HI' : {fill: '#ff0'}
},
'mouseoverState': {
'HI' : function(event, data) {
//return false;
}
},
// Show tooltip when hovering over state
mouseover: function(event, data) {
let nameList = {
"AL":"Alabama",
"AK":"Alaska",
"AZ":"Arizona",
"AR":"Arkansas",
"CA":"California",
"CO":"Colorado",
"CT":"Connecticut",
"DE":"Delaware",
"DC":"District Of Columbia",
"FL":"Florida",
"GA":"Georgia",
"HI":"Hawaii",
"ID":"Idaho",
"IL":"Illinois",
"IN":"Indiana",
"IA":"Iowa",
"KS":"Kansas",
"KY":"Kentucky",
"LA":"Louisiana",
"ME":"Maine",
"MD":"Maryland",
"MA":"Massachusetts",
"MI":"Michigan",
"MN":"Minnesota",
"MS":"Mississippi",
"MO":"Missouri",
"MT":"Montana",
"NE":"Nebraska",
"NV":"Nevada",
"NH":"New Hampshire",
"NJ":"New Jersey",
"NM":"New Mexico",
"NY":"New York",
"NC":"North Carolina",
"ND":"North Dakota",
"OH":"Ohio",
"OK":"Oklahoma",
"OR":"Oregon",
"PA":"Pennsylvania",
"RI":"Rhode Island",
"SC":"South Carolina",
"SD":"South Dakota",
"TN":"Tennessee",
"TX":"Texas",
"UT":"Utah",
"VT":"Vermont",
"VA":"Virginia",
"WA":"Washington",
"WV":"West Virginia",
"WI":"Wisconsin",
"WY":"Wyoming"
}
$('#tooltip').text(nameList[data.name]).show();
$('#map').mousemove(function(e){
var mouseX = e.pageX - 350;
var mouseY = e.pageY - 90;
$('#tooltip').css({
top:mouseY,
left:mouseX,
'position': 'absolute',
'border':'1px solid black',
'background': '#fff',
'color': '#000',
'font-size': '1.5 em',
'padding': '5px',
'opacity': '1',
'border-radius': '2px'
});
});
},
// Hide tooltip when not hovering over state
mouseout: function(event, data){
$('#tooltip').hide();
},
'click' : function(event, data) {
$('#alert')
.text('Click '+data.name+' on map 1')
.stop()
.css('backgroundColor', '#ff0')
.animate({backgroundColor: '#ddd'}, 1000);
displayWasContacts(data.name,$('#band2').val());
}
});
});
</script>
</head>
<body>
<div id="map" style="width: 930px; height: 630px;"></div>
<div id="tooltip2"></div>
<ul>
<li>Red - Not Worked</li>

1
assets/js/jquery.usmap.min.js vendored 100644

File diff suppressed because one or more lines are too long