Compare commits

..

4 commits

Author SHA1 Message Date
David Larlet
49d1dbf36e
fix(#2391): split zoomTo to accept bounds (#2394)
Some checks failed
Test & Docs / tests (postgresql, 3.10) (push) Has been cancelled
Test & Docs / tests (postgresql, 3.12) (push) Has been cancelled
Test & Docs / lint (push) Has been cancelled
Test & Docs / docs (push) Has been cancelled
Since
de921660c9 (diff-4a01a166046bdf7e4ea7d41d97cd82a57c82f63d10d1697f76e6fe22bfa769ebR954)
we were calling it with bounds but also with the click event sometimes.
2024-12-20 09:42:46 -05:00
David Larlet
7cb6c0c45f
fix(#2391): split zoomTo to accept bounds
Since de921660c9 (diff-4a01a166046bdf7e4ea7d41d97cd82a57c82f63d10d1697f76e6fe22bfa769ebR954) we were calling it with bounds but also with the click event sometimes.
2024-12-20 09:25:25 -05:00
David Larlet
17e6cf7500
fix: main help button was broken (#2393) 2024-12-20 08:34:15 -05:00
Yohan Boniface
a9d9beacb2 fix: main help button was broken 2024-12-20 14:12:13 +01:00
3 changed files with 8 additions and 4 deletions

View file

@ -950,9 +950,13 @@ export class DataLayer extends ServerStored {
else this.hide()
}
zoomTo(bounds) {
zoomTo() {
if (!this.isVisible()) return
bounds = bounds || this.layer.getBounds()
const bounds = this.layer.getBounds()
this.zoomToBounds(bounds)
}
zoomToBounds(bounds) {
if (bounds.isValid()) {
const options = { maxZoom: this.getOption('zoomTo') }
this._leafletMap.fitBounds(bounds, options)

View file

@ -382,7 +382,7 @@ export default class Importer extends Utils.WithTemplate {
bounds.extend(featureBounds)
}
this.onSuccess(features.length)
layer.zoomTo(bounds)
layer.zoomToBounds(bounds)
}
}
}

View file

@ -110,7 +110,7 @@ export class TopBar extends WithTemplate {
})
})
this.elements.help.addEventListener('click', () => this._umap.showGetStarted())
this.elements.help.addEventListener('click', () => this._umap.help.showGetStarted())
this.elements.cancel.addEventListener('click', () => this._umap.askForReset())
this.elements.cancel.addEventListener('mouseover', () => {
this._umap.tooltip.open({