Skip to content

Commit 0cc78ef

Browse files
committed
PB-2068: Hide RecenterButton when tracking is active
1 parent 8a429f1 commit 0cc78ef

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

packages/viewer/src/modules/map/components/toolbox/RecenterButton.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@ const geolocationStore = useGeolocationStore()
1414
const positionStore = usePositionStore()
1515
const { t } = useI18n()
1616
17-
// Show recenter button when geolocation is active
17+
// Show recenter button when geolocation is active but not tracking
1818
const showRecenterButton = computed(() => {
19-
return geolocationStore.active && geolocationStore.position !== undefined
19+
return geolocationStore.active && geolocationStore.position !== undefined && !geolocationStore.tracking
2020
})
2121
22-
// Show tooltip based on tracking state
23-
const tooltipContent = computed(() => {
24-
return geolocationStore.tracking ? 'geoloc_stop_tracking' : 're_center_map'
25-
})
22+
// Tooltip always shows "re-center map" since button is hidden when tracking
23+
const tooltipContent = 're_center_map'
2624
2725
function toggleTracking(): void {
2826
// Toggle tracking mode
@@ -52,7 +50,6 @@ function toggleTracking(): void {
5250
class="toolbox-button d-print-none"
5351
data-cy="recenter-button"
5452
type="button"
55-
:class="{ active: geolocationStore.tracking }"
5653
@click="toggleTracking"
5754
>
5855
<FontAwesomeIcon

0 commit comments

Comments
 (0)