Open site data from sidebar menu
This commit is contained in:
parent
51fa6a773e
commit
82cf4513b7
@ -27,7 +27,7 @@
|
|||||||
<hr class="navbar-divider">
|
<hr class="navbar-divider">
|
||||||
<div class="navbar-menu ml-3 container is-align-items-center is-justify-content-center" id="nav-menu">
|
<div class="navbar-menu ml-3 container is-align-items-center is-justify-content-center" id="nav-menu">
|
||||||
<button class="navbar-item button is-size-5 is-white" role="button" id="siti">
|
<button class="navbar-item button is-size-5 is-white" role="button" id="siti">
|
||||||
<i class="fa fa-list mr-2"></i> Siti indagati
|
<i class="fa fa-list mr-2"></i> Beni archeologici
|
||||||
</button>
|
</button>
|
||||||
<button class="navbar-item is-size-5 is-white" title="Informazioni sul progetto" id="progetto">
|
<button class="navbar-item is-size-5 is-white" title="Informazioni sul progetto" id="progetto">
|
||||||
<i class="fa fa-info-circle mr-2"></i> Progetto
|
<i class="fa fa-info-circle mr-2"></i> Progetto
|
||||||
@ -45,7 +45,7 @@
|
|||||||
<div class="column is-hidden" id="menu">
|
<div class="column is-hidden" id="menu">
|
||||||
<aside class="menu ml-4">
|
<aside class="menu ml-4">
|
||||||
<p class="menu-label">
|
<p class="menu-label">
|
||||||
Siti indagati
|
Beni archeologici
|
||||||
<button title="Chiudi menu" class="button is-small is-pulled-right" id="close-menu">
|
<button title="Chiudi menu" class="button is-small is-pulled-right" id="close-menu">
|
||||||
<span class="icon is-small">
|
<span class="icon is-small">
|
||||||
<i class="fa fa-chevron-left"></i>
|
<i class="fa fa-chevron-left"></i>
|
||||||
|
@ -272,8 +272,7 @@ GIS.loadLayer = async function (geoJSON, options, popup = true) {
|
|||||||
// Show data from feature in popUp?
|
// Show data from feature in popUp?
|
||||||
const layer = new L.geoJson(geo, {
|
const layer = new L.geoJson(geo, {
|
||||||
style: function () {
|
style: function () {
|
||||||
let style = options;
|
return options;
|
||||||
return style;
|
|
||||||
},
|
},
|
||||||
onEachFeature: function (feature, layer) {
|
onEachFeature: function (feature, layer) {
|
||||||
if (popup) {
|
if (popup) {
|
||||||
|
8
js/ui.js
8
js/ui.js
@ -5,6 +5,7 @@ import { SiteSheet } from './components/SiteSheet.js';
|
|||||||
import { SiteDocuments } from './components/SiteDocuments.js';
|
import { SiteDocuments } from './components/SiteDocuments.js';
|
||||||
import { SiteSurveys } from './components/SiteSurveys.js';
|
import { SiteSurveys } from './components/SiteSurveys.js';
|
||||||
import { SitePhotos } from './components/SitePhotos.js';
|
import { SitePhotos } from './components/SitePhotos.js';
|
||||||
|
import GIS from './gis.js';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @namespace UI
|
* @namespace UI
|
||||||
@ -164,10 +165,13 @@ UI.sitesMenu = function (menuListSel, map, sites) {
|
|||||||
this.toggleMenu('close-menu');
|
this.toggleMenu('close-menu');
|
||||||
|
|
||||||
const menu = document.querySelector(menuListSel);
|
const menu = document.querySelector(menuListSel);
|
||||||
menu.addEventListener('click', event => {
|
menu.addEventListener('click', async event => {
|
||||||
if (event.target.nodeName === 'A') {
|
if (event.target.nodeName === 'A') {
|
||||||
|
const layerId = event.target.id;
|
||||||
// zoom to layer...
|
// zoom to layer...
|
||||||
const layer = sites.customGetLayer(event.target.id);
|
const layer = sites.customGetLayer(layerId);
|
||||||
|
const data = await GIS.layerData(layerId);
|
||||||
|
this.openModal(data, '#site-data');
|
||||||
map.setView(
|
map.setView(
|
||||||
layer.getBounds().getCenter(),
|
layer.getBounds().getCenter(),
|
||||||
19,
|
19,
|
||||||
|
Loading…
Reference in New Issue
Block a user