Skip to content

Commit

Permalink
Merge pull request #1166 from geoadmin/fix-PB-1146-zoom-on-location-g…
Browse files Browse the repository at this point in the history
…eolocation

PB-1146: Zoom in on geolocation first activation
  • Loading branch information
ltkum authored Dec 10, 2024
2 parents 57f8d50 + 4a3d9fa commit f5d10b6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 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,14 @@ function setCenterIfInBounds(store, center) {
center: center,
...dispatcher,
})

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

0 comments on commit f5d10b6

Please sign in to comment.