From 39fd888db72acafb82b92847a812645759482507 Mon Sep 17 00:00:00 2001
From: Tor-Einar Skog <tor-einar.skog@nibio.no>
Date: Thu, 16 Nov 2023 12:34:25 +0100
Subject: [PATCH] Add code comments

---
 spatial/static/spatial/js/gridmap.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/spatial/static/spatial/js/gridmap.js b/spatial/static/spatial/js/gridmap.js
index 2f0fadf4..2e03afe6 100644
--- a/spatial/static/spatial/js/gridmap.js
+++ b/spatial/static/spatial/js/gridmap.js
@@ -193,6 +193,8 @@ msLoadMap(): Unable to access file. (/disks/data01/mapserver/wms/SEPTREFFUM/SEPT
     setCurrentDate(todayLayerIndex);
     switchLayer(todayLayerIndex);
 
+    // Set zoom and center either based on what the user previously had set,
+    // or fit the map to the layer's extent
     var storedMapSettings = getLocalSettings([
         "gridmap.longitude",
         "gridmap.latitude",
@@ -225,6 +227,7 @@ msLoadMap(): Unable to access file. (/disks/data01/mapserver/wms/SEPTREFFUM/SEPT
 
     map.on('singleclick', displayQueryResult);
 
+    // Store user's zoom/pan preferences for the next browser session
     map.on('moveend', function(evt) {
 		// Store map settings
 		var centerCoordinate = ol.proj.transform(map.getView().getCenter(), map.getView().getProjection().getCode(),'EPSG:4326');
-- 
GitLab