mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-10-25 17:13:25 +08:00
fix(geomap): map cut off at first start
This commit is contained in:
parent
9204be3157
commit
545e199232
@ -124,10 +124,10 @@ export default class GeoMapTypeWidget extends TypeWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
doRender() {
|
doRender() {
|
||||||
|
super.doRender();
|
||||||
|
|
||||||
this.$widget = $(TPL);
|
this.$widget = $(TPL);
|
||||||
this.$widget.append(this.geoMapWidget.render());
|
this.$widget.append(this.geoMapWidget.render());
|
||||||
|
|
||||||
super.doRender();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async #onMapInitialized(L: Leaflet) {
|
async #onMapInitialized(L: Leaflet) {
|
||||||
@ -142,6 +142,11 @@ export default class GeoMapTypeWidget extends TypeWidget {
|
|||||||
// Restore markers.
|
// Restore markers.
|
||||||
await this.#reloadMarkers();
|
await this.#reloadMarkers();
|
||||||
|
|
||||||
|
// This fixes an issue with the map appearing cut off at the beginning, due to the container not being properly attached
|
||||||
|
setTimeout(() => {
|
||||||
|
map.invalidateSize();
|
||||||
|
}, 100);
|
||||||
|
|
||||||
const updateFn = () => this.spacedUpdate.scheduleUpdate();
|
const updateFn = () => this.spacedUpdate.scheduleUpdate();
|
||||||
map.on("moveend", updateFn);
|
map.on("moveend", updateFn);
|
||||||
map.on("zoomend", updateFn);
|
map.on("zoomend", updateFn);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user