aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2024-07-30 12:31:26 +0530
committerArpit Chakladar <54011232+arpitchakladar@users.noreply.github.com>2024-07-30 12:32:50 +0530
commitb9c9a315efce8bddf765c62352c0966595b31c46 (patch)
treedbb2d7c84c0d3d5925ddf9bd2d92809a040bd583
parent36252ce59f83913478fc717209f0f4079f516a89 (diff)
downloadbanglar-bhumi-utils-b9c9a315efce8bddf765c62352c0966595b31c46.tar.gz
banglar-bhumi-utils-b9c9a315efce8bddf765c62352c0966595b31c46.zip
Removed download svg button.
-rw-r--r--src/scripts/functionality/sheet-map/index.ts34
1 files changed, 7 insertions, 27 deletions
diff --git a/src/scripts/functionality/sheet-map/index.ts b/src/scripts/functionality/sheet-map/index.ts
index e76650e..c3ad13f 100644
--- a/src/scripts/functionality/sheet-map/index.ts
+++ b/src/scripts/functionality/sheet-map/index.ts
@@ -34,17 +34,13 @@ const createHeaderButton = (text: string) => {
};
const setPlotInformation = (plotPolygon: PlotPolygon | null | undefined = null) => {
- if (plotPolygon) {
- plotInformation.innerHTML = getPlotInformationElement({
- area: (plotPolygon.plotArea/1000).toFixed(3),
- plotNumber: plotPolygon.plotno
- });
- } else {
- plotInformation.innerHTML = getPlotInformationElement({
- area: "0.000",
- plotNumber: ""
- });
- }
+ plotInformation.innerHTML = plotPolygon ? getPlotInformationElement({
+ area: (plotPolygon.plotArea/1000).toFixed(3),
+ plotNumber: plotPolygon.plotno
+ }) : getPlotInformationElement({
+ area: "0.000",
+ plotNumber: ""
+ });
};
const downloadPDF = (labelPoints: boolean = true) => {
@@ -56,24 +52,9 @@ const downloadPDF = (labelPoints: boolean = true) => {
);
};
-const downloadSVGButton = createHeaderButton("SAVE SVG");
const downloadPDFButton = createHeaderButton("SAVE PDF");
const downloadPDFNoLabelButton = createHeaderButton("SAVE PDF (NO LABEL)");
-downloadSVGButton.addEventListener("click", e => {
- e.preventDefault();
- const element = document.createElement("a");
- element.setAttribute(
- "href",
- "data:text/plain;charset=utf-8," + encodeURIComponent(plotPolygonPathElements + plotNumberLabelTextElements)
- );
- element.setAttribute("download", "map.svg");
- element.style.display = "none";
- document.body.appendChild(element);
- element.click();
- document.body.removeChild(element);
-});
-
downloadPDFButton.addEventListener("click", e => {
e.preventDefault();
downloadPDF();
@@ -118,7 +99,6 @@ setPlotInformation();
});
}
- downloadSVGButton.style.display = "inherit";
downloadPDFButton.style.display = "inherit";
downloadPDFNoLabelButton.style.display = "inherit";