diff --git a/webgis/index.html b/webgis/index.html index 5f3d7e1..f225286 100644 --- a/webgis/index.html +++ b/webgis/index.html @@ -63,12 +63,13 @@ Catasto storico - @@ -93,18 +94,6 @@ -
- -
-
- -
-
-
diff --git a/webgis/js/controllers/search_controller.js b/webgis/js/controllers/search_controller.js index a5d3b2d..be9a79c 100644 --- a/webgis/js/controllers/search_controller.js +++ b/webgis/js/controllers/search_controller.js @@ -1,6 +1,7 @@ import { Controller } from "@hotwired/stimulus"; import { GisState } from "../state.js"; import UI from "../ui.js"; +import { INIT_ZOOM } from "../gis.js"; const html = String.raw; @@ -41,6 +42,8 @@ export default class extends Controller { this.containerTarget.classList.remove('is-hidden'); this.#injectResults(results); if (results.length) { + // Reset zoom level after successful search + map.setZoom(INIT_ZOOM); this.#filterMap(results); // Should technique always be shown after a search? for (const key of Object.keys(techsMarkers)) { @@ -61,6 +64,8 @@ export default class extends Controller { // Empty result set this.resultsTarget.innerHTML = ''; this.containerTarget.classList.add('is-hidden'); + // Reset map zoom + map.setZoom(INIT_ZOOM); } #injectResults(results) { @@ -98,7 +103,7 @@ export default class extends Controller { data-action="marker#go" data-marker-coords-value="${coordinates}" data-marker-group-value="sites"> - Vai al sito + Vai diff --git a/webgis/js/gis.js b/webgis/js/gis.js index a454465..45fa7e2 100644 --- a/webgis/js/gis.js +++ b/webgis/js/gis.js @@ -29,6 +29,9 @@ GIS.INIT_ZOOM = 14; GIS.MIN_ZOOM = 11; GIS.MAX_ZOOM = 24; +// Terrible... fix it! +export const INIT_ZOOM = 14; + /** * Capitalize a text string * @todo Move to utils diff --git a/webgis/js/icons.js b/webgis/js/icons.js index 27f6bce..a0aadc7 100644 --- a/webgis/js/icons.js +++ b/webgis/js/icons.js @@ -59,6 +59,6 @@ Icons.reuse = L.icon( Icons.camera = L.divIcon({className: 'fa fa-camera'}); -Icons.techs = L.divIcon({className: 'fa fa-circle has-text-primary-25'}); +Icons.techs = L.divIcon({className: 'fa fa-circle has-text-link-45'}); export default Icons; \ No newline at end of file