Fix errors in building techs
This commit is contained in:
@@ -140,7 +140,7 @@ GIS.buildingTechs = async function () {
|
|||||||
techs.addLayer(marker);
|
techs.addLayer(marker);
|
||||||
const markerLabel = `${record.coordinates[0]} ${record.coordinates[1]}`;
|
const markerLabel = `${record.coordinates[0]} ${record.coordinates[1]}`;
|
||||||
marker.options.data = record;
|
marker.options.data = record;
|
||||||
marker.options.site = record.site.label;
|
marker.options.site = record.site?.label;
|
||||||
GisState.markers.buildingTechs[markerLabel] = marker;
|
GisState.markers.buildingTechs[markerLabel] = marker;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -277,18 +277,28 @@ UI.imageGallery = function (galleryId, items, video = false) {
|
|||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
UI.createBuildingTechTable = function(record) {
|
UI.createBuildingTechTable = function(record) {
|
||||||
return html`
|
let table = html`
|
||||||
<table class="table is-striped is-size-6 m-2">
|
<table class="table is-striped is-size-6 m-2">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr><th>Tecnica</th><td>${record.technique}</td></tr>
|
<tr><th>Tecnica</th><td>${record.technique}</td></tr>
|
||||||
<tr><th>Descrizione</th><td>${record.description}</td></tr>
|
<tr><th>Descrizione</th><td>${record.description}</td></tr>
|
||||||
<tr><th>Funzione</th><td>${record.function}</td></tr>
|
<tr><th>Funzione</th><td>${record.function}</td></tr>
|
||||||
<tr><th>Materiale</th><td>${record.material}</td></tr>
|
<tr><th>Materiale</th><td>${record.material}</td></tr>
|
||||||
|
;`
|
||||||
|
|
||||||
|
if (record.site) {
|
||||||
|
table += html`
|
||||||
<tr><th>Sito</th><td>${record.site.label}</td></tr>
|
<tr><th>Sito</th><td>${record.site.label}</td></tr>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
table += html`
|
||||||
<tr><th>Comune</th><td>${record.municipality}</td></tr>
|
<tr><th>Comune</th><td>${record.municipality}</td></tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
;`
|
`;
|
||||||
|
|
||||||
|
return table;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default UI;
|
export default UI;
|
||||||
|
|||||||
Reference in New Issue
Block a user