Skip to content

Conversation

okwme
Copy link
Contributor

@okwme okwme commented Mar 14, 2016

bring element to front on hover in case a transform requires it to move on top of another element like with scale or translate. otherwise countries were getting covered up by their neighbors.

@Indigo744
Copy link
Collaborator

Thanks for the PR.

However, what if a user don't want this behavior?
Let's say this user used the afterInit callback to draw something on top of its paper.
Your modification will always show anything on top of it.

Hence, I don't think Mapael should force its way like this.

A solution to implement this behavior at a user level would be to simply implement specific onMouseOver and onMouseOut in eventHandlers.

I know that this explanation can be valid from the other perspective (if the user wants to put its drawing on top of it, it could use some eventHandlers to always bring them to front). But this is how Mapael has always work until then. This is why I feel reluctant to change this behavior.

@neveldo, what do you think?

@neveldo
Copy link
Owner

neveldo commented Mar 15, 2016

Hello,

I agree with @Indigo744 , I think that this issue can't be resolved simply by adding a call to toFront() method because it will lead to several side effects. As @Indigo744 , if a map contains some plotted cities for instance, when a user move the cursor over an area behind a city, it will hide the city, we will get the same side effect with the custom objects drawn in the afterInit() hook.

At the moment, I don't have a better choice than using eventHandlers in order to call the tonFront() method when it's needed as @Indigo744 said.

@Indigo744
Copy link
Collaborator

@billyrennekamp, thanks for your contribution but we will reject it.

@Indigo744 Indigo744 closed this Mar 16, 2016
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