Skip to content

Commit

Permalink
PB-1146: Zoom in on geolocation first activation
Browse files Browse the repository at this point in the history
Issue : When activating geolocation for the first time, we do not zoom on the location

Fix : We use the already existing boolean to check if we're on the geolocation first activation. If that's the case, we now zoom at zoom level 8
  • Loading branch information
ltkum committed Dec 10, 2024
1 parent 6b55ef1 commit e42cfa8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/store/plugins/geolocation-management.plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ function setCenterIfInBounds(store, center) {
center: center,
...dispatcher,
})

if (firstTimeActivatingGeolocation) {
firstTimeActivatingGeolocation = !firstTimeActivatingGeolocation
store.dispatch('setZoom', { zoom: 8, ...dispatcher })
}
}
} else {
log.warn(`current geolocation is out of bounds: ${JSON.stringify(center)}`)
Expand Down

0 comments on commit e42cfa8

Please sign in to comment.