Fix max not loading when defaultView=latest and datalayer has no data

When the default datalayer has no data, we need a fallback

fix #1374
This commit is contained in:
Yohan Boniface 2023-10-24 15:06:13 +02:00
parent 219b3e17dd
commit 47e5a0676a

View file

@ -697,6 +697,7 @@ L.U.Map.include({
const datalayer = this.defaultDataLayer(),
feature = datalayer.getFeatureByIndex(-1)
if (feature) feature.zoomTo()
else this._setDefaultCenter()
})
} else {
this._setDefaultCenter()