Villa San Michele
This commit is contained in:
parent
1393b779ff
commit
0cb1f7a32d
BIN
webgis/img/PLANIMETRIA GENERALE.jpg
Normal file
BIN
webgis/img/PLANIMETRIA GENERALE.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 495 KiB |
BIN
webgis/img/PROSPETTO INTONACO_LATO SUD.jpg
Normal file
BIN
webgis/img/PROSPETTO INTONACO_LATO SUD.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 521 KiB |
BIN
webgis/img/PROSPETTO RETICOLATO_LATO SUD.jpg
Normal file
BIN
webgis/img/PROSPETTO RETICOLATO_LATO SUD.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 449 KiB |
BIN
webgis/img/RESTI MURARI SOTTO IL PERGOLATO PARTICOLARE.JPG
Normal file
BIN
webgis/img/RESTI MURARI SOTTO IL PERGOLATO PARTICOLARE.JPG
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 MiB |
BIN
webgis/img/RESTI MURARI SOTTO IL PERGOLATO.jpg
Normal file
BIN
webgis/img/RESTI MURARI SOTTO IL PERGOLATO.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1015 KiB |
@ -112,7 +112,7 @@
|
|||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a class="button" title="Vai al sito San Michele" data-action="marker#go" data-coords="">
|
<a class="button" title="Vai al sito San Michele" data-action="marker#go" data-coords="40.557380 14.225806">
|
||||||
Villa San Michele
|
Villa San Michele
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
@ -11,27 +11,31 @@ export default class extends Controller {
|
|||||||
|
|
||||||
go(event) {
|
go(event) {
|
||||||
let map = window.LMap;
|
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(
|
map.setView(
|
||||||
coords,
|
coords,
|
||||||
this.END_ZOOM,
|
this.END_ZOOM,
|
||||||
this.mapAnimate
|
this.mapAnimate
|
||||||
);
|
);
|
||||||
|
|
||||||
let marker = this.getMarker(map, coords);
|
|
||||||
marker.openTooltip();
|
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @param {L.Map} map
|
||||||
|
* @param {Array<String>} coords
|
||||||
|
* @returns {L.Marker}
|
||||||
|
*/
|
||||||
getMarker(map, coords) {
|
getMarker(map, coords) {
|
||||||
let marker;
|
let marker;
|
||||||
map.eachLayer(l => {
|
map.eachLayer(layer => {
|
||||||
if (l instanceof L.Marker) {
|
if (layer instanceof L.Marker) {
|
||||||
const latLng = l.getLatLng();
|
const latLng = layer.getLatLng();
|
||||||
const lat = latLng['lat'];
|
const {lat, lng} = latLng;
|
||||||
const lng = latLng['lng'];
|
|
||||||
if (lat === Number(coords[0]) && lng === Number(coords[1])) {
|
if (lat === Number(coords[0]) && lng === Number(coords[1])) {
|
||||||
marker = l;
|
marker = layer;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user