fixup: fix save center and zoom (#2371)
Some checks are pending
Test & Docs / tests (postgresql, 3.10) (push) Waiting to run
Test & Docs / tests (postgresql, 3.12) (push) Waiting to run
Test & Docs / lint (push) Waiting to run
Test & Docs / docs (push) Waiting to run

Broken since map split.
This commit is contained in:
Yohan Boniface 2024-12-16 18:30:37 +01:00 committed by GitHub
commit 06c2438ff1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1192,7 +1192,7 @@ export default class Umap extends ServerStored {
geometry() { geometry() {
/* Return a GeoJSON geometry Object */ /* Return a GeoJSON geometry Object */
const latlng = this._leafletMap.latLng( const latlng = this._leafletMap.latLng(
this._leafletMap.options.center || this._leafletMap.getCenter() this.properties.center || this._leafletMap.getCenter()
) )
return { return {
type: 'Point', type: 'Point',
@ -1670,8 +1670,8 @@ export default class Umap extends ServerStored {
} }
_setCenterAndZoom() { _setCenterAndZoom() {
this._leafletMap.options.center = this._leafletMap.getCenter() this.properties.center = this._leafletMap.getCenter()
this._leafletMap.options.zoom = this._leafletMap.getZoom() this.properties.zoom = this._leafletMap.getZoom()
this.isDirty = true this.isDirty = true
this._defaultExtent = false this._defaultExtent = false
} }