mapbox / mapbox/mapbox-maps-android
Unintentional jump may still occur even after left the follow viewport state
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Kotlin
- Estrellas
- 578
- Forks
- 161
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Observed behavior and steps to reproduce
Sometimes, the location puck will jump to the map center even I pan the map to leave the follow viewport state.
This can occur more easily, if you set the bearing of FollowPuckViewportStateOptions to a constant value, and test in indoor environment where there is no GPS signal available. When switched to the follow state, just after the location puck moved to the map center, pan the map to leave the follow state. The location puck may jump to the map center after a while.
Expected behavior
The location puck should not jump to the map center after left the follow viewport state.
Notes / preliminary analysis
It seems that FollowPuckViewportStateImpl.removeIndicatorListenerIfNeeded may not run successfully sometimes, as dataSourceUpdateObservers is not empty. This may occur as DefaultViewportTransitionImpl does not remove its observer immediately after the transition completed. Currently, it relies on FollowPuckViewportStateImpl to remove the observer on next notifyViewportStateDataObserver.
To solve the issue, may make the following change to DefaultViewportTransitionImpl:
var keepObserving = true
+ var observeCancelable: Cancelable? = null
completionListener.onComplete(!isCanceled)
+ observeCancelable?.cancel()
+ observeCancelable = cancelable
return Cancelable {
It seems that the iOS version has similar logic.
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Empieza rastreando FollowPuckViewportStateImpl.removeIndicatorListenerIfNeeded y DefaultViewportTransitionImpl, centrándote en dataSourceUpdateObservers y en el listener de finalización de la transición. Reproduce el escenario de estado de seguimiento, desplazamiento panorámico y sin GPS, y verifica que salir del estado de seguimiento impida cualquier salto posterior al centro del mapa; compara la lógica similar de iOS si resulta útil.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- kotlin
- Área
- mobile
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 42/100