added scheduling
This commit is contained in:
@@ -24,13 +24,17 @@
|
||||
const bounds = L.latLngBounds([]);
|
||||
|
||||
h3Cells.forEach((cell) => {
|
||||
const hasManual = cell.manual_reports > 0;
|
||||
const hasSensor = cell.sensor_reports > 0;
|
||||
const color = hasManual && hasSensor ? "#a78bfa" : hasSensor ? "#22d3ee" : "#f59e0b";
|
||||
const polygon = L.polygon(cell.boundary, {
|
||||
color: "#f59e0b", weight: 2, fillColor: "#f59e0b", fillOpacity: 0.25,
|
||||
color, weight: 2, fillColor: color, fillOpacity: 0.25,
|
||||
}).addTo(map);
|
||||
polygon.bindPopup(
|
||||
"<span class=\"popup-title\">H3 " + cell.cell + "</span>" +
|
||||
"<span class=\"popup-meta\">" + cell.reports + " " + (cell.reports === 1 ? (t.report || "report") : (t.reports || "reports")) + " · " + cell.occurrences +
|
||||
" " + (cell.occurrences === 1 ? (t.occurrence || "occurrence") : (t.occurrences || "occurrences")) + " · " + (t.resolution || "resolution") + " " + h3Resolution + "</span>"
|
||||
" " + (cell.occurrences === 1 ? (t.occurrence || "occurrence") : (t.occurrences || "occurrences")) + " · " + (t.resolution || "resolution") + " " + h3Resolution +
|
||||
"<br>" + cell.manual_reports + " " + (t.manualReport || "Manual report") + " · " + cell.sensor_reports + " " + (t.sensorEvent || "Sensor event") + "</span>"
|
||||
);
|
||||
bounds.extend(L.latLngBounds(cell.boundary));
|
||||
});
|
||||
@@ -60,7 +64,11 @@
|
||||
const reportIcon = L.divIcon({
|
||||
className: "", html: "<div class=\"report-icon\">✦</div>", iconSize: [37, 37], iconAnchor: [19, 19],
|
||||
});
|
||||
const sensorIcon = L.divIcon({
|
||||
className: "", html: "<div class=\"sensor-icon\">S</div>", iconSize: [37, 37], iconAnchor: [19, 19],
|
||||
});
|
||||
reports.forEach((report) => {
|
||||
const isSensor = report.source_type === "sensor";
|
||||
const visualStatus = report.visually_confirmed ? (t.visuallyConfirmed || "Visually confirmed") : (t.notVisuallyConfirmed || "Not visually confirmed");
|
||||
let detail = report.occurrences + " " + (report.occurrences === 1 ? (t.occurrence || "occurrence") : (t.occurrences || "occurrences")) +
|
||||
" · " + visualStatus + "<br>" + (t.reported || "Reported") + " " + report.reported_on;
|
||||
@@ -70,8 +78,8 @@
|
||||
detail += " (±" + Math.round(report.direction_accuracy_degrees) + "°)";
|
||||
}
|
||||
}
|
||||
L.marker(report.center, { icon: reportIcon }).addTo(map).bindPopup(
|
||||
"<span class=\"popup-title\">" + (t.manualReport || "Manual report") + " · H3 " + report.cell + "</span>" +
|
||||
L.marker(report.center, { icon: isSensor ? sensorIcon : reportIcon }).addTo(map).bindPopup(
|
||||
"<span class=\"popup-title\">" + (isSensor ? (t.sensorEvent || "Sensor event") : (t.manualReport || "Manual report")) + " · H3 " + report.cell + "</span>" +
|
||||
"<span class=\"popup-meta\">" + detail + "</span>"
|
||||
);
|
||||
|
||||
@@ -98,4 +106,4 @@
|
||||
input.addEventListener("change", () => { range.value = "custom"; });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user