Skip to content

Commit

Permalink
refactor: better typing
Browse files Browse the repository at this point in the history
  • Loading branch information
TurtIeSocks committed Jan 12, 2024
1 parent 6d03eb1 commit 624d5b7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/services/functions/getQueryArgs.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// @ts-check
import { useMapStore } from '@hooks/useMapStore'

export function getQueryArgs() {
Expand All @@ -11,12 +12,13 @@ export function getQueryArgs() {
maxLon: 0,
}
const mapBounds = map.getBounds()

const northEast = mapBounds.getNorthEast()
const southWest = mapBounds.getSouthWest()
return {
minLat: +mapBounds._southWest.lat.toFixed(5),
maxLat: +mapBounds._northEast.lat.toFixed(5),
minLon: +mapBounds._southWest.lng.toFixed(5),
maxLon: +mapBounds._northEast.lng.toFixed(5),
minLat: +southWest.lat.toFixed(5),
maxLat: +northEast.lat.toFixed(5),
minLon: +southWest.lng.toFixed(5),
maxLon: +northEast.lng.toFixed(5),
zoom: Math.floor(map.getZoom()),
}
}

0 comments on commit 624d5b7

Please sign in to comment.