From 46186c7ce779281906503f819775a8595ef9e999 Mon Sep 17 00:00:00 2001 From: Rambaud Pierrick <12rambau@users.noreply.github.com> Date: Wed, 27 Sep 2023 13:03:40 +0000 Subject: [PATCH] remove map --- docs/source/_static/js/custom.js | 66 -------------------------------- docs/source/_templates/map.html | 7 ---- docs/source/conf.py | 5 ++- 3 files changed, 3 insertions(+), 75 deletions(-) delete mode 100644 docs/source/_static/js/custom.js delete mode 100644 docs/source/_templates/map.html diff --git a/docs/source/_static/js/custom.js b/docs/source/_static/js/custom.js deleted file mode 100644 index 7b77a16bf1..0000000000 --- a/docs/source/_static/js/custom.js +++ /dev/null @@ -1,66 +0,0 @@ -function init() { - var map = L.map("map", { zoomControl: false }).setView([0, 0], 3); - - //CartoDB layer names: light_all / dark_all / light_nonames / dark_nonames - var layers = { - light: L.tileLayer( - "https://{s}.basemaps.cartocdn.com/light_nolabels/{z}/{x}/{y}.png", - { attribution: "" } - ), - dark: L.tileLayer( - "https://{s}.basemaps.cartocdn.com/dark_nolabels/{z}/{x}/{y}.png", - { attribution: "" } - ), - }; - - const startTheme = document.documentElement.dataset.theme - ? document.documentElement.dataset.theme - : "light"; - layers[startTheme].addTo(map); - - // Don't show the 'Powered by Leaflet' text. Attribution overload - map.attributionControl.setPrefix(""); - - // Remove all interaction - map.dragging.disable(); - map.touchZoom.disable(); - map.doubleClickZoom.disable(); - map.scrollWheelZoom.disable(); - map.boxZoom.disable(); - map.keyboard.disable(); - if (map.tap) map.tap.disable(); - document.getElementById("map").style.cursor = "default"; - - // observe html theme value - const mutationCallback = (mutationsList) => { - for (const mutation of mutationsList) { - // exit if not the correct attribute - if ( - mutation.type !== "attributes" || - mutation.attributeName == "data-theme" - ) { - return; - } - - // refactor the map - var theme = mutation.target.getAttribute("data-theme"); - - //alert(map.hasLayer(layers[theme])); - - if (!map.hasLayer(layers[theme])) { - // remove the layers - map.eachLayer(function (layer) { - map.removeLayer(layer); - }); - - // add the correct one - layers[theme].addTo(map); - } - } - }; - - const observer = new MutationObserver(mutationCallback); - observer.observe(document.documentElement, { attributes: true }); -} - -window.onload = init; diff --git a/docs/source/_templates/map.html b/docs/source/_templates/map.html deleted file mode 100644 index 42ce509e1f..0000000000 --- a/docs/source/_templates/map.html +++ /dev/null @@ -1,7 +0,0 @@ -
- Map from - OpenStreetMap - contributors, © CartoDB -
-
-
diff --git a/docs/source/conf.py b/docs/source/conf.py index 0c2b29f80f..0655b5049b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -109,8 +109,9 @@ ], "use_edit_page_button": True, "article_footer_items": ["last-updated"], - "footer_start": ["copyright", "map", "sphinx-version", "licence"], - "footer_end": ["community", "issue-tracker", "e-learning", "stackexchange"], + "footer_start": ["copyright", "sphinx-version", "licence"], + "footer_center": ["community", "issue-tracker"], + "footer_end": ["e-learning", "stackexchange"], } # -- option for the favicon extention ------------------------------------------