mirror of
https://github.com/zadam/trilium.git
synced 2025-10-20 23:29:02 +02:00
chore(views/geomap): remove old files
This commit is contained in:
parent
557bfbd1d6
commit
06fa59239c
@ -1,42 +0,0 @@
|
|||||||
import type { Map } from "leaflet";
|
|
||||||
import L from "leaflet";
|
|
||||||
import "leaflet/dist/leaflet.css";
|
|
||||||
import NoteContextAwareWidget from "./note_context_aware_widget.js";
|
|
||||||
|
|
||||||
const TPL = /*html*/`\
|
|
||||||
<div class="geo-map-widget">
|
|
||||||
<style>
|
|
||||||
.note-detail-geo-map,
|
|
||||||
.geo-map-widget,
|
|
||||||
|
|
||||||
|
|
||||||
.leaflet-top,
|
|
||||||
.leaflet-bottom {
|
|
||||||
z-index: 900;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
|
|
||||||
</div>`;
|
|
||||||
|
|
||||||
export type Leaflet = typeof L;
|
|
||||||
export type InitCallback = (L: Leaflet) => void;
|
|
||||||
|
|
||||||
export default class GeoMapWidget extends NoteContextAwareWidget {
|
|
||||||
|
|
||||||
private initCallback?: InitCallback;
|
|
||||||
|
|
||||||
constructor(widgetMode: "type", initCallback?: InitCallback) {
|
|
||||||
super();
|
|
||||||
this.initCallback = initCallback;
|
|
||||||
}
|
|
||||||
|
|
||||||
doRender() {
|
|
||||||
this.$widget = $(TPL);
|
|
||||||
|
|
||||||
if (this.initCallback) {
|
|
||||||
this.initCallback(L);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -28,7 +28,6 @@ import ContentWidgetTypeWidget from "./type_widgets/content_widget.js";
|
|||||||
import AttachmentListTypeWidget from "./type_widgets/attachment_list.js";
|
import AttachmentListTypeWidget from "./type_widgets/attachment_list.js";
|
||||||
import AttachmentDetailTypeWidget from "./type_widgets/attachment_detail.js";
|
import AttachmentDetailTypeWidget from "./type_widgets/attachment_detail.js";
|
||||||
import MindMapWidget from "./type_widgets/mind_map.js";
|
import MindMapWidget from "./type_widgets/mind_map.js";
|
||||||
import GeoMapTypeWidget from "./type_widgets/geo_map.js";
|
|
||||||
import utils from "../services/utils.js";
|
import utils from "../services/utils.js";
|
||||||
import type { NoteType } from "../entities/fnote.js";
|
import type { NoteType } from "../entities/fnote.js";
|
||||||
import type TypeWidget from "./type_widgets/type_widget.js";
|
import type TypeWidget from "./type_widgets/type_widget.js";
|
||||||
@ -71,7 +70,6 @@ const typeWidgetClasses = {
|
|||||||
attachmentDetail: AttachmentDetailTypeWidget,
|
attachmentDetail: AttachmentDetailTypeWidget,
|
||||||
attachmentList: AttachmentListTypeWidget,
|
attachmentList: AttachmentListTypeWidget,
|
||||||
mindMap: MindMapWidget,
|
mindMap: MindMapWidget,
|
||||||
geoMap: GeoMapTypeWidget,
|
|
||||||
aiChat: AiChatTypeWidget,
|
aiChat: AiChatTypeWidget,
|
||||||
|
|
||||||
// Split type editors
|
// Split type editors
|
||||||
|
@ -1,66 +0,0 @@
|
|||||||
import { type LatLng, type LeafletMouseEvent } from "leaflet";
|
|
||||||
import type FNote from "../../entities/fnote.js";
|
|
||||||
import GeoMapWidget, { type InitCallback, type Leaflet } from "../geo_map.js";
|
|
||||||
import TypeWidget from "./type_widget.js";
|
|
||||||
import server from "../../services/server.js";
|
|
||||||
import toastService from "../../services/toast.js";
|
|
||||||
import dialogService from "../../services/dialog.js";
|
|
||||||
import type { CommandListenerData, EventData } from "../../components/app_context.js";
|
|
||||||
import { t } from "../../services/i18n.js";
|
|
||||||
import attributes from "../../services/attributes.js";
|
|
||||||
import link from "../../services/link.js";
|
|
||||||
|
|
||||||
|
|
||||||
const TPL = /*html*/`\
|
|
||||||
<div class="note-detail-geo-map note-detail-printable">
|
|
||||||
<style>
|
|
||||||
|
|
||||||
</style>
|
|
||||||
</div>`;
|
|
||||||
|
|
||||||
const LOCATION_ATTRIBUTE = "geolocation";
|
|
||||||
const CHILD_NOTE_ICON = "bx bx-pin";
|
|
||||||
|
|
||||||
export default class GeoMapTypeWidget extends TypeWidget {
|
|
||||||
|
|
||||||
private geoMapWidget: GeoMapWidget;
|
|
||||||
private L!: Leaflet;
|
|
||||||
|
|
||||||
static getType() {
|
|
||||||
return "geoMap";
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
super();
|
|
||||||
|
|
||||||
this.geoMapWidget = new GeoMapWidget("type", (L: Leaflet) => this.#onMapInitialized(L));
|
|
||||||
|
|
||||||
|
|
||||||
this.child(this.geoMapWidget);
|
|
||||||
}
|
|
||||||
|
|
||||||
doRender() {
|
|
||||||
super.doRender();
|
|
||||||
|
|
||||||
this.$widget = $(TPL);
|
|
||||||
this.$widget.append(this.geoMapWidget.render());
|
|
||||||
}
|
|
||||||
|
|
||||||
async #onMapInitialized(L: Leaflet) {
|
|
||||||
// this.L = L;
|
|
||||||
|
|
||||||
// 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);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
async doRefresh(note: FNote) {
|
|
||||||
await this.geoMapWidget.refresh();
|
|
||||||
// this.#restoreViewportAndZoom();
|
|
||||||
// await this.#reloadMarkers();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,6 +1,7 @@
|
|||||||
import ViewMode, { ViewModeArgs } from "../view_mode.js";
|
import ViewMode, { ViewModeArgs } from "../view_mode.js";
|
||||||
import L from "leaflet";
|
import L from "leaflet";
|
||||||
import type { GPX, LatLng, LeafletMouseEvent, Map, Marker } from "leaflet";
|
import type { GPX, LatLng, LeafletMouseEvent, Map, Marker } from "leaflet";
|
||||||
|
import "leaflet/dist/leaflet.css";
|
||||||
import SpacedUpdate from "../../../services/spaced_update.js";
|
import SpacedUpdate from "../../../services/spaced_update.js";
|
||||||
import { t } from "../../../services/i18n.js";
|
import { t } from "../../../services/i18n.js";
|
||||||
import processNoteWithMarker, { processNoteWithGpxTrack } from "./markers.js";
|
import processNoteWithMarker, { processNoteWithGpxTrack } from "./markers.js";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user