multiple updates

lunar bug, pota callsign not working with callsign off
pull/78/head
accius 2 days ago
parent f1ede09de8
commit 65c54e89d6

@ -417,20 +417,33 @@ export const WorldMap = ({
if (showPOTA && potaSpots) { if (showPOTA && potaSpots) {
potaSpots.forEach(spot => { potaSpots.forEach(spot => {
if (spot.lat && spot.lon) { if (spot.lat && spot.lon) {
const icon = L.divIcon({ // Green triangle marker for POTA activators
const triangleIcon = L.divIcon({
className: '', className: '',
html: `<span style="display:inline-block;background:#aa66ff;color:#fff;padding:4px 8px;border-radius:4px;font-size:12px;font-family:'JetBrains Mono',monospace;font-weight:700;white-space:nowrap;border:2px solid #fff;box-shadow:0 2px 4px rgba(0,0,0,0.4);">${spot.call}</span>`, html: `<span style="display:inline-block;width:0;height:0;border-left:7px solid transparent;border-right:7px solid transparent;border-bottom:14px solid #44cc44;filter:drop-shadow(0 1px 2px rgba(0,0,0,0.6));"></span>`,
iconSize: null, iconSize: [14, 14],
iconAnchor: [0, 0] iconAnchor: [7, 14]
}); });
const marker = L.marker([spot.lat, spot.lon], { icon }) const marker = L.marker([spot.lat, spot.lon], { icon: triangleIcon })
.bindPopup(`<b>${spot.call}</b><br>${spot.ref}<br>${spot.freq} ${spot.mode}`) .bindPopup(`<b style="color:#44cc44">${spot.call}</b><br>${spot.ref}<br>${spot.freq} ${spot.mode}`)
.addTo(map); .addTo(map);
potaMarkersRef.current.push(marker); potaMarkersRef.current.push(marker);
// Only show callsign label when labels are enabled
if (showDXLabels) {
const labelIcon = L.divIcon({
className: '',
html: `<span style="display:inline-block;background:#44cc44;color:#000;padding:4px 8px;border-radius:4px;font-size:12px;font-family:'JetBrains Mono',monospace;font-weight:700;white-space:nowrap;border:2px solid rgba(0,0,0,0.5);box-shadow:0 2px 4px rgba(0,0,0,0.4);">${spot.call}</span>`,
iconSize: null,
iconAnchor: [0, -2]
});
const label = L.marker([spot.lat, spot.lon], { icon: labelIcon, interactive: false }).addTo(map);
potaMarkersRef.current.push(label);
}
} }
}); });
} }
}, [potaSpots, showPOTA]); }, [potaSpots, showPOTA, showDXLabels]);
// Update satellite markers with orbit tracks // Update satellite markers with orbit tracks
useEffect(() => { useEffect(() => {
@ -864,7 +877,7 @@ export const WorldMap = ({
</div> </div>
{showPOTA && ( {showPOTA && (
<div style={{ display: 'flex', gap: '4px', alignItems: 'center' }}> <div style={{ display: 'flex', gap: '4px', alignItems: 'center' }}>
<span style={{ background: '#aa66ff', color: '#fff', padding: '2px 5px', borderRadius: '3px', fontWeight: '600' }}> POTA</span> <span style={{ background: '#44cc44', color: '#000', padding: '2px 5px', borderRadius: '3px', fontWeight: '600' }}> POTA</span>
</div> </div>
)} )}
<div style={{ display: 'flex', gap: '6px', alignItems: 'center' }}> <div style={{ display: 'flex', gap: '6px', alignItems: 'center' }}>

@ -130,9 +130,9 @@ export const getMoonPosition = (date) => {
export const getMoonPhase = (date) => { export const getMoonPhase = (date) => {
const JD = date.getTime() / 86400000 + 2440587.5; const JD = date.getTime() / 86400000 + 2440587.5;
const T = (JD - 2451545.0) / 36525; const T = (JD - 2451545.0) / 36525;
const D = (297.850 + 445267.1115 * T) % 360; // Mean elongation const D = (297.850 + 445267.1115 * T) % 360; // Mean elongation: 0=new, 180=full
// Phase angle (simplified) // Map to phase: 0=new, 0.5=full, 1=new again
const phase = ((D + 180) % 360) / 360; const phase = (((D % 360) + 360) % 360) / 360;
return phase; return phase;
}; };

Loading…
Cancel
Save

Powered by TurnKey Linux.