mirror of
https://github.com/ccmdi/obsidian-map-plus.git
synced 2026-07-22 06:43:14 +00:00
feat: toggleable search box
This commit is contained in:
parent
da11401e63
commit
1cefcb2829
2 changed files with 15 additions and 2 deletions
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue