diff --git a/src/components/Map.vue b/src/components/Map.vue index c632769..d4debd5 100644 --- a/src/components/Map.vue +++ b/src/components/Map.vue @@ -322,7 +322,7 @@ export default defineComponent({ if(map !== store.state.currentMap && (targetWorld !== currentWorld || newFollow)) { this.scheduledPan = player.location; - if(newFollow) { + if(newFollow && store.state.configuration.followZoom) { console.log(`Setting zoom for new follow ${store.state.configuration.followZoom}`); this.scheduledZoom = store.state.configuration.followZoom; } @@ -332,7 +332,7 @@ export default defineComponent({ } else { this.leaflet!.panTo(store.state.currentMap?.locationToLatLng(player.location)); - if(newFollow) { + if(newFollow && store.state.configuration.followZoom) { console.log(`Setting zoom for new follow ${store.state.configuration.followZoom}`); this.leaflet!.setZoom(store.state.configuration.followZoom); } diff --git a/src/index.d.ts b/src/index.d.ts index da59ca8..e43b95c 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -241,7 +241,7 @@ interface LiveAtlasServerConfig { defaultWorld?: string; defaultZoom: number; followMap?: string; - followZoom: number; + followZoom?: number; title: string; grayHiddenPlayers: boolean; expandUI: boolean; diff --git a/src/providers/DynmapMapProvider.ts b/src/providers/DynmapMapProvider.ts index c56d20a..da34475 100644 --- a/src/providers/DynmapMapProvider.ts +++ b/src/providers/DynmapMapProvider.ts @@ -60,7 +60,7 @@ export default class DynmapMapProvider extends MapProvider { defaultWorld: response.defaultworld || undefined, defaultZoom: response.defaultzoom || 0, followMap: response.followmap || undefined, - followZoom: response.followzoom || 0, + followZoom: response.followzoom, title: response.title.replace(titleColoursRegex, '') || 'Dynmap', expandUI: response.sidebaropened && response.sidebaropened !== 'false', //Sent as a string for some reason };