mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 11:32:38 +02:00
fix: do not add auto zoom and center in undo stack
Co-authored-by: Yohan Boniface <yohanboniface@free.fr>
This commit is contained in:
parent
d6f591b365
commit
02d3e19450
1 changed files with 8 additions and 6 deletions
|
@ -1742,20 +1742,22 @@ export default class Umap {
|
|||
}
|
||||
|
||||
setCenterAndZoom() {
|
||||
this._setCenterAndZoom()
|
||||
this._setCenterAndZoom(true)
|
||||
Alert.success(translate('The zoom and center have been modified.'))
|
||||
}
|
||||
|
||||
_setCenterAndZoom() {
|
||||
_setCenterAndZoom(manual) {
|
||||
const oldCenter = { ...this.properties.center }
|
||||
const oldZoom = this.properties.zoom
|
||||
this.properties.center = this._leafletMap.getCenter()
|
||||
this.properties.zoom = this._leafletMap.getZoom()
|
||||
this._defaultExtent = false
|
||||
this.sync.startBatch()
|
||||
this.sync.update('properties.center', this.properties.center, oldCenter)
|
||||
this.sync.update('properties.zoom', this.properties.zoom, oldZoom)
|
||||
this.sync.commitBatch()
|
||||
if (manual) {
|
||||
this.sync.startBatch()
|
||||
this.sync.update('properties.center', this.properties.center, oldCenter)
|
||||
this.sync.update('properties.zoom', this.properties.zoom, oldZoom)
|
||||
this.sync.commitBatch()
|
||||
}
|
||||
}
|
||||
|
||||
getStaticPathFor(name) {
|
||||
|
|
Loading…
Reference in a new issue