mirror of
https://github.com/ccmdi/obsidian-map-plus.git
synced 2026-07-22 06:43:14 +00:00
feat: add scroll zoom speed setting
This commit is contained in:
parent
48f7cc7575
commit
4b9edfd4f1
2 changed files with 16 additions and 2 deletions
|
|
@ -646,7 +646,7 @@ export function createMapRenderer(config: MapRendererOptions): Deck<MapViewType[
|
|||
initialViewState: { MapView: initialViewState },
|
||||
controller: {
|
||||
inertia: true,
|
||||
scrollZoom: { speed: 0.02, smooth: true },
|
||||
scrollZoom: { speed: settings.scrollZoomSpeed, smooth: true },
|
||||
touchRotate: false,
|
||||
keyboard: false,
|
||||
dragRotate: false,
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ export interface MapPluginSettings {
|
|||
tagSettings: MapTagSettings;
|
||||
enableTimelineView: boolean;
|
||||
enableSearchGeocoding: boolean;
|
||||
scrollZoomSpeed: number;
|
||||
}
|
||||
|
||||
export const DEFAULT_SETTINGS: MapPluginSettings = {
|
||||
|
|
@ -27,7 +28,8 @@ export const DEFAULT_SETTINGS: MapPluginSettings = {
|
|||
thumbnailTargetSize: 25,
|
||||
tagSettings: DEFAULT_MAP_TAG_SETTINGS,
|
||||
enableTimelineView: false,
|
||||
enableSearchGeocoding: false
|
||||
enableSearchGeocoding: false,
|
||||
scrollZoomSpeed: 0.04
|
||||
};
|
||||
|
||||
export class MapSettingTab extends PluginSettingTab {
|
||||
|
|
@ -89,6 +91,18 @@ export class MapSettingTab extends PluginSettingTab {
|
|||
}, 250);
|
||||
}));
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Scroll zoom speed')
|
||||
.addSlider(slider => slider
|
||||
.setLimits(0.01, 0.1, 0.01)
|
||||
.setValue(this.plugin.settings.scrollZoomSpeed)
|
||||
.setDynamicTooltip()
|
||||
.onChange(async (value) => {
|
||||
this.plugin.settings.scrollZoomSpeed = value;
|
||||
await this.plugin.saveSettings();
|
||||
this.plugin.refreshAllMapViews();
|
||||
}));
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Fill icons')
|
||||
.addToggle(toggle => toggle
|
||||
|
|
|
|||
Loading…
Reference in a new issue