mirror of
https://github.com/umap-project/umap.git
synced 2025-05-14 09:41:52 +02:00
Compare commits
4 commits
d4fb92ec56
...
49d1dbf36e
Author | SHA1 | Date | |
---|---|---|---|
![]() |
49d1dbf36e | ||
![]() |
7cb6c0c45f | ||
![]() |
17e6cf7500 | ||
![]() |
a9d9beacb2 |
3 changed files with 8 additions and 4 deletions
|
@ -950,9 +950,13 @@ export class DataLayer extends ServerStored {
|
||||||
else this.hide()
|
else this.hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
zoomTo(bounds) {
|
zoomTo() {
|
||||||
if (!this.isVisible()) return
|
if (!this.isVisible()) return
|
||||||
bounds = bounds || this.layer.getBounds()
|
const bounds = this.layer.getBounds()
|
||||||
|
this.zoomToBounds(bounds)
|
||||||
|
}
|
||||||
|
|
||||||
|
zoomToBounds(bounds) {
|
||||||
if (bounds.isValid()) {
|
if (bounds.isValid()) {
|
||||||
const options = { maxZoom: this.getOption('zoomTo') }
|
const options = { maxZoom: this.getOption('zoomTo') }
|
||||||
this._leafletMap.fitBounds(bounds, options)
|
this._leafletMap.fitBounds(bounds, options)
|
||||||
|
|
|
@ -382,7 +382,7 @@ export default class Importer extends Utils.WithTemplate {
|
||||||
bounds.extend(featureBounds)
|
bounds.extend(featureBounds)
|
||||||
}
|
}
|
||||||
this.onSuccess(features.length)
|
this.onSuccess(features.length)
|
||||||
layer.zoomTo(bounds)
|
layer.zoomToBounds(bounds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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('click', () => this._umap.askForReset())
|
||||||
this.elements.cancel.addEventListener('mouseover', () => {
|
this.elements.cancel.addEventListener('mouseover', () => {
|
||||||
this._umap.tooltip.open({
|
this._umap.tooltip.open({
|
||||||
|
|
Loading…
Reference in a new issue