From d36cdd4d170f04a0b1350276388cfea1a6a96d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20P?= Date: Thu, 13 Jun 2024 15:57:53 +0200 Subject: [PATCH] Some minor cleaning --- index.html | 1 - js/{caprigis.js => gis.js} | 0 js/index.js | 14 ++------------ js/jsdoc.json | 2 +- js/ui.js | 8 ++++---- 5 files changed, 7 insertions(+), 18 deletions(-) rename js/{caprigis.js => gis.js} (100%) diff --git a/index.html b/index.html index ebbb5e1..5f35856 100644 --- a/index.html +++ b/index.html @@ -63,7 +63,6 @@ diff --git a/js/caprigis.js b/js/gis.js similarity index 100% rename from js/caprigis.js rename to js/gis.js diff --git a/js/index.js b/js/index.js index 1806ad4..0fd6f5f 100644 --- a/js/index.js +++ b/js/index.js @@ -1,4 +1,4 @@ -import GIS from './caprigis.js'; +import GIS from './gis.js'; import UI from './ui.js'; document.addEventListener('DOMContentLoaded', async () => { @@ -8,14 +8,4 @@ document.addEventListener('DOMContentLoaded', async () => { UI.addCenterMapControl(map, GIS.CENTER_COORDS, GIS.INIT_ZOOM); UI.toggleMenu('siti'); UI.sitesMenu('.menu-list', map, sites); - - /* - for (let site of Object.keys(sites)) { - if (!site.includes('Vincoli')) { - let layer = sites[site]; - const centerCoords = layer.getBounds().getCenter(); - UI.addSitesControl(map, centerCoords, site, GIS.INIT_ZOOM); - } - } - */ -}); \ No newline at end of file +}); diff --git a/js/jsdoc.json b/js/jsdoc.json index e28d726..16ae428 100644 --- a/js/jsdoc.json +++ b/js/jsdoc.json @@ -1,6 +1,6 @@ { "source": { - "include": ["caprigis.js", "index.js"], + "include": ["gis.js", "ui.js", "index.js"], "includePattern": ".js$", "excludePattern": "(vendor/|docs)" }, diff --git a/js/ui.js b/js/ui.js index 06783cc..ca1a9ee 100644 --- a/js/ui.js +++ b/js/ui.js @@ -6,9 +6,9 @@ const UI = {}; /** - * Add a control to center the map - * @param {Map} map - * @param {LatLngExpression} centerCoords + * Add a Leaflet control to center the map + * @param {Map} map The Leaflet map object + * @param {LatLngExpression} centerCoords The coordinates to center the map * @param {number} zoom Zoom level */ UI.addCenterMapControl = function (map, centerCoords, zoom) { @@ -51,7 +51,7 @@ UI.toggleMenu = function (triggerId) { menu.classList.toggle('is-hidden'); menu.classList.toggle('is-2'); document.querySelector('#map').parentElement.classList.toggle('is-full'); - }) + }); } /** * Open a modal with DB data