mirror of
https://amiok.net/gitea/W1CDN/aprs_tool.git
synced 2025-07-17 17:50:28 +00:00
Plot recent packets on map.
This commit is contained in:
@ -4,18 +4,58 @@
|
||||
<meta charset="UTF-8">
|
||||
<title>{{station_call}} Status</title>
|
||||
|
||||
<!-- Leaflet's CSS -->
|
||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
|
||||
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
|
||||
crossorigin=""/>
|
||||
<!-- Make sure you put this AFTER Leaflet's CSS -->
|
||||
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"
|
||||
integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="
|
||||
crossorigin=""></script>
|
||||
|
||||
<style>
|
||||
table, th, td {
|
||||
border: 1px solid black;
|
||||
}
|
||||
#map { height: 250px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>{{station_call}} Status</h1>
|
||||
Station location: {{station_lat}}, {{station_lon}}
|
||||
<div style="width: 100%; overflow: hidden;">
|
||||
<div style="width: 50%; float: left;">
|
||||
|
||||
<h2> About </h2>
|
||||
This is a work in progress. See <a href="https://amiok.net/gitea/W1CDN/aprs_tool">https://amiok.net/gitea/W1CDN/aprs_tool</a> for usage.
|
||||
<h1>{{station_call}} Status</h1>
|
||||
Station location: {{station_lat}}, {{station_lon}}
|
||||
|
||||
<h2> About </h2>
|
||||
This is a work in progress. See <a href="https://amiok.net/gitea/W1CDN/aprs_tool">https://amiok.net/gitea/W1CDN/aprs_tool</a> for usage.
|
||||
</div>
|
||||
<div style="margin-left: 50%;">
|
||||
<div id="map"></div>
|
||||
<script>
|
||||
var map = L.map('map').setView([{{station_lat}}, {{station_lon}}], 10);
|
||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {attribution: '© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors'}).addTo(map);
|
||||
|
||||
//{{markers|safe}}
|
||||
|
||||
// Show station location
|
||||
var station = L.marker([{{station_lat}}, {{station_lon}}]).addTo(map).bindTooltip('{{station_call}}', permanent=true).openTooltip();
|
||||
|
||||
// Show GeoJSON of markers
|
||||
var group = L.geoJSON({{geojs|safe}},
|
||||
{
|
||||
style: function (feature) {
|
||||
return {color: feature.properties.color};
|
||||
}
|
||||
}).bindTooltip(function (layer) {
|
||||
return 'Object '+layer.feature.properties.object_name+' from '+layer.feature.properties.from;
|
||||
}, permanent=true).addTo(map);
|
||||
|
||||
// Zoom to show all
|
||||
map.fitBounds(group.getBounds().pad(0.3));
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2> Recent RF Packets </h2>
|
||||
<table>
|
||||
@ -40,6 +80,8 @@ This is a work in progress. See <a href="https://amiok.net/gitea/W1CDN/aprs_tool
|
||||
{% endfor %}
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<h2> Recent Stations </h2>
|
||||
<table>
|
||||
<tr>
|
||||
|
@ -19,7 +19,23 @@
|
||||
var map = L.map('map').setView([{{station_lat}}, {{station_lon}}], 10);
|
||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {attribution: '© <a href=\"https://www.openstreetmap.org/copyright\">OpenStreetMap</a> contributors'}).addTo(map);
|
||||
|
||||
{{markers|safe}}
|
||||
//{{markers|safe}}
|
||||
|
||||
// Show station location
|
||||
var station = L.marker([{{station_lat}}, {{station_lon}}]).addTo(map).bindTooltip('{{station_call}}', permanent=true).openTooltip();
|
||||
|
||||
// Show GeoJSON of markers
|
||||
var group = L.geoJSON({{geojs|safe}},
|
||||
{
|
||||
style: function (feature) {
|
||||
return {color: feature.properties.color};
|
||||
}
|
||||
}).bindTooltip(function (layer) {
|
||||
return 'Object '+layer.feature.properties.object_name+' from '+layer.feature.properties.from;
|
||||
}, permanent=true).addTo(map);
|
||||
|
||||
// Zoom to show all
|
||||
map.fitBounds(group.getBounds().pad(0.2));
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
Reference in New Issue
Block a user