diff --git a/client/src/components/map/MapPrint/MapPrint.tsx b/client/src/components/map/MapPrint/MapPrint.tsx
index df955c0..cda2f78 100644
--- a/client/src/components/map/MapPrint/MapPrint.tsx
+++ b/client/src/components/map/MapPrint/MapPrint.tsx
@@ -1,4 +1,4 @@
-import { IconHelp, IconWindowMaximize, IconWindowMinimize, IconX } from '@tabler/icons-react'
+import { IconHelp, IconWindowMaximize, IconWindowMinimize } from '@tabler/icons-react'
import React, { useEffect, useRef, useState } from 'react'
import { clearPrintArea, PrintScale, setPreviousView, setPrintScale, setPrintScaleLine, useMapStore } from '../../../store/map'
import { PrintFormat, PrintOrientation, printResolutions, setPrintOrientation, setPrintResolution, usePrintStore } from '../../../store/print'
@@ -8,7 +8,8 @@ import { useObjectsStore } from '../../../store/objects'
import jsPDF from 'jspdf'
import { getCenter } from 'ol/extent'
import ScaleLine from 'ol/control/ScaleLine'
-import { Button, Checkbox, Dropdown, Field, Option, Radio, RadioGroup, Text } from '@fluentui/react-components'
+import { Button, Checkbox, Dialog, DialogActions, DialogBody, DialogContent, DialogSurface, DialogTitle, Dropdown, Field, Option, Radio, RadioGroup, Text } from '@fluentui/react-components'
+import { Dismiss24Regular } from '@fluentui/react-icons'
const MapPrint = ({
id,
@@ -116,8 +117,11 @@ const MapPrint = ({
minWidth: 125
}))
+ const [opened, setOpened] = useState(false)
+
+
useEffect(() => {
- if (printArea) {
+ if (printArea && opened) {
// backup view before entering print mode
setPreviousView(id, map?.getView())
@@ -130,7 +134,7 @@ const MapPrint = ({
})
map?.removeInteraction(printAreaDraw)
}
- }, [printArea, map])
+ }, [printArea, map, opened])
useEffect(() => {
if (printScaleLine && printArea) {
@@ -140,8 +144,6 @@ const MapPrint = ({
}
}, [printScaleLine, printArea])
- const [opened, setOpened] = useState(false)
-
useEffect(() => {
if (!!printArea) {
setOpened(true)
@@ -157,98 +159,78 @@ const MapPrint = ({
}, [opened])
return (
-
-
-
-
- Предпросмотр области печати
-
+
-
+
+
+
Область печати можно передвигать.
-
-
Область печати можно передвигать.
+
+
+
+ setPrintOrientation(data.value as PrintOrientation)}>
+
+
+
+
-
-
- setPrintOrientation(data.value as PrintOrientation)}>
-
-
-
-
-
-
- setPrintResolution(Number(data.optionValue))}
- >
- {printResolutions.map((res) => (
-
- ))}
-
-
+
+ setPrintResolution(Number(data.optionValue))}
+ >
+ {printResolutions.map((res) => (
+
+ ))}
+
+
-
- setPrintScale(id, data.optionValue as PrintScale)}
- >
- {scaleOptions.map((opt) => (
-
- ))}
-
-
+
+ setPrintScale(id, data.optionValue as PrintScale)}
+ >
+ {scaleOptions.map((opt) => (
+
+ ))}
+
+
+
+
+
+
setPrintScaleLine(id, event.currentTarget.checked)}
/>
-
-
-
-
-
-
-
+
+
+
+
)
+
+ // return (
+ //
+ //
+ //
+ //
+ // Предпросмотр области печати
+ //
+
+ //
+ // } />
+
+ // : } onClick={() => setFullscreen(!fullscreen)} />
+
+ // } onClick={() => setOpened(false)} />
+ //
+ //
+
+ //
+ //
Область печати можно передвигать.
+
+ //
+
+ //
+
+ //
+ //
+ // setPrintOrientation(data.value as PrintOrientation)}>
+ //
+ //
+ //
+ //
+
+ //
+ // setPrintResolution(Number(data.optionValue))}
+ // >
+ // {printResolutions.map((res) => (
+ //
+ // ))}
+ //
+ //
+
+
+ //
+ // setPrintScale(id, data.optionValue as PrintScale)}
+ // >
+ // {scaleOptions.map((opt) => (
+ //
+ // ))}
+ //
+ //
+
+ // setPrintScaleLine(id, event.currentTarget.checked)}
+ // />
+ //
+
+ //
+ //
+ //
+ //
+ //
+ //
+ // )
}
export default MapPrint
\ No newline at end of file