Leaflet.DistortableImage: Bug: Multiple image select with boxZoom

Currently to select multiple images, you can use cmd + click. There is another feature, found in the file BoxSelectHandle.js (https://github.com/publiclab/Leaflet.DistortableImage/blob/main/src/edit/BoxSelectHandle.js) that overrides Leaflet’s default boxZoom to allow for using shift + drag to select multiple images.

However, there is a bug with it so currently the event listener for this functionality is commented out. To test this bug uncomment this line. https://github.com/publiclab/Leaflet.DistortableImage/blob/88fe9281cb7c00cc90c4a52029bf2ca7763553de/src/DistortableCollection.js#L16

Actual behavior boxSelect

  • After click on the map to deselect, clicking an image in the same area as the previous boxSelect area reselects the images for multiple select (something that typically should only be triggered by cmd + click not regular click).

Expected behavior

  • By leaving an image out of the boxSelect area, I demonstrate the expected behavior (no reselections on regular click): boxSelect3

Relevant lines of code

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (17 by maintainers)

Most upvoted comments

To further clarify on this, notice two different subroutines that occur.

  • _addSelection gets executed on every single “mouseup” event
  • Reselection takes place respective to the sequence in which the images were selected (was bottom-left to top-right below), thus explaining “Cannot explain exactly why this is but perhaps its been fixed when they updated the logic for flipping axis?”

Peek 2019-04-28 14-14

@rexagod I fixed this in my pending PR #229 ! I noticed that too

can i try this one?

@jywarren the buggy behavior I was referring to in #158