Merge pull request #35 from aprsme/fix-packet-spidering-issue
Fix packet spidering to only include most recent markers with icons
This commit is contained in:
commit
6a8836c962
1 changed files with 12 additions and 4 deletions
|
|
@ -502,8 +502,13 @@ let MapAPRSMap = {
|
||||||
if (self.oms) {
|
if (self.oms) {
|
||||||
// Clear and re-add all markers to OMS on zoom change
|
// Clear and re-add all markers to OMS on zoom change
|
||||||
self.oms.clearMarkers();
|
self.oms.clearMarkers();
|
||||||
self.markers.forEach((marker) => {
|
self.markers.forEach((marker, id) => {
|
||||||
if (marker && !marker._isHistorical && !marker._isClusterMarker) {
|
const markerState = self.markerStates.get(String(id));
|
||||||
|
// Only add most recent markers (those with icons) to OMS for spidering
|
||||||
|
// Fallback: if is_most_recent_for_callsign is undefined, exclude historical markers as before
|
||||||
|
const shouldAddToOms = markerState?.is_most_recent_for_callsign === true ||
|
||||||
|
(markerState?.is_most_recent_for_callsign == null && !marker._isHistorical);
|
||||||
|
if (marker && !marker._isClusterMarker && markerState && shouldAddToOms) {
|
||||||
self.oms.addMarker(marker);
|
self.oms.addMarker(marker);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -1547,8 +1552,11 @@ let MapAPRSMap = {
|
||||||
marker.openPopup();
|
marker.openPopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add to OMS for overlapping marker handling (only non-historical markers)
|
// Add to OMS for overlapping marker handling (only most recent packets with icons)
|
||||||
if (self.oms && marker && self.map && !marker._isClusterMarker && !(marker as APRSMarker)._isHistorical) {
|
// Fallback: if is_most_recent_for_callsign is undefined, exclude historical markers as before
|
||||||
|
const shouldAddToOms = data.is_most_recent_for_callsign === true ||
|
||||||
|
(data.is_most_recent_for_callsign == null && !(marker as APRSMarker)._isHistorical);
|
||||||
|
if (self.oms && marker && self.map && !marker._isClusterMarker && shouldAddToOms) {
|
||||||
self.oms.addMarker(marker);
|
self.oms.addMarker(marker);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue