refactor: 구글 맵 이미지 백그라운드 사용 추가

This commit is contained in:
yoosangwook 2024-11-11 11:09:34 +09:00
parent 2d7f8c18e9
commit 7cd2f73282
2 changed files with 11 additions and 11 deletions

View File

@ -16,11 +16,11 @@ import PanelBatchStatistics from '@/components/floor-plan/modal/panelBatch/Panel
export default function CanvasFrame() {
const canvasRef = useRef(null)
const { canvas } = useCanvas('canvas')
const { canvas, handleBackImageLoadToCanvas } = useCanvas('canvas')
const { canvasLoadInit, gridInit } = useCanvasConfigInitialize()
const currentMenu = useRecoilValue(currentMenuState)
const { contextMenu, handleClick } = useContextMenu()
const { selectedPlan, modifiedPlanFlag, checkCanvasObjectEvent, resetModifiedPlans } = usePlan()
const { selectedPlan, modifiedPlanFlag, checkCanvasObjectEvent, resetModifiedPlans, currentCanvasPlan } = usePlan()
useEvent()
const loadCanvas = () => {

View File

@ -54,20 +54,20 @@ export default function useRefFiles() {
const res = await get({ url: `http://localhost:3000/api/html2canvas?q=${queryRef.current.value}&fileNm=${uuidv4()}&zoom=20` })
console.log('🚀 ~ handleMapImageDown ~ res:', res)
setCurrentCanvasPlan((prev) => ({ ...prev, bgFileName: res.fileNm, mapPositionAddress: queryRef.current.value }))
setCurrentCanvasPlan((prev) => ({ ...prev, bgImageName: res.fileNm, mapPositionAddress: queryRef.current.value }))
}
/**
* 현재 플랜이 변경되면 플랜 상태 저장
*/
useEffect(() => {
const handleCurrentPlan = async () => {
await promisePut({ url: '/api/canvas-management/canvas-statuses', data: currentCanvasPlan }).then((res) => {
console.log('🚀 ~ awaitpromisePut ~ res:', res)
})
}
handleCurrentPlan()
}, [currentCanvasPlan])
// useEffect(() => {
// const handleCurrentPlan = async () => {
// await promisePut({ url: '/api/canvas-management/canvas-statuses', data: currentCanvasPlan }).then((res) => {
// console.log('🚀 ~ awaitpromisePut ~ res:', res)
// })
// }
// handleCurrentPlan()
// }, [currentCanvasPlan])
/**
* RefFile이 캐드 도면 파일일 경우 변환하여 이미지로 저장