How to abort drag operation in map panel?

Started by lbo, May 03, 2021, 10:29:07 AM

Previous topic - Next topic

lbo

Hi,

when I start dragging a location marker in the map panel, how can I abort the drag operation?

In other applications, I can hit ESC to stop the operation. Dropping the object to an illegal position works also.

Mario

Does undo not work?
What is an illegal position? Which map provider do you use?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

lbo

Undo might work, but it would be cleaner to be able to cancel the operation instead of reverting it afterwards.

An illegal position is for example outside the map panel window. Try a drag/drop operation in the Windows Explorer: Moving the cursor over a place where you can't drop the file results a prohibition sign (most times).

Mario

QuoteMoving the cursor over a place where you can't drop the file results a prohibition sign (most times).

This is how it should be, when I'm not mistaken. What happens when you drag a marker onto Windows Explorer? I have never tried this, because it makes not much sense.

Drag & Drop in the map panel is an operation handled by the app running and various between the map providers (which also provide the code to deal with the map).
Hence my questions above, which you did not answer yet.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

lbo

Quote from: Mario on May 03, 2021, 02:27:31 PM
This is how it should be, when I'm not mistaken. What happens when you drag a marker onto Windows Explorer? I have never tried this, because it makes not much sense.

Running IMatch usually in full screen mode, I didn't reach other windows. But I tried now: Dragging outside the IMatch window doesn't bring up the undo button in the map panel.

The map provider doesn't matter that much: Google starts to pan as soon as you drag the cursor out of the map panel. OSM/Bing etc. don't pan but if you release the mouse button, some location outside the map area shown is set. Neither of them accepts ESC or cancels the drag/drop operation when dropping outside the window.

As it seems to be not easy to get the "Windows behavior" in Chromium (?) and using external code, we shouldn't spend more time on this. Undo is viable.

I tried other browser based stuff and it also didn't cancel drag operations by a keystroke or by dropping outside the browser window.

Mario

QuoteDragging outside the IMatch window doesn't bring up the undo button in the map panel.

Because the marker remains unchanged.

All the drag marker stuff is pretty much handled by the OpenLayers code (which I use for Bing/HERE/OSM) or Google Code (Google Maps).
My code handles the "drag completed" in order to adjust the file coordinates when the user has moved the marker. Which also enables the Undo.

Not sure if I should spend time to learn how to intercept the drag handling of OpenLayers and Google to support ESC or other means to abort the drag.
If the map vendors think that this was something needed, they would have added it to their drag handling code, I'm sure.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

lbo

Quote from: Mario on May 03, 2021, 08:54:14 PM
QuoteDragging outside the IMatch window doesn't bring up the undo button in the map panel.
Because the marker remains unchanged.

no, the marker is changed even if dragged outside the IMatch window.

Nevertheless I was wrong: The undo button appears briefly, but disappears after a second (only when using the Google map). And this happens also if I drag the marker inside the map panel.

Quote from: Mario on May 03, 2021, 08:54:14 PM
All the drag marker stuff is pretty much handled by the OpenLayers code (which I use for Bing/HERE/OSM) or Google Code (Google Maps).
My code handles the "drag completed" in order to adjust the file coordinates when the user has moved the marker. Which also enables the Undo.

Not sure if I should spend time to learn how to intercept the drag handling of OpenLayers and Google to support ESC or other means to abort the drag.

I wouldn't do so.

But the vanishing undo button should be fixed.

Mario

I have fixed the vanishing update button for Google Maps.
This was only a problem with this button, the Undo itself (via the Edit menu in IMatch) works.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

lbo