Skip to content

Commit 3788a84

Browse files
committed
[Dashboard] Map now follows user selection for showing icon and colour
Visual decision to not show home marker or locs on the dashboard
1 parent 1cf2b3c commit 3788a84

File tree

1 file changed

+38
-2
lines changed

1 file changed

+38
-2
lines changed

application/views/interface_assets/footer.php

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -806,6 +806,37 @@ function showActivatorsMap(call, count, grids) {
806806
<?php if ($this->uri->segment(1) == "" || $this->uri->segment(1) == "dashboard") { ?>
807807
<script type="text/javascript" src="<?php echo base_url(); ?>assets/js/leaflet/L.Maidenhead.js"></script>
808808

809+
<script>
810+
var iconsList = {
811+
'qso': {
812+
'color': '#FF0000',
813+
'icon': 'fas fa-dot-circle'
814+
}
815+
};
816+
</script>
817+
818+
<script>
819+
// jquery onready
820+
$(document).ready(function() {
821+
$.ajax({
822+
url: base_url + 'index.php/user_options/get_map_custom',
823+
type: 'GET',
824+
dataType: 'json',
825+
error: function() {
826+
console.log('[ERROR] ajax get_map_custom() function return error.');
827+
},
828+
success: function(json_mapinfo) {
829+
console.log(json_mapinfo);
830+
if (typeof json_mapinfo.qso !== "undefined") {
831+
iconsList = json_mapinfo;
832+
}
833+
}
834+
});
835+
});
836+
837+
console.log(iconsList);
838+
</script>
839+
809840
<script type="text/javascript">
810841
$(function() {
811842
$('[data-bs-toggle="tooltip"]').tooltip()
@@ -869,9 +900,14 @@ function loadMarkers() {
869900
var key = `${marker.lat},${marker.lng}`;
870901
newMarkers[key] = marker;
871902
if (!markers[key]) {
903+
var icon = L.divIcon({
904+
className: 'custom-icon',
905+
html: `<i class="${iconsList.qso.icon}" style="color:${iconsList.qso.color}"></i>`
906+
});
872907
L.marker([marker.lat, marker.lng], {
873-
icon: redIconImg
874-
}).addTo(map)
908+
icon: icon
909+
})
910+
.addTo(map)
875911
.bindPopup(marker.html);
876912
}
877913
});

0 commit comments

Comments
 (0)