@@ -5,7 +5,7 @@ import type { ActionDispatcher } from '@/store/types'
55
66import handleGeolocationError from '@/store/modules/geolocation/utils/handleGeolocationError'
77import handleNewGeolocationPosition from '@/store/modules/geolocation/utils/handleNewGeolocationPosition'
8- import setCenterIfInBounds from '@/store/modules/geolocation/utils/setCenterIfInBounds'
8+ import setCenterIfInBounds , { resetFirstTime } from '@/store/modules/geolocation/utils/setCenterIfInBounds'
99
1010interface GeolocationActivationOptions {
1111 /**
@@ -35,6 +35,7 @@ export default function setGeolocationActive(
3535 optionsOrDispatcher : GeolocationActivationOptions | ActionDispatcher ,
3636 dispatcherOrNothing ?: ActionDispatcher
3737) : void {
38+ console . log ( '[setGeolocationActive] Called with active:' , active )
3839 this . active = active
3940
4041 const dispatcher = dispatcherOrNothing ?? ( optionsOrDispatcher as ActionDispatcher )
@@ -44,11 +45,13 @@ export default function setGeolocationActive(
4445 this . errorCount = 0 // reset the error counter when starting the geolocation
4546
4647 const { usePreviousPosition = true } = options
47-
48+ console . log ( '[setGeolocationActive] usePreviousPosition:' , usePreviousPosition )
49+ console . log ( '[setGeolocationActive] this.position:' , this . position )
4850 if ( usePreviousPosition && this . position ) {
4951 // if we have a previous position, use it first to be more reactive but set
5052 // bad accuracy as we don't know how exact it is.
51- if ( this . tracking ) {
53+ console . log ( '[setGeolocationActive] tracking is' , this . tracking )
54+ if ( this . tracking === false ) {
5255 // only center if tracking (e.g., in 3D mode we don't center)
5356 setCenterIfInBounds . call ( this , this . position , dispatcher )
5457 }
@@ -60,6 +63,7 @@ export default function setGeolocationActive(
6063 }
6164 navigator . geolocation . getCurrentPosition (
6265 ( position ) => {
66+ console . log ( '[setGeolocationActive] Current position:' , position )
6367 log . debug ( {
6468 title : 'Geolocation store / setGeolocationActive' ,
6569 titleColor : LogPreDefinedColor . Amber ,
0 commit comments