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:
@ -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