Skip to content

Build your personal knowledge base with Trilium Notes

chore(react/collections/geomap): bring back remove from map

Elian Doran9adf9a841cae
diff --git a/apps/client/src/widgets/collections/geomap/index.tsx b/apps/client/src/widgets/collections/geomap/index.tsx
index 430f566947..a97cac980c 100644
--- a/apps/client/src/widgets/collections/geomap/index.tsx
+++ b/apps/client/src/widgets/collections/geomap/index.tsx
@@ -67,6 +67,10 @@ export default function GeoView({ note, noteIds, viewConfig, saveConfig }: ViewM
window.addEventListener("keydown", globalKeyListener);
});
+ useTriliumEvent("deleteFromMap", ({ noteId }) => {
+ moveMarker(noteId, null);
+ });
+
const onClick = useCallback(async (e: LeafletMouseEvent) => {
if (state === State.NewNote) {
toast.closePersistent("geo-new-note");
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 df87bd6697..16a36c8832 100644
--- a/apps/client/src/widgets/view_widgets/geo_view/index.ts
+++ b/apps/client/src/widgets/view_widgets/geo_view/index.ts
@@ -132,10 +132,6 @@ export default class GeoView extends ViewMode<MapData> {
}
}
- deleteFromMapEvent({ noteId }: EventData<"deleteFromMap">) {
- moveMarker(noteId, null);
- }
-
buildTouchBarCommand({ TouchBar }: CommandListenerData<"buildTouchBar">) {
const map = this.map;
const that = this;