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 a9a58645d..cd98e38c0 100644 --- a/apps/client/src/widgets/view_widgets/geo_view/index.ts +++ b/apps/client/src/widgets/view_widgets/geo_view/index.ts @@ -112,7 +112,6 @@ enum State { export default class GeoView extends ViewMode { - private args: ViewModeArgs; private $root: JQuery; private $container!: JQuery; private map?: Map; @@ -125,7 +124,6 @@ export default class GeoView extends ViewMode { constructor(args: ViewModeArgs) { super(args, "geoMap"); - this.args = args; this.$root = $(TPL); this.$container = this.$root.find(".geo-map-container"); this.spacedUpdate = new SpacedUpdate(() => this.onSave(), 5_000); diff --git a/apps/client/src/widgets/view_widgets/geo_view/markers.ts b/apps/client/src/widgets/view_widgets/geo_view/markers.ts index ca4170f6e..1d335cfcb 100644 --- a/apps/client/src/widgets/view_widgets/geo_view/markers.ts +++ b/apps/client/src/widgets/view_widgets/geo_view/markers.ts @@ -2,7 +2,6 @@ import markerIcon from "leaflet/dist/images/marker-icon.png"; import markerIconShadow from "leaflet/dist/images/marker-shadow.png"; import { marker, latLng, divIcon, Map, type Marker } from "leaflet"; import type FNote from "../../../entities/fnote.js"; -import note_tooltip from "../../../services/note_tooltip.js"; import openContextMenu from "./context_menu.js"; import server from "../../../services/server.js"; import { moveMarker } from "./editing.js"; @@ -11,7 +10,7 @@ let gpxLoaded = false; export default function processNoteWithMarker(map: Map, note: FNote, location: string) { const [lat, lng] = location.split(",", 2).map((el) => parseFloat(el)); - const icon = buildIcon(note.getIcon(), note.getColorClass(), note.title); + const icon = buildIcon(note.getIcon(), note.getColorClass(), note.title, note.noteId); const newMarker = marker(latLng(lat, lng), { icon, @@ -36,13 +35,6 @@ export default function processNoteWithMarker(map: Map, note: FNote, location: s openContextMenu(note.noteId, e.originalEvent); }); - const el = newMarker.getElement(); - if (el) { - const $el = $(el); - $el.attr("data-href", `#${note.noteId}`); - note_tooltip.setupElementTooltip($($el)); - } - return newMarker; } @@ -76,13 +68,19 @@ export async function processNoteWithGpxTrack(map: Map, note: FNote) { return track; } -function buildIcon(bxIconClass: string, colorClass?: string, title?: string) { +function buildIcon(bxIconClass: string, colorClass?: string, title?: string, noteIdLink?: string) { + let html = /*html*/`\ + + + + ${title ?? ""}`; + + if (noteIdLink) { + html = `
${html}
`; + } + return divIcon({ - html: /*html*/`\ - - - - ${title ?? ""}`, + html, iconSize: [25, 41], iconAnchor: [12, 41] });