-
Notifications
You must be signed in to change notification settings - Fork 117
Remove and readd onMapChange in onStart/onStop #403
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
| if (mapboxMap != null) { | ||
| mapboxMap.removeOnCameraMoveListener(onCameraMoveListener); | ||
| } | ||
| mapView.removeOnMapChangedListener(onMapChangedListener); |
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.
Won't this one unregister the listener during style switch resulting in disabling the location layer? See
Lines 632 to 641 in 86a6708
| public void onMapChanged(int change) { | |
| if (change == MapView.WILL_START_LOADING_MAP) { | |
| onStop(); | |
| } else if (change == MapView.DID_FINISH_LOADING_STYLE) { | |
| locationLayer.initializeComponents(options); | |
| locationLayerCamera.initializeOptions(options); | |
| setRenderMode(locationLayer.getRenderMode()); | |
| onStart(); | |
| } | |
| } |
|
I've added separate |
| } else if (change == MapView.DID_FINISH_LOADING_STYLE) { | ||
| locationLayer.initializeComponents(options); | ||
| locationLayerCamera.initializeOptions(options); | ||
| setRenderMode(locationLayer.getRenderMode()); |
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.
If the plugin is disabled and we change the style this line will draw the puck in the last location even though the plugin is disabled. Could you address it in this PR as well?
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.
Yes, want to make this clear that this is a bug that is in master though, not something I introduced in this PR...
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.
After looking into this, I'm not finding a solution to this fix. Will open a ticket and revisit in a separate PR.
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.
Closes #363
When the location layer plugin's disabled, we remove the onMapChange listener.