UNPKG

@geogirafe/lib-geoportal

Version:

GeoGirafe is a flexible application to build online geoportals.

24 lines (23 loc) 619 B
import LayerVectorTiles from '../layers/layervectortiles.js'; class Basemap { id; name; thumbnail; opacity; // Layers layersList = []; constructor(elem, opacity) { this.id = elem.id; this.name = elem.name; this.thumbnail = elem.metadata?.thumbnail ?? 'images/basemap_default.webp'; this.opacity = opacity ?? -1; } get projection() { const layer = this.layersList.find((l) => l instanceof LayerVectorTiles); return layer?.projection; } get opacityDisabled() { return this.opacity === -1; } } export default Basemap;