From a66c9a070f55cd18c372c3a20c221bc68626aa0b Mon Sep 17 00:00:00 2001 From: Andreas <6977712+AndreasK79@users.noreply.github.com> Date: Thu, 24 Nov 2022 14:37:33 +0100 Subject: [PATCH] [DXCC Map] Added prefix as icon --- assets/js/sections/dxccmap.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/assets/js/sections/dxccmap.js b/assets/js/sections/dxccmap.js index 2d5aa88a..e117ffec 100644 --- a/assets/js/sections/dxccmap.js +++ b/assets/js/sections/dxccmap.js @@ -109,6 +109,9 @@ function load_dxcc_map2(data, worked, confirmed, notworked) { } function addMarker(L, D, mapColor, map) { + var title = '' + D['prefix'] + ''; + var myIcon = L.divIcon({className: 'my-div-icon', html: title}); + const markerHtmlStyles = ` background-color: ${mapColor}; width: 1rem; @@ -129,11 +132,19 @@ function addMarker(L, D, mapColor, map) { L.marker( [D['lat'], D['long']], { - icon: icon, + icon: myIcon, adif: D['adif'], title: D['prefix'] + ' - ' + D['name'], } ).addTo(map).on('click', onClick); + + L.marker( + [D['lat'], D['long']], { + icon: icon, + adif: D['adif'], + title: D['prefix'] + ' - ' + D['name'], + } + ).addTo(map).on('click', onClick); } function onClick(e) {