Skip to content
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

Merged
merged 3 commits into from
Jan 26, 2021

Conversation

Chaoba
Copy link
Contributor

@Chaoba Chaoba commented Jan 25, 2021

QQ20210125-205122

@Chaoba Chaoba force-pushed the kl-annotation-change-style branch from e4fe952 to 20b0f74 Compare January 25, 2021 03:03
@Chaoba Chaoba requested a review from a team January 25, 2021 03:08
@Chaoba Chaoba self-assigned this Jan 25, 2021
Copy link
Member

@tobrun tobrun left a 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?

@tobrun
Copy link
Member

tobrun commented Jan 25, 2021

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?

@Chaoba Chaoba requested a review from tobrun January 25, 2021 12:52
Copy link
Member

@tobrun tobrun left a 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 {
Copy link
Member

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.

Copy link
Member

@tobrun tobrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: , ticket out any tailwork

@Chaoba Chaoba merged commit be1bbbe into kl-annotation-layer Jan 26, 2021
@Chaoba Chaoba deleted the kl-annotation-change-style branch January 26, 2021 07:27
@@ -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 {
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ticketed at #146

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants