Ticket #1325 (assigned feature)

Opened 5 years ago

Last modified 3 years ago

Tolerance and cancelling for the drag control

Reported by: sbenthall Owned by: sbenthall
Priority: critical Milestone: 2.13 Release
Component: Control.DragFeature Version: 2.5
Keywords: review Cc:
State: Needs More Work

Description

A useful feature for the DragFeature control would be a way to set a minimum amount of pixel-distance or time necessary for a drag to "count." We've gotten a lot of cases of accidentally drags, and this would provide a way for correcting for that.

Attachments

Panel.js.diff2 Download (0.7 KB) - added by sbenthall 5 years ago.
redrawing patch for Panel.js
Panel.js.2.diff Download (0.7 KB) - added by sbenthall 5 years ago.
redrawing patch for Panel.js
DragFeature.js.diff Download (5.6 KB) - added by sbenthall 5 years ago.
patch to DragFeature.js
1325.patch Download (8.8 KB) - added by arno 4 years ago.
updated patch

Change History

Changed 5 years ago by sbenthall

redrawing patch for Panel.js

Changed 5 years ago by sbenthall

redrawing patch for Panel.js

  Changed 5 years ago by sbenthall

I don't know what I've been doing with these patches. neither is relevant. Sorry

Changed 5 years ago by sbenthall

patch to DragFeature.js

  Changed 5 years ago by sbenthall

  • state set to Review
  • milestone set to 2.7 Release

The patch to DragFeature.js is actually relevant to this ticket.

I think that as written, the patch may be dependent on the solution to #1326 (patch already provided) in line 303, but this could be easily changed if that ticket/patch is rejected. (If, on the other hand, that ticket and patch are accepted into trunk, then the code of this class could be tightened up in a couple other places by using that Feature.Vector.move() method)

  Changed 5 years ago by tcoulter

As far as I know, we don't use the code in the above patch above anymore, and we're not likely to support it in the future (we'd be happy to answer questions, however). If you don't find anything interesting in the patch above, feel free to ignore it.

  Changed 5 years ago by tcoulter

Addendum: I'm referring specifically the the DragFeature.js patch, and not the patches regarding Panel.js.

  Changed 5 years ago by sbenthall

  • status changed from new to assigned

i should find someboyd to review this

  Changed 5 years ago by euzuro

  • priority changed from minor to critical

  Changed 5 years ago by sbenthall

The current patch depends on #1357 (y-ordering) and #1126 (feature specific moving)

  Changed 5 years ago by sbenthall

I'm not sure why upFeature was commented out in this patch. Need to look into it.

  Changed 5 years ago by crschmidt

  • state changed from Review to Needs More Work

sbenthall: Pushing this to 'needs more work' for now, when you upload a new patch, please feel free to push it back onto my plate and I'll look at it.

  Changed 5 years ago by sbenthall

Whoops. Doesn't depend on #1126. It depends on #1326, which is apparently closed.

  Changed 5 years ago by euzuro

  • milestone changed from 2.7 Release to 2.8 Release

lack of activity

follow-up: ↓ 13   Changed 4 years ago by crschmidt

  • milestone changed from 2.8 Release to 2.9 Release

Not touched since 2.7, moving forward.

Changed 4 years ago by arno

updated patch

in reply to: ↑ 12   Changed 4 years ago by arno

Hi, is that feature still wanted. If case it is, I've uploaded an updated patch.

I've removed dragOffset because it seemed to work fine without it. I also noticed two small bugs in previous patch doneDragging method:

if (passesTimeTolerance passesPixelTolerance){

which I replaced with

if(passesTimeTolerance && passesPixelTolerance){

and also

this.feature.geometry.move(res * (this.startPixel.x - pixel.x),

res * (pixel.y - this.startPixel.y));

draws feature in wrong position in case the mouse went out of the map. So, I replaced it with

this.feature.geometry.move(res * (this.startPixel.x - this.lastPixel.x),

res * (this.lastPixel.y - this.startPixel.y));

I've also updated tests/Control/DragFeature.html On an unrelated note, I noticed some tests of the suite fail with opera because the same is used over and over in the different functions of a tests. So, while I was working on the testsuite, I also called map.destroy() at the end of each function because I felt it could prevent problems in the future.

  Changed 4 years ago by arno

  • keywords review added

  Changed 3 years ago by bartvde

  • milestone changed from 2.9 Release to 2.10 Release
Note: See TracTickets for help on using tickets.