Repository navigation
fix(android): defer initial camera events until defaults apply - #4354
Closed
RobJacobson wants to merge 1 commit into
Closed
RobJacobson wants to merge 1 commit into
RobJacobson wants to merge 1 commit into
Conversation
- Hold startup camera notifications until attachment callbacks apply camera defaults - Coalesce startup changes and emit the resulting camera state once - Preserve later camera change events and valid [0, 0] centers
Contributor
Author
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On Android, the Mapbox camera-change listener can run before the
<Camera defaultSettings>attachment callbacks have applied the configured camera. During that startup window,onCameraChangedcan expose the SDK's temporary[0, 0]center.Hold camera-change notifications until attachment callbacks finish, then emit one change event pair for the resulting camera state. Subsequent camera changes continue through the normal event path.
Fixes #4213
Checklist
CONTRIBUTING.mdyarn generatein the root folder — N/A; this Android lifecycle fix changes no generated code or docs/exampleappScreenshot OR Video
N/A; the issue is about the values emitted during map startup.
Component to reproduce the issue you're fixing
Before/after reproduction evidence
center=[0,0]during startup, followed by the configured center. The issue reporter observes the zero center twice; this reproduction run observed it once.[-93.265, 44.9778]and no[0,0]event. Panning the map continued to emit updated camera centers.Validation evidence
example/build/**excluded. The unfiltered lint run reports oneno-undeferror forBufferin the generatedexample/build/circle-native-gate/server.cjs; it is unrelated to this change.