Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

base zoom in/out button enable/disable on numZoomLevels rather than resolutions array length

Jason Kentedb1d04df49c
diff --git a/web/js/map/ui.js b/web/js/map/ui.js
index 3df310b7c..d06425e17 100644
--- a/web/js/map/ui.js
+++ b/web/js/map/ui.js
@@ -1070,12 +1070,12 @@ export function mapui(models, config, store, ui) {
*
*/
var onZoomChange = function() {
- var maxZoom = proj.resolutions.length;
- var zoom = map.getView().getZoom();
+ const { numZoomLevels } = proj;
+ const zoom = map.getView().getZoom();
if (zoom === 0) {
$zoomIn.button('enable');
$zoomOut.button('disable');
- } else if (zoom === maxZoom) {
+ } else if (zoom === numZoomLevels) {
$zoomIn.button('disable');
$zoomOut.button('enable');
} else {