// Band MHz -> color mapping const BAND_COLORS = { 1296: "#475569", // slate-600 2304: "#7c3aed", // violet-600 3456: "#4f46e5", // indigo-600 5760: "#2563eb", // blue-600 10000: "#059669", // emerald-600 24000: "#d97706", // amber-600 47000: "#ea580c", // orange-600 68000: "#dc2626", // red-600 75000: "#c026d3", // fuchsia-600 122000: "#db2777", // pink-600 134000: "#e11d48", // rose-600 241000: "#b91c1c", // red-700 } function bandLabel(mhz) { if (mhz >= 1000) { const ghz = mhz / 1000 return (Number.isInteger(ghz) ? ghz : ghz.toFixed(1)) + " GHz" } return mhz + " MHz" } function bandColor(band) { return BAND_COLORS[band] || "#64748b" } export const ContactsMap = { mounted() { const contacts = JSON.parse(this.el.dataset.contacts) this.map = L.map(this.el, { center: [37.5, -96], zoom: 5, minZoom: 3, maxZoom: 14, preferCanvas: true }) L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { attribution: "© OpenStreetMap contributors", maxZoom: 19 }).addTo(this.map) // Group contacts by band for layered rendering const byBand = {} for (const c of contacts) { const band = c[4] if (!byBand[band]) byBand[band] = [] byBand[band].push(c) } // Collect all endpoint coords for endpoint density layer const endpointCounts = {} // Draw lines per band — interactive with popups const bandLayers = {} for (const [band, entries] of Object.entries(byBand)) { const color = bandColor(parseInt(band)) const lines = [] for (const c of entries) { const [lat1, lon1, lat2, lon2, bnd, s1, s2, mode, dist, ts, id] = c const line = L.polyline([[lat1, lon1], [lat2, lon2]], { color: color, weight: 2, opacity: 0.5 }) const distStr = dist != null ? `${Math.round(dist)} km` : "—" line.bindPopup( `