feat: toggleable search box

This commit is contained in:
ccmdi 2025-11-23 17:18:40 -05:00
parent da11401e63
commit 1cefcb2829
No known key found for this signature in database
2 changed files with 15 additions and 2 deletions

View file

@ -13,6 +13,7 @@ export interface MapPluginSettings {
thumbnailTargetSize: number;
tagSettings: MapTagSettings;
enableTimelineView: boolean;
enableSearchGeocoding: boolean;
}
export const DEFAULT_SETTINGS: MapPluginSettings = {
@ -25,7 +26,8 @@ export const DEFAULT_SETTINGS: MapPluginSettings = {
enableThumbnailCache: false,
thumbnailTargetSize: 25,
tagSettings: DEFAULT_MAP_TAG_SETTINGS,
enableTimelineView: false
enableTimelineView: false,
enableSearchGeocoding: false
};
export class MapSettingTab extends PluginSettingTab {
@ -120,6 +122,15 @@ export class MapSettingTab extends PluginSettingTab {
this.plugin.settings.transitionDuration = value;
await this.plugin.saveSettings();
}));
new Setting(containerEl)
.setName('Enable search geocoding')
.setDesc('Enable a search bar to go to locations via natural language or coordinate paste')
.addToggle(toggle => toggle
.setValue(this.plugin.settings.enableSearchGeocoding)
.onChange(async (value) => {
this.plugin.settings.enableSearchGeocoding = value;
await this.plugin.saveSettings();
}));
new Setting(containerEl)
.setName('Performance')

View file

@ -306,7 +306,9 @@ export class MapBasesView extends BasesView {
this.containerEl.removeClass('is-loading');
this.createSearchBox();
if (this.plugin.settings.enableSearchGeocoding) {
this.createSearchBox();
}
setTimeout(() => {
if (!tilesLoaded) {