Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function roundIfNumber(v: unknown, d: number): string {
}

function disableTrackingAndAutoRotation(): void {
if (isTracking.value) {
if (isTracking.value && geolocationStore.position && geolocationStore.position !== positionStore.center) {
// When the map has been dragged we disabled geolocation tracking to avoid to re-center the
// map when the user want to have something else in the center. Also disabled the auto rotation
// because auto rotation rotate the map using the position as center and it doesn't make sense
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,10 @@ export default function setCenter(

const geolocationStore = useGeolocationStore()

// TODO: fix this, it stops the tracking when receiving the first geolocation position update
if (geolocationStore.tracking && geolocationStore.position !== center) {
// if we moved the map we disabled the geolocation tracking (unless the tracking moved the map)
if (geolocationStore.tracking && geolocationStore.position && geolocationStore.position !== this.center) {
geolocationStore.setGeolocationTracking(false, dispatcher)
this.setAutoRotation(false, dispatcher)
}

const cesiumStore = useCesiumStore()
if (cesiumStore.active && this.camera) {
// updating the 3D position with the new center values (from a search result selection, for example)
Expand Down
Loading