diff --git a/templates/about.html b/templates/about.html index 005cae2..97b07af 100644 --- a/templates/about.html +++ b/templates/about.html @@ -67,7 +67,7 @@

This software is dedicated to the memory of Tom G1PJB, SK, a friend and colleague who sadly passed away around the time I started writing it in Autumn 2025. I was looking forward to showing it to you when it was done.

- + {% end %} \ No newline at end of file diff --git a/templates/add_spot.html b/templates/add_spot.html index e10d943..94f0317 100644 --- a/templates/add_spot.html +++ b/templates/add_spot.html @@ -69,8 +69,8 @@ - - + + {% end %} \ No newline at end of file diff --git a/templates/alerts.html b/templates/alerts.html index bc3d838..bf8e21a 100644 --- a/templates/alerts.html +++ b/templates/alerts.html @@ -56,8 +56,8 @@ - - + + {% end %} \ No newline at end of file diff --git a/templates/bands.html b/templates/bands.html index 8f38385..bf73689 100644 --- a/templates/bands.html +++ b/templates/bands.html @@ -62,9 +62,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 18662b3..5a2e9d4 100644 --- a/templates/base.html +++ b/templates/base.html @@ -46,10 +46,10 @@ crossorigin="anonymous"> - - - - + + + + diff --git a/templates/conditions.html b/templates/conditions.html index 50338be..22e3664 100644 --- a/templates/conditions.html +++ b/templates/conditions.html @@ -230,8 +230,8 @@ - - + + diff --git a/templates/map.html b/templates/map.html index 66d8303..49a88a1 100644 --- a/templates/map.html +++ b/templates/map.html @@ -79,9 +79,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/spots.html b/templates/spots.html index 546b94d..3bc0f91 100644 --- a/templates/spots.html +++ b/templates/spots.html @@ -87,9 +87,9 @@ - - - + + + {% end %} \ No newline at end of file diff --git a/templates/status.html b/templates/status.html index 66e849b..6da0800 100644 --- a/templates/status.html +++ b/templates/status.html @@ -59,8 +59,8 @@ - - + + diff --git a/webassets/js/map.js b/webassets/js/map.js index 98de679..5813b48 100644 --- a/webassets/js/map.js +++ b/webassets/js/map.js @@ -22,6 +22,8 @@ var ituZones; var wabwaiGrid; // Tracks the currently-loaded basemap provider string to avoid unnecessary tile reloads var loadedBasemap; +// Tracks whether this is the first display of markers after page load +var firstLoad = true; // Load spots and populate the map. function loadSpots() { @@ -76,6 +78,15 @@ function updateMap() { } } }); + + // On first load, zoom to the extent of the markers + if (firstLoad) { + if (markersLayer.getLayers().length >= 2) { + var group = new L.featureGroup(markersLayer.getLayers()); + map.fitBounds(group.getBounds().pad(0.1)); + } + firstLoad = false; + } } // Get an icon for a spot, based on its band, using PSK Reporter colours, its program etc.