Skip to content

Commit

Permalink
replaced former bbox settings with leaflet
Browse files Browse the repository at this point in the history
  • Loading branch information
p3t3r67x0 committed Dec 2, 2024
1 parent 4174769 commit f18ca02
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,10 +309,12 @@ async function renderEnergyUnits(mapReference, municipalityKey) {


function moveToBoundingBox(mapReference, bbox) {
const bounds = [
[bbox['ymin'], bbox['xmin']],
[bbox['ymax'], bbox['xmax']]
]
const { xmin, ymin, xmax, ymax } = bbox

const bounds = L.latLngBounds(
[ymin, xmin],
[ymax, xmax]
)

mapReference.fitBounds(bounds)
}
Expand Down

0 comments on commit f18ca02

Please sign in to comment.