diff --git a/docs/changelog.md b/docs/changelog.md index 2b02a255..c0ea8e03 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,9 @@ # Changelog +## 2.0.4 - 2024-03-01 + +* fix zoom and fullscreen not shown by default + ## 2.0.3 - 2024-03-01 ### Bug fixes diff --git a/umap/__init__.py b/umap/__init__.py index c129f683..215732a1 100644 --- a/umap/__init__.py +++ b/umap/__init__.py @@ -1 +1 @@ -VERSION = "2.0.3" +VERSION = "2.0.4" diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index 7b638618..bc73784b 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -149,8 +149,8 @@ U.Map = L.Map.extend({ this.name = this.options.name this.description = this.options.description this.demoTileInfos = this.options.demoTileInfos - this.options.zoomControl = zoomControl - this.options.fullscreenControl = fullscreenControl + this.options.zoomControl = zoomControl !== undefined ? zoomControl : true + this.options.fullscreenControl = fullscreenControl !== undefined ? fullscreenControl : true this.datalayersOnLoad = L.Util.queryString('datalayers') if (this.datalayersOnLoad) { this.datalayersOnLoad = this.datalayersOnLoad.toString().split(',') diff --git a/umap/tests/integration/test_map.py b/umap/tests/integration/test_map.py index abb0601c..f0624008 100644 --- a/umap/tests/integration/test_map.py +++ b/umap/tests/integration/test_map.py @@ -228,3 +228,12 @@ def test_minimap_on_load(map, live_server, datalayer, page): map.save() page.goto(f"{live_server.url}{map.get_absolute_url()}") expect(page.locator(".leaflet-control-minimap")).to_be_visible() + + +def test_zoom_control_on_load(map, live_server, page): + page.goto(f"{live_server.url}{map.get_absolute_url()}") + expect(page.locator(".leaflet-control-zoom")).to_be_visible() + map.settings["properties"]["zoomControl"] = False + map.save() + page.goto(f"{live_server.url}{map.get_absolute_url()}") + expect(page.locator(".leaflet-control-zoom")).to_be_hidden()