UNPKG

thematic-earth

Version:

HTML-based, whole-Earth thematic maps using locally hosted data layers

2 lines 1.46 kB
/* Copyright (c) 2023 Read Write Tools. Legal use subject to the Thematic Earth Software License Agreement. */ import BasePanel from'../panels/base-panel.class.js';export default class MetadataPanel extends BasePanel{constructor(e){super(e),Object.seal(this)}registerBroadcasters(){}registerReceivers(){}async fetchComponentVersion(){var e=await this.thematicEarthElement.fetchComponentVersion();this.getElementById('metadata-software-version').innerHTML=e}addMapCitation(e){var a=this.getElementById('metadata-map-citation'),t=[];''==a.innerHTML?t.push('<h3 class=\'chef-h3\'>How to cite this map</h3>'):t.push(a.innerHTML),t.push('<p>'),e.author&&t.push(`${e.author}. `),e.publicationDate&&t.push(`${e.publicationDate}. `),e.title&&t.push(`<i>${e.title}.</i> `),e.permalink&&t.push(`<a href='${e.permalink}' target='_blank' >${e.permalink}</a>`),t.push('</p>'),a.innerHTML=t.join('')}addMetadata(e){var a=this.getElementById('metadata-data-sources'),t=[];''==a.innerHTML?t.push('<h3 class=\'chef-h3\'>Data sources</h3>'):t.push(a.innerHTML),t.push('<dl>'),e.layerName&&t.push(`<dt>${e.layerName}</dt>`),e.reference&&t.push(`<dd>${e.reference}`),e.permission&&t.push(`<details><summary>Permission</summary>${e.permission}</details>`),t.push('</dd>'),t.push('</dl>'),a.innerHTML=t.join('')}hideSoftwareVersion(){this.getElementById('metadata-software').style.display='none'}hideSoftwareLicense(){this.getElementById('metadata-licensing').style.display='none'}}