From f4e5b5465127f0d9b7067573afc65545807a3f47 Mon Sep 17 00:00:00 2001 From: Leigh Oliver Date: Thu, 13 Sep 2018 11:02:11 +1000 Subject: [PATCH] Fixed behaviour of 'defaultZoom' property. The initial map view was not affected by the 'defaultZoom' property in the config file. This has been fixed, by passing the value into 'centers' collection, when it is initially created. Additionally, the 'defaultZoom' config property is passed to the first overviewer.map.setView statement, to ensure correct zoom level on the initial page load. --- overviewer_core/data/js_src/util.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/overviewer_core/data/js_src/util.js b/overviewer_core/data/js_src/util.js index f6578d9..12c47f8 100644 --- a/overviewer_core/data/js_src/util.js +++ b/overviewer_core/data/js_src/util.js @@ -324,9 +324,9 @@ overviewer.util = { if (typeof(obj.spawn) == "object") { var latlng = overviewer.util.fromWorldToLatLng(obj.spawn[0], obj.spawn[1], obj.spawn[2], obj); - overviewer.collections.centers[obj.world] = [ latlng, 1 ]; + overviewer.collections.centers[obj.world] = [ latlng, obj.defaultZoom ]; } else { - overviewer.collections.centers[obj.world] = [ [0, 0], 1 ]; + overviewer.collections.centers[obj.world] = [ [0, 0], obj.defaultZoom ]; } }); @@ -339,7 +339,7 @@ overviewer.util = { overviewer.current_world = overviewerConfig.worlds[0]; //myLayer.addTo(overviewer.map); - overviewer.map.setView(overviewer.util.fromWorldToLatLng(tset.spawn[0], tset.spawn[1], tset.spawn[2], tset), 1); + overviewer.map.setView(overviewer.util.fromWorldToLatLng(tset.spawn[0], tset.spawn[1], tset.spawn[2], tset), tset.defaultZoom); if (!overviewer.util.initHash()) { overviewer.worldCtrl.onChange({target: {value: overviewer.current_world}});