diff --git a/src/public/app/widgets/geo_map.ts b/src/public/app/widgets/geo_map.ts index fabefcdc9..eef72a748 100644 --- a/src/public/app/widgets/geo_map.ts +++ b/src/public/app/widgets/geo_map.ts @@ -1,6 +1,7 @@ import type { Map } from "leaflet"; import library_loader from "../services/library_loader.js"; import NoteContextAwareWidget from "./note_context_aware_widget.js"; +import type { CommandListenerData } from "../components/app_context.js"; const TPL = `\
@@ -59,4 +60,22 @@ export default class GeoMapWidget extends NoteContextAwareWidget { }); } + buildTouchBarCommand({ TouchBar }: CommandListenerData<"buildTouchBar">) { + const map = this.map; + if (!map) { + return; + } + + return [ + new TouchBar.TouchBarSlider({ + label: "Zoom", + minValue: map.getMinZoom(), + maxValue: map.getMaxZoom(), + change(newValue) { + map.setZoom(newValue); + }, + }) + ]; + } + }