Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions QLog.pro
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ SOURCES += \
service/GenericCallbook.cpp \
service/GenericQSLDownloader.cpp \
service/GenericQSOUploader.cpp \
service/MapSpotProvider.cpp \
service/cloudlog/Cloudlog.cpp \
service/clublog/ClubLog.cpp \
service/eqsl/Eqsl.cpp \
Expand Down Expand Up @@ -366,6 +367,7 @@ HEADERS += \
service/GenericCallbook.h \
service/GenericQSLDownloader.h \
service/GenericQSOUploader.h \
service/MapSpotProvider.h \
service/cloudlog/Cloudlog.h \
service/clublog/ClubLog.h \
service/eqsl/Eqsl.h \
Expand Down
62 changes: 62 additions & 0 deletions res/map/onlinemap.html
Original file line number Diff line number Diff line change
Expand Up @@ -943,6 +943,68 @@
}

var wsjtxStationsLayer = L.layerGroup();
var pskReporterLayer = L.layerGroup();
var reverseBeaconLayer = L.layerGroup();
const receptionSpotMarkers = { psk: new Map(), rbn: new Map() };

function receptionSpotLayer(source) {
return source === 'psk' ? pskReporterLayer : reverseBeaconLayer;
}

function clearReceptionSpots(source) {
const layer = receptionSpotLayer(source);
layer.clearLayers();
if (receptionSpotMarkers[source])
receptionSpotMarkers[source].clear();
}

function addReceptionSpot(source, id, point, details, timestamp) {
const maxAge = 30 * 60 * 1000;
const remaining = maxAge - (Date.now() - timestamp);
if (remaining <= 0 || !receptionSpotMarkers[source])
return;

const layer = receptionSpotLayer(source);
const markers = receptionSpotMarkers[source];
const previous = markers.get(id);
if (previous) {
previous.forEach(marker => layer.removeLayer(marker));
markers.delete(id);
}

const spot = normalizePoint(point);
const color = source === 'psk' ? '#1769aa' : '#c62828';
const popup = document.createElement('div');
const heading = document.createElement('strong');
heading.textContent = spot.label;
popup.appendChild(heading);
popup.appendChild(document.createElement('br'));
popup.appendChild(document.createTextNode(details));

function createMarker(longitude) {
return L.circleMarker([spot.lat, longitude], {
radius: 6,
color: color,
weight: 2,
fillColor: color,
fillOpacity: 0.65
}).bindPopup(popup.cloneNode(true));
}

const marker = createMarker(spot.lng);
const mirror = createMarker(spot.lng >= 0 ? spot.lng - 360 : spot.lng + 360);
layer.addLayer(marker);
layer.addLayer(mirror);
markers.set(id, [marker, mirror]);

setTimeout(function() {
const current = markers.get(id);
if (!current || current[0] !== marker)
return;
current.forEach(item => layer.removeLayer(item));
markers.delete(id);
}, remaining);
}

// this function show WSJTX spots
function addWSJTXSpot(point, color, textColor) {
Expand Down
Loading