-
Notifications
You must be signed in to change notification settings - Fork 154
Fix getStyle returns null after adding a source #643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| internal var isStyleLoadInitiated = false | ||
| private val styleObserver = StyleObserver(this, nativeMapWeakRef, nativeObserver, pixelRatio) | ||
| internal var renderHandler: Handler? = null | ||
| internal var styleLoaded = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should it be with private setter?
because in Java internal converted into public
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need set it in test cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe use annotation VisibleForTesting ?
|
@Chaoba please link an issue that gets fixed by this PR. |
|
Could be related to #614 as well |
|
@Chaoba could you build a snapshot using this branch? |
publish_android_snapshot
1b02b3d to
0796351
Compare
This was already confirmed in the annotation related ticket that it's expected to return false when something new is loading. This is conform to gl-js implemenation. For our own internal style logic, we need to roll our own setup as proposed here. |
PRs must be submitted under the terms of our Contributor License Agreement CLA.
Fixes: #634
Fixes: #583
Pull request checklist:
mapbox-maps-androidchangelog:<changelog>Fix getStyle returns null after adding a source</changelog>.Summary of changes
onStyleLoadedwill only be triggered once for one style, so if users add a new source to style after style loaded,onStyleLoadedwill never be invoked. And during the loading time for this new source,getStylewill return null becausestyle.isStyleLoadedwill be false.This pr add a property
styleLoadedto record wheter the style is loaded or not no matter how many sources or layers are added after style loaded.User impact (optional)