Merge pull request #1347 from umap-project/load-invalid-bounds
Do no try to fit data bounds if bounds are not valid
This commit is contained in:
commit
6008146110
1 changed files with 3 additions and 2 deletions
|
@ -672,11 +672,12 @@ L.U.Map.include({
|
||||||
this._controls.locate.start()
|
this._controls.locate.start()
|
||||||
} else if (this.options.defaultView === 'data') {
|
} else if (this.options.defaultView === 'data') {
|
||||||
this.onceDataLoaded(() => {
|
this.onceDataLoaded(() => {
|
||||||
if (!this.hasData()) {
|
const bounds = this.getLayersBounds()
|
||||||
|
if (!this.hasData() || !bounds.isValid()) {
|
||||||
this._setDefaultCenter()
|
this._setDefaultCenter()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.fitBounds(this.getLayersBounds())
|
this.fitBounds(bounds)
|
||||||
})
|
})
|
||||||
} else if (this.options.defaultView === 'latest') {
|
} else if (this.options.defaultView === 'latest') {
|
||||||
this.onceDataLoaded(() => {
|
this.onceDataLoaded(() => {
|
||||||
|
|
Loading…
Reference in a new issue