Open site data from sidebar menu
This commit is contained in:
@@ -272,8 +272,7 @@ GIS.loadLayer = async function (geoJSON, options, popup = true) {
|
||||
// Show data from feature in popUp?
|
||||
const layer = new L.geoJson(geo, {
|
||||
style: function () {
|
||||
let style = options;
|
||||
return style;
|
||||
return options;
|
||||
},
|
||||
onEachFeature: function (feature, layer) {
|
||||
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 { SiteSurveys } from './components/SiteSurveys.js';
|
||||
import { SitePhotos } from './components/SitePhotos.js';
|
||||
import GIS from './gis.js';
|
||||
|
||||
/**
|
||||
* @namespace UI
|
||||
@@ -164,10 +165,13 @@ UI.sitesMenu = function (menuListSel, map, sites) {
|
||||
this.toggleMenu('close-menu');
|
||||
|
||||
const menu = document.querySelector(menuListSel);
|
||||
menu.addEventListener('click', event => {
|
||||
menu.addEventListener('click', async event => {
|
||||
if (event.target.nodeName === 'A') {
|
||||
const layerId = event.target.id;
|
||||
// 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(
|
||||
layer.getBounds().getCenter(),
|
||||
19,
|
||||
|
||||
Reference in New Issue
Block a user