-
Notifications
You must be signed in to change notification settings - Fork 1
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
Boxselector move box is breaking pointselector when clicked inside the box. #3
Comments
…icks inside of the box and also allowing the box move functionality at the same time.
What is happening in this one is that the boxselector mouseDown is canceling event propagation at the end of mouseDown if they clicked inside the box. This causes pointselector mouseDown to not get called and therefore not setup pointselector functionality (setting up mouseUp handler and saving mouseDownPoint). But, if we don't cancel event propagation at the end of boxselector mouseDown, then the map move (mm.DragHandler) functionality gets setup in it's mouseDown. Later, when the box is dragged, the map is also dragged. But, we only want the box to be dragged! This is happening even though boxselector mouseMove is canceling event propagation. Yet, mm.DragHandler mouseMove is still being called. Don't know why this event propagation cancel is not working. The only difference that I see is that the mouseMove event handlers are on the document rather than on the map.parent or boxDiv. I wonder what would happen if we move mouse move to be on map.parent and boxDiv and just leave mouseUp to be on document? Seems like there is not much value in moving beyond the element of interest. |
In the meantime, I have created a bit of a hack (marked "HACK1" in the code) that seems to work around this problem. But, I'd like to figure out a more appropriate fix. |
When I click inside of a box (to set center in tilemill for example), the new boxselector functionality that lets me drag the box around is breaking the pointselector functionality.
The text was updated successfully, but these errors were encountered: