Skip to content

Build your personal knowledge base with Trilium Notes

chore(views/geomap): remove old files

Elian Doran06fa59239c56
diff --git a/apps/client/src/widgets/geo_map.ts b/apps/client/src/widgets/geo_map.ts
deleted file mode 100644
index 2e8fc41f70..0000000000
--- a/apps/client/src/widgets/geo_map.ts
+++ /dev/null
@@ -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);
- }
-
-
- }
-}
diff --git a/apps/client/src/widgets/note_detail.ts b/apps/client/src/widgets/note_detail.ts
index 2ee5a6116c..334bea5fbf 100644
--- a/apps/client/src/widgets/note_detail.ts
+++ b/apps/client/src/widgets/note_detail.ts
@@ -28,7 +28,6 @@ import ContentWidgetTypeWidget from "./type_widgets/content_widget.js";
import AttachmentListTypeWidget from "./type_widgets/attachment_list.js";
import AttachmentDetailTypeWidget from "./type_widgets/attachment_detail.js";
import MindMapWidget from "./type_widgets/mind_map.js";
-import GeoMapTypeWidget from "./type_widgets/geo_map.js";
import utils from "../services/utils.js";
import type { NoteType } from "../entities/fnote.js";
import type TypeWidget from "./type_widgets/type_widget.js";
@@ -71,7 +70,6 @@ const typeWidgetClasses = {
attachmentDetail: AttachmentDetailTypeWidget,
attachmentList: AttachmentListTypeWidget,
mindMap: MindMapWidget,
- geoMap: GeoMapTypeWidget,
aiChat: AiChatTypeWidget,
// Split type editors
diff --git a/apps/client/src/widgets/type_widgets/geo_map.ts b/apps/client/src/widgets/type_widgets/geo_map.ts
deleted file mode 100644
index 9ef2cc489c..0000000000
--- a/apps/client/src/widgets/type_widgets/geo_map.ts
+++ /dev/null
@@ -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();
- }
-
-}
diff --git a/apps/client/src/widgets/view_widgets/geo_view/index.ts b/apps/client/src/widgets/view_widgets/geo_view/index.ts
index 5791ecf38b..a9a58645d6 100644
--- a/apps/client/src/widgets/view_widgets/geo_view/index.ts
+++ b/apps/client/src/widgets/view_widgets/geo_view/index.ts
@@ -1,6 +1,7 @@
import ViewMode, { ViewModeArgs } from "../view_mode.js";
import L from "leaflet";
import type { GPX, LatLng, LeafletMouseEvent, Map, Marker } from "leaflet";
+import "leaflet/dist/leaflet.css";
import SpacedUpdate from "../../../services/spaced_update.js";
import { t } from "../../../services/i18n.js";
import processNoteWithMarker, { processNoteWithGpxTrack } from "./markers.js";