Skip to content

Commit

Permalink
merged map.fire call moved to bottom of setFullscreenState scope …
Browse files Browse the repository at this point in the history
…from `fullscreenMap` scope
  • Loading branch information
Stassi committed Nov 13, 2024
1 parent e2e95e7 commit 8647e28
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions public/script/leaflet-fullscreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ function setFullscreenState(map, newState, getFullscreen, setFullscreen) {
else DomUtil.removeClass(container, 'leaflet-fullscreen-on')

map.invalidateSize()
map.fire('fullscreenchange')
}

export function fullscreenMap({
Expand Down Expand Up @@ -115,11 +116,9 @@ export function fullscreenMap({
) {
if (!getFullscreen()) {
setFullscreenState(map, true, getFullscreen, setFullscreen)
map.fire('fullscreenchange')
}
} else if (getFullscreen()) {
setFullscreenState(map, false, getFullscreen, setFullscreen)
map.fire('fullscreenchange')
}
}

Expand Down

0 comments on commit 8647e28

Please sign in to comment.