fix: do not show browser counter when layer is empty or not loaded (#2217)

fix #2215
This commit is contained in:
Yohan Boniface 2024-10-16 12:01:49 +02:00 committed by GitHub
commit dab8bce27e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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)