fix: do not show browser counter when layer is empty or not loaded

fix #2215
This commit is contained in:
Yohan Boniface 2024-10-15 10:45:10 +02:00
parent e0812afea8
commit d8383dafba

View file

@ -98,6 +98,7 @@ export default class Browser {
datalayer.eachFeature((feature) => this.addFeature(feature, container))
const total = datalayer.count()
if (!total) return
const current = container.querySelectorAll('li').length
const count = total === current ? total : `${current}/${total}`
const counter = DomUtil.create('span', 'datalayer-counter', headline)