mirror of
https://github.com/umap-project/umap.git
synced 2025-05-14 17:51:51 +02:00
Compare commits
No commits in common. "49d1dbf36ef4b2e589c566d3c3fd6c1d5c465b18" and "d4fb92ec56a410b94e9ee352cfb0b4c81b6a93db" have entirely different histories.
49d1dbf36e
...
d4fb92ec56
3 changed files with 4 additions and 8 deletions
|
@ -950,13 +950,9 @@ export class DataLayer extends ServerStored {
|
||||||
else this.hide()
|
else this.hide()
|
||||||
}
|
}
|
||||||
|
|
||||||
zoomTo() {
|
zoomTo(bounds) {
|
||||||
if (!this.isVisible()) return
|
if (!this.isVisible()) return
|
||||||
const bounds = this.layer.getBounds()
|
bounds = 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.zoomToBounds(bounds)
|
layer.zoomTo(bounds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,7 @@ export class TopBar extends WithTemplate {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
this.elements.help.addEventListener('click', () => this._umap.help.showGetStarted())
|
this.elements.help.addEventListener('click', () => this._umap.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