fix proxy

This commit is contained in:
2026-06-23 15:27:03 +03:00
parent 7a04cc166d
commit c7ac938990
+38
View File
@@ -547,6 +547,7 @@
let apiDebugTxMarker = null;
let apiDebugRxMarker = null;
let apiDebugLineLayer = null;
let apiDebugBeamLayer = null;
let apiDebugCursorDist = null;
let apiDebugCursorMarker = null;
let apiDebugGroundProfile = null;
@@ -2201,6 +2202,41 @@
}
}
function clearApiDebugBeam() {
if (apiDebugBeamLayer) {
map.removeLayer(apiDebugBeamLayer);
apiDebugBeamLayer = null;
}
}
function renderApiDebugBeam(data) {
const feature = data?.geojson || data;
if (!feature?.geometry) {
apiDebugSetSummary('Ответ antenna/beam не содержит GeoJSON geometry.');
return;
}
clearApiDebugBeam();
apiDebugBeamLayer = L.geoJSON(feature, {
style: {
color: '#ff9800',
weight: 2,
opacity: 0.95,
fillColor: '#ff9800',
fillOpacity: 0.22
}
}).addTo(map);
const props = feature.properties || {};
const bounds = apiDebugBeamLayer.getBounds();
if (bounds.isValid()) {
setMapViewProgrammatically(() => map.fitBounds(bounds, { padding: [40, 40], maxZoom: 15 }));
}
apiDebugSetSummary(
`<b>Сектор антенны:</b> ${escapeHtml(props.pattern || 'sector')} · ` +
`azimuth ${fmtNum(props.azimuth_deg, 0, '°')} · radius ${fmtNum(props.radius_m, 0, ' m')}<br>` +
`Оранжевая заливка на карте — зона сектора из GeoJSON ответа.`
);
}
function clearApiDebugCursorMarker() {
if (apiDebugCursorMarker) {
map.removeLayer(apiDebugCursorMarker);
@@ -2318,6 +2354,7 @@
if (el) el.value = '';
});
refreshApiDebugOverlay();
clearApiDebugBeam();
clearApiDebugCursorMarker();
apiDebugGroundProfile = null;
apiDebugSurfaceProfile = null;
@@ -2514,6 +2551,7 @@
else if (kind === 'los') apiDebugSetSummary(formatApiDebugLosSummary(data));
else if (kind === 'budget') apiDebugSetSummary(formatApiDebugBudgetSummary(data));
else if (kind === 'elevation') apiDebugSetSummary(formatApiDebugPointSummary(data));
else if (kind === 'beam') renderApiDebugBeam(data);
else apiDebugSetSummary('Ответ получен.');
} catch (e) {
apiDebugSetStatus(`Ошибка запроса: ${e.message || e}`, true);