Fix default map and zoom initialization: HaggaBasin default, initial zoom 0.15

This commit is contained in:
Reditus committed 2026-05-16 14:29:47 +01:00
1 parent 7e2c7128e5
commit 104b3db4a8
1 file changed
+7 -3
+7 -3
View File
@@ -433,7 +433,7 @@
<input type="range" id="zoom-slider" min="15" max="350" value="15" step="10"> <input type="range" id="zoom-slider" min="15" max="350" value="15" step="10">
<button type="button" id="zoom-in" title="Zoom in">+</button> <button type="button" id="zoom-in" title="Zoom in">+</button>
</div> </div>
<div class="zoom-readout" id="zoom-readout">15%</div> <div class="zoom-readout" id="zoom-readout">100%</div>
</section> </section>
<section class="panel-section"> <section class="panel-section">
@@ -475,8 +475,8 @@ const mapImageUrls = {
}; };
let currentMap = "{{ default_map }}"; let currentMap = "{{ default_map }}";
let currentZoom = 0.5; let currentZoom = 0;
let defaultZoom = 0.5; let defaultZoom = 0.15;
let activeMarkerId = null; let activeMarkerId = null;
const enabledTypes = { player: true, vehicle: true, base: true }; const enabledTypes = { player: true, vehicle: true, base: true };
@@ -484,6 +484,10 @@ if (!mapOptions.some(map => map.key === currentMap) && mapOptions.length) {
currentMap = mapOptions[0].key; currentMap = mapOptions[0].key;
} }
const mapDefaultZoom = (mapOptions.find(m => m.key === currentMap) || mapOptions[0] || {}).default_zoom || 0.15;
currentZoom = mapDefaultZoom;
defaultZoom = mapDefaultZoom;
const els = { const els = {
choices: document.getElementById('map-choices'), choices: document.getElementById('map-choices'),
scroll: document.getElementById('map-scroll'), scroll: document.getElementById('map-scroll'),