Skip to content

Commit

Permalink
[Dashboard] Map now follows user selection for showing icon and colour
Browse files Browse the repository at this point in the history
Visual decision to not show home marker or locs on the dashboard
  • Loading branch information
magicbug committed May 20, 2024
1 parent 1cf2b3c commit 3788a84
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions application/views/interface_assets/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -806,6 +806,37 @@ function showActivatorsMap(call, count, grids) {
<?php if ($this->uri->segment(1) == "" || $this->uri->segment(1) == "dashboard") { ?>
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/leaflet/L.Maidenhead.js"></script>

<script>
var iconsList = {
'qso': {
'color': '#FF0000',
'icon': 'fas fa-dot-circle'
}
};
</script>

<script>
// jquery onready
$(document).ready(function() {
$.ajax({
url: base_url + 'index.php/user_options/get_map_custom',
type: 'GET',
dataType: 'json',
error: function() {
console.log('[ERROR] ajax get_map_custom() function return error.');
},
success: function(json_mapinfo) {
console.log(json_mapinfo);
if (typeof json_mapinfo.qso !== "undefined") {
iconsList = json_mapinfo;
}
}
});
});

console.log(iconsList);
</script>

<script type="text/javascript">
$(function() {
$('[data-bs-toggle="tooltip"]').tooltip()
Expand Down Expand Up @@ -869,9 +900,14 @@ function loadMarkers() {
var key = `${marker.lat},${marker.lng}`;
newMarkers[key] = marker;
if (!markers[key]) {
var icon = L.divIcon({
className: 'custom-icon',
html: `<i class="${iconsList.qso.icon}" style="color:${iconsList.qso.color}"></i>`
});
L.marker([marker.lat, marker.lng], {
icon: redIconImg
}).addTo(map)
icon: icon
})
.addTo(map)
.bindPopup(marker.html);
}
});
Expand Down

0 comments on commit 3788a84

Please sign in to comment.