mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
Since
de921660c9 (diff-4a01a166046bdf7e4ea7d41d97cd82a57c82f63d10d1697f76e6fe22bfa769ebR954)
we were calling it with bounds but also with the click event sometimes.
This commit is contained in:
commit
49d1dbf36e
2 changed files with 7 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -382,7 +382,7 @@ export default class Importer extends Utils.WithTemplate {
|
|||
bounds.extend(featureBounds)
|
||||
}
|
||||
this.onSuccess(features.length)
|
||||
layer.zoomTo(bounds)
|
||||
layer.zoomToBounds(bounds)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue