-
Notifications
You must be signed in to change notification settings - Fork 140
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
[Annotation] Automatically add layer and source while changing style. #29
Conversation
Chaoba
commented
Jan 25, 2021
•
edited
Loading
edited
e4fe952
to
20b0f74
Compare
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.
Can we back this feature up with a test?
what happens if I perform continuous updates to an annotation and switch style? Does it crash? are updates ignored until style has finished loading again? |
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.
Thank you for adding a unit test for the basic code path but we additionally need a test to cover my question above:
what happens if I perform continuous updates to an annotation and switch style? Does it crash? are updates ignored until style has finished loading again?
/** | ||
* Useful utilities used throughout the testapp. | ||
*/ | ||
object Utils { |
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.
nit: using an object in this context means that every time you open any of the annotation examples. It will have a different style. Code should be deterministic, which results in that every action should result in same result.
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.
, ticket out any tailwork
@@ -94,6 +95,12 @@ abstract class AnnotationManagerImpl<G : Geometry, T : Annotation<G>, S : Annota | |||
gesturesPlugin.addOnMapClickListener(mapClickResolver) | |||
gesturesPlugin.addOnMapLongClickListener(mapLongClickResolver) | |||
gesturesPlugin.addOnMoveListener(mapMoveResolver) | |||
delegateProvider.mapListenerDelegate.addOnDidFinishRenderingMapListener { |
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.
@Chaoba Instead of OnDidFinishRenderingMapListener, we could use MapStyleObserverPlugin on the AnnotationPlugin, and propagate the style changed event to the underlying annotation managers to re-add the layers/sources.
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.
ticketed at #146