-
Notifications
You must be signed in to change notification settings - Fork 283
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
Bug: Multiple image select with boxZoom #186
Comments
can i try this one? |
@shivam15 Yes please!! Let me know if you have any questions because I wrote the original code for it.. just couldn't get it to work properly! |
@rexagod also not the box select feature only works best if you drag from bottom-right towards top-left. Cannot explain exactly why this is but perhaps its been fixed when they updated the logic for flipping axis? |
For some reason, |
Okay so the "boxzoomend" is definitely not firing when it should, either that, or something else is triggering the |
Okay so the _onMouseUp: function (e) {
if ((e.which !== 1) && (e.button !== 1)) { return; }
this._finish();
if (!this._moved) { return; }
// Postpone to next JS tick so internal click event handling
// still see it as "moved".
this._clearDeferredResetState();
this._resetStateTimeout = setTimeout(bind(this._resetState, this), 0);
var bounds = new LatLngBounds(
this._map.containerPointToLatLng(this._startPoint),
this._map.containerPointToLatLng(this._point));
this._map
.fitBounds(bounds)
.fire('boxzoomend', {boxZoomBounds: bounds});
} Now I did try to Looking into this, @sashadev-sky. |
To further clarify on this, notice two different subroutines that occur.
|
@sashadev-sky I'm letting go of the above implementation and in fact considering some ideas that I'd like your thoughts on.
|
Woah amazing! I can't imagine ever needing "boxzoom" for its original purpose, to zoom into a specific area. Seems like a very inconvenient way to just increase zoom. So I manually fire I think whatever we do it should definitely |
It is possible to make |
@rexagod can you move these changes into a new feature BR and upload a PR so I can look into what we have now? |
so excited to get this one fixed!!! |
closing via #314 |
Currently to select multiple images, you can use
cmd + click
. There is another feature, found in the fileBoxSelectHandle.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.
Leaflet.DistortableImage/src/DistortableCollection.js
Line 16 in 88fe928
Actual behavior
![boxSelect](https://user-images.githubusercontent.com/41092741/55284379-6261c680-5343-11e9-967c-8ba4f94beab8.gif)
cmd + click
not regular click).Expected behavior
Relevant lines of code
BoxSelectHandle.js
file linked above overrides the default boxZoom handlerLeaflet.DistortableImage/src/DistortableCollection.js
Lines 64 to 78 in 88fe928
The text was updated successfully, but these errors were encountered: