Fix jwt-token
This commit is contained in:
@@ -423,11 +423,7 @@ const MapView = () => {
|
||||
// Calculate values first
|
||||
const totalDrones = detections.length;
|
||||
|
||||
const opacity = getDetectionOpacity(detection);
|
||||
const age = getDetectionAge(detection);
|
||||
console.log('MapView: Detection age:', age, 'opacity:', opacity);
|
||||
|
||||
// Calculate ring radius based on RSSI (rough distance estimation)
|
||||
// Define helper functions first before using them
|
||||
const getRssiRadius = (rssi) => {
|
||||
if (rssi > -40) return 100; // <100m - very close
|
||||
if (rssi > -60) return 500; // ~500m - close
|
||||
@@ -437,10 +433,6 @@ const MapView = () => {
|
||||
return 15000; // ~15km - maximum range
|
||||
};
|
||||
|
||||
const radius = getRssiRadius(detection.rssi);
|
||||
console.log('MapView: Ring radius:', radius, 'for RSSI:', detection.rssi);
|
||||
|
||||
// Color based on threat level and multiple drone differentiation
|
||||
const getRingColor = (rssi, droneType, droneIndex, totalDrones) => {
|
||||
// Orlan drones (type 1) always red
|
||||
if (droneType === 1) return '#dc2626'; // red-600
|
||||
@@ -466,9 +458,6 @@ const MapView = () => {
|
||||
return '#16a34a'; // green-600 - far
|
||||
};
|
||||
|
||||
const ringColor = getRingColor(detection.rssi, detection.drone_type, droneIndex, totalDrones);
|
||||
|
||||
// Different visual styles for multiple drones at same detector
|
||||
const getDashPattern = (droneType, droneIndex, totalDrones) => {
|
||||
if (droneType === 1) return null; // Orlan always solid
|
||||
|
||||
@@ -485,7 +474,6 @@ const MapView = () => {
|
||||
return patterns[droneIndex % patterns.length];
|
||||
};
|
||||
|
||||
// Slight offset for multiple rings to make them more visible
|
||||
const getPositionOffset = (droneIndex, totalDrones) => {
|
||||
if (totalDrones === 1) return [0, 0];
|
||||
|
||||
@@ -497,6 +485,15 @@ const MapView = () => {
|
||||
];
|
||||
};
|
||||
|
||||
// Now calculate values using the functions
|
||||
const opacity = getDetectionOpacity(detection);
|
||||
const age = getDetectionAge(detection);
|
||||
console.log('MapView: Detection age:', age, 'opacity:', opacity);
|
||||
|
||||
const radius = getRssiRadius(detection.rssi);
|
||||
console.log('MapView: Ring radius:', radius, 'for RSSI:', detection.rssi);
|
||||
|
||||
const ringColor = getRingColor(detection.rssi, detection.drone_type, droneIndex, totalDrones);
|
||||
const dashPattern = getDashPattern(detection.drone_type, droneIndex, totalDrones);
|
||||
const [latOffset, lonOffset] = getPositionOffset(droneIndex, totalDrones);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user