Skip to content

Commit

Permalink
feat: extract resolution in constante
Browse files Browse the repository at this point in the history
  • Loading branch information
maximeperrault authored and maximeperraultdev committed Jan 30, 2025
1 parent 319aeff commit 5b2f99c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/src/features/Dashboard/hooks/useExportImages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ import type { VectorLayerWithName } from 'domain/types/layer'
import type { ImageLike } from 'ol/DataTile'
import type { Geometry } from 'ol/geom'

const resolution = { height: '780px', width: '1280px' }

function loadImage(src: string) {
return new Promise<ImageLike>((resolve, reject) => {
const img = new Image()
Expand Down Expand Up @@ -140,8 +142,8 @@ export function useExportImages({ triggerExport }: ExportLayerProps) {

useEffect(() => {
const hiddenDiv = document.createElement('div')
hiddenDiv.style.width = '960px'
hiddenDiv.style.height = '540px'
hiddenDiv.style.width = resolution.width
hiddenDiv.style.height = resolution.height
hiddenDiv.style.position = 'absolute'
hiddenDiv.style.visibility = 'hidden'
document.body.appendChild(hiddenDiv)
Expand Down

0 comments on commit 5b2f99c

Please sign in to comment.