change feature icons with symbols

This commit is contained in:
Stanislav Lechev [0xAF] 2023-08-07 05:48:54 +03:00
parent 301f325cfd
commit 4857286994
1 changed files with 12 additions and 6 deletions

View File

@ -252,13 +252,19 @@ MapManager.prototype.processUpdates = function(updates) {
// If new item, create a new marker for it
if (!marker) {
marker = new LFeatureMarker();
if (!icons[update.mode]) {
icons[update.mode] = L.icon({
iconUrl: 'static/gfx/icon-' + update.mode + '.png',
iconSize: [24, 24],
});
if (0) { // icons
if (!icons[update.mode]) {
icons[update.mode] = L.icon({
iconUrl: 'static/gfx/icon-' + update.mode + '.png',
iconSize: [24, 24],
});
}
marker.setIcon(icons[update.mode]);
} else { // symbols
marker.div = marker.create();
marker.setIcon(L.divIcon({ html: marker.div, className: 'dummy' }));
}
marker.setIcon(icons[update.mode]);
self.mman.addType(update.mode);
self.mman.add(update.callsign, marker);
marker.addListener('click', function() {