chore(react/collections/geomap): restore state

This commit is contained in:
Elian Doran
2025-09-04 15:13:48 +03:00
parent 2346230d36
commit 63dd79e23c
4 changed files with 39 additions and 58 deletions

View File

@@ -72,8 +72,6 @@ export default class GeoView extends ViewMode<MapData> {
throw new Error(t("geo-map.unable-to-load-map"));
}
this.#restoreViewportAndZoom();
const isEditable = !this.isReadOnly;
map.on("click", (e) => this.#onMapClicked(e))
map.on("contextmenu", (e) => openMapContextMenu(this.parentNote.noteId, e, isEditable));
@@ -95,34 +93,6 @@ export default class GeoView extends ViewMode<MapData> {
}
}
async #restoreViewportAndZoom() {
const map = this.map;
if (!map) {
return;
}
const parsedContent = await this.viewStorage.restore();
// Restore viewport position & zoom
const center = parsedContent?.view?.center ?? DEFAULT_COORDINATES;
const zoom = parsedContent?.view?.zoom ?? DEFAULT_ZOOM;
}
private onSave() {
const map = this.map;
let data: MapData = {};
if (map) {
data = {
view: {
center: ,
zoom:
}
};
}
}
async #reloadMarkers() {
if (!this.map) {
return;