From 13f92a72e8dc05b1e194e9ac64cc6f01443d4d1c Mon Sep 17 00:00:00 2001 From: Arpit Chakladar <54011232+arpitchakladar@users.noreply.github.com> Date: Tue, 30 Jul 2024 10:38:51 +0530 Subject: Added the ability to download the map in PDF. --- src/scripts/functionality/sheet-map.ts | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 src/scripts/functionality/sheet-map.ts (limited to 'src/scripts/functionality/sheet-map.ts') diff --git a/src/scripts/functionality/sheet-map.ts b/src/scripts/functionality/sheet-map.ts deleted file mode 100644 index 4e3bc75..0000000 --- a/src/scripts/functionality/sheet-map.ts +++ /dev/null @@ -1,20 +0,0 @@ -const downloadButtonContainer = document.createElement("td"); -const downloadButton = document.createElement("button"); -downloadButton.innerHTML = "DOWNLOAD"; -downloadButtonContainer.appendChild(downloadButton); -const svgElement = document.querySelector("svg"); -(document.querySelector("#headerTable > tbody > tr") as any).appendChild(downloadButtonContainer); -downloadButton.addEventListener("click", e => { - e.preventDefault(); - (document.querySelector("#btnResetZoom") as any).click() - function download(filename: string, text: string) { - const element = document.createElement("a"); - element.setAttribute("href", "data:text/plain;charset=utf-8," + encodeURIComponent(text)); - element.setAttribute("download", filename); - element.style.display = "none"; - document.body.appendChild(element); - element.click(); - document.body.removeChild(element); - } - download("map.svg", $("#OpenLayers_Layer_Vector_RootContainer_35").html()); -}); -- cgit v1.2.3