Ticket #3363 (closed bug: fixed)

Opened 2 years ago

Last modified 16 months ago

Dragging over controls ends drag sequence

Reported by: ahocevar Owned by: ahocevar
Priority: minor Milestone: 2.12 Release
Component: Handler.Drag Version: 2.11 RC1
Keywords: Cc: xavier.mamano@…
State: Complete

Description

In OpenLayers 2.10, any drag operation (e.g. creating a zoombox and moving it over the PanZoom control) used to continue. Now it does not any more, because of the new eventsDiv.

This ticket suggests setting documentDrag to true by default on the Drag handler and all controls that use it. This does not only solve the issue, but makes map interaction more intuitive when working close to the viewport edges.

Attachments

openlayers-3363.patch Download (5.1 KB) - added by ahocevar 2 years ago.

Change History

Changed 2 years ago by ahocevar

  Changed 2 years ago by ahocevar

  • state set to Review

All tests pass in Safari5, examples work as expected. Thanks for any review.

  Changed 2 years ago by erilem

  • version changed from 2.10 to 2.11 RC1

I'd like to verify that setting documentDrag to true doesn't cause any performance issue on mobile.

follow-up: ↓ 4   Changed 2 years ago by jorix

  • cc xavier.mamano@… added

Sounds like a great idea, so I worked a bit again in OL doing some tests and patchs.

Some observations:

  • Default value in the documentation.
  • Maintaining the appearance of the cursor outside the map, see #3371 & #3372
  • Error JS in Handler.RegularPolygon, see #3373
  • It would be interesting to have documentDrag property in Handler.Box class.
  • Sometimes not detected "mouseout" (dragging vertices using Control.ModifyFeature). Try out the map to the top using http://openlayers.org/dev/examples/wfs-snap-split.html, fail enough times in this example ("erilem" and I saw something like using drawing handlers) Pending opening a ticket.

in reply to: ↑ 3   Changed 23 months ago by jorix

Replying to jorix:

... * Sometimes not detected "mouseout" ... Pending opening a ticket.

After further investigate this anomaly, it has opened the ticket #3399 that descrive this problem and provides a patch.

  Changed 23 months ago by ahocevar

  • state changed from Review to Needs More Work

With the mouseout issues described in #3399, it may not be wise to make documentDrag true by default. So this should be solved in a different way.

  Changed 23 months ago by ahocevar

  • keywords regression removed
  • priority changed from critical to minor
  • milestone changed from 2.11 Release to 2.12 Release

For now, it's best if people who want the pre-2.11 behavior of dragging over map overlays set documentDrag to true on the application level.

follow-up: ↓ 9   Changed 16 months ago by ahocevar

  • owner set to ahocevar
  • status changed from new to assigned

I'm currently working on a fix for this, which involves removing the eventsDiv and handling button events before all other events are handled.

  Changed 16 months ago by erilem

The eventsDiv was introduced during the mobile code sprint. I can't remember why exactly we introduced it, but we didn't have many options if I recall correctly. Tim might remember this better than me.

in reply to: ↑ 7   Changed 16 months ago by jorix

Replying to ahocevar:

I'm currently working on a fix for this, which involves removing the eventsDiv and handling button events before all other events are handled.

See #3091

I think it is possible to address the issue without touching the eventsDiv:

Setting documentDrag = true ran aground on #3399. I believe that can be addressed with another strategy: listen only document events after start a drag, so ignore the "mouseout" with problems (only when documentDrag = true).
I can try it in #3399 if you agree.

  Changed 16 months ago by ahocevar

  • state changed from Needs More Work to Review

  Changed 16 months ago by ahocevar

  • status changed from assigned to closed
  • state changed from Review to Complete
  • resolution set to fixed
Note: See TracTickets for help on using tickets.