diff --git a/webgis/img/PLANIMETRIA GENERALE.jpg b/webgis/img/PLANIMETRIA GENERALE.jpg new file mode 100644 index 0000000..5799b76 Binary files /dev/null and b/webgis/img/PLANIMETRIA GENERALE.jpg differ diff --git a/webgis/img/PROSPETTO INTONACO_LATO SUD.jpg b/webgis/img/PROSPETTO INTONACO_LATO SUD.jpg new file mode 100644 index 0000000..2bf66b8 Binary files /dev/null and b/webgis/img/PROSPETTO INTONACO_LATO SUD.jpg differ diff --git a/webgis/img/PROSPETTO RETICOLATO_LATO SUD.jpg b/webgis/img/PROSPETTO RETICOLATO_LATO SUD.jpg new file mode 100644 index 0000000..9ed2404 Binary files /dev/null and b/webgis/img/PROSPETTO RETICOLATO_LATO SUD.jpg differ diff --git a/webgis/img/RESTI MURARI SOTTO IL PERGOLATO PARTICOLARE.JPG b/webgis/img/RESTI MURARI SOTTO IL PERGOLATO PARTICOLARE.JPG new file mode 100644 index 0000000..e65777a Binary files /dev/null and b/webgis/img/RESTI MURARI SOTTO IL PERGOLATO PARTICOLARE.JPG differ diff --git a/webgis/img/RESTI MURARI SOTTO IL PERGOLATO.jpg b/webgis/img/RESTI MURARI SOTTO IL PERGOLATO.jpg new file mode 100644 index 0000000..569b1f1 Binary files /dev/null and b/webgis/img/RESTI MURARI SOTTO IL PERGOLATO.jpg differ diff --git a/webgis/index.html b/webgis/index.html index cc4a578..1207fde 100644 --- a/webgis/index.html +++ b/webgis/index.html @@ -112,7 +112,7 @@
  • - + Villa San Michele
  • diff --git a/webgis/js/controllers/marker_controller.js b/webgis/js/controllers/marker_controller.js index b28ed1b..fd4ea25 100644 --- a/webgis/js/controllers/marker_controller.js +++ b/webgis/js/controllers/marker_controller.js @@ -11,27 +11,31 @@ export default class extends Controller { go(event) { let map = window.LMap; - const coords = event.currentTarget.getAttribute('data-coords').split(' '); + const coords = event.currentTarget + .getAttribute('data-coords').split(' '); + + let marker = this.getMarker(map, coords); + marker?.openTooltip(); map.setView( coords, this.END_ZOOM, this.mapAnimate ); - - let marker = this.getMarker(map, coords); - marker.openTooltip(); } - + /** + * @param {L.Map} map + * @param {Array} coords + * @returns {L.Marker} + */ getMarker(map, coords) { let marker; - map.eachLayer(l => { - if (l instanceof L.Marker) { - const latLng = l.getLatLng(); - const lat = latLng['lat']; - const lng = latLng['lng']; + map.eachLayer(layer => { + if (layer instanceof L.Marker) { + const latLng = layer.getLatLng(); + const {lat, lng} = latLng; if (lat === Number(coords[0]) && lng === Number(coords[1])) { - marker = l; + marker = layer; return; } }