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

Fixed annotation dragging behavior #25

Merged
merged 1 commit into from
May 5, 2023

Conversation

RomanBapst
Copy link
Contributor

Problem encountered without this change
Updating the position of any annotation on the map would cause dragging of another annotation to be stopped. We encountered this issue when trying to implement a polygon with draggable vertices.

Solution
Only stop the drag if the updated annotation is also the dragged annotation.

…state update

- the drag event of an annotation was stopped when there was a state update
of any annotion. This made it impossible to drag an annotation while updating
anything else on the map.

Signed-off-by: Roman Bapst <bapstroman@gmail.com>
@ovivoda
Copy link

ovivoda commented May 5, 2023

For me it makes sense to separate the two.

@JonasVautherin
Copy link
Collaborator

Are the unit tests expected to pass? 😅

@ovivoda
Copy link

ovivoda commented May 5, 2023

Are the unit tests expected to pass? 😅

At some point :)

@ovivoda ovivoda merged commit f2eb0f0 into maplibre:main May 5, 2023
1 check failed
@JonasVautherin
Copy link
Collaborator

Oh, merged already! May I ask how it works with releases? Should we expect those changes to be pushed to a maven repository at some point? 😇

@JonasVautherin
Copy link
Collaborator

JonasVautherin commented May 15, 2023

May I ask how it works with releases? Should we expect those changes to be pushed to a maven repository at some point?

@ovivoda: kindly pinging here? 🙂

@@ -136,7 +136,7 @@ public T create(S options) {
T t = options.build(currentId, this);
annotations.put(t.getId(), t);
currentId++;
updateSource();
internalUpdateSource();
Copy link
Collaborator

Choose a reason for hiding this comment

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

@RomanBapst What is the reason you changed updateSource() to internalUpdateSource() here? It undoes the improvements from #12.

Copy link
Collaborator

Choose a reason for hiding this comment

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

the drag event of an annotation was stopped when there was a state update
of any annotion. This made it impossible to drag an annotation while updating
anything else on the map.

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.

None yet

4 participants