Ticket #1348 (closed feature: fixed)

Opened 5 years ago

Last modified 5 years ago

Animated pan calls moveTo with wrong parameters

Reported by: openlayers Owned by:
Priority: major Milestone: 2.6 Release
Component: general Version: SVN
Keywords: Cc:
State: Complete

Description

The tween in introduced in [6111] seems to call moveTo of OpenLayers.Map with this.moveTo(lonlat, this.zoom, true);. This causes the moveend event to be triggered in each step of the animation.

To prevent this the call of moveTo should be changed to something similar to this.moveTo(lonlat, this.zoom, {'dragging':true, 'noEvent':true});.

Attachments

animated_pan_drags.patch Download (0.8 KB) - added by openlayers 5 years ago.
pan_drag.patch Download (1.0 KB) - added by crschmidt 5 years ago.
1348-r6196-A0.diff Download (1.0 KB) - added by pgiraud 5 years ago.

Change History

Changed 5 years ago by openlayers

Changed 5 years ago by crschmidt

Changed 5 years ago by crschmidt

  • keywords review removed
  • state set to Review

Previous patch doesn't go quite far enough: try panning on a layer with a vector feature drawn across the edge, and you'll see that it doesn't redraw at the end. Instead of triggering the events ourselves, we should just call a 'standard' moveTo, so that it passes through to the moveTo of the layers with dragging not set to true so that they redraw themselves.

Changed 5 years ago by crschmidt

  • milestone set to 2.6 Release

Changed 5 years ago by pgiraud

Hum, I would agree with your patch but there's still something that doesn't sound good to me. Correct me if I'm wrong (I didn't test it) but it seems like the way you wrote the 'done' callback, 'movestart' will be triggered twice.

Changed 5 years ago by crschmidt

You're probably right. I guess we could use moveTo with noEvent set to true, and then just trigger the moveend event?

Changed 5 years ago by pgiraud

This sounds really better. And this matches the first way I wanted this code to be written and the reason why I wanted the Eric's noEvent parameter to go in. I'll check that tomorrow morning.

Changed 5 years ago by pgiraud

Changed 5 years ago by pgiraud

1348-r6196-A0.diff includes my last comments This worked for me in an example registering the movestart, move and moveend events.

Changed 5 years ago by crschmidt

  • state changed from Review to Commit

I can confirm that this works for the use cases I can think of. Thanks for the patch, please commit.

Changed 5 years ago by pgiraud

  • status changed from new to closed
  • state changed from Commit to Complete
  • resolution set to fixed

(In [6203]) It looked like movestart, move and moveend events weren't triggered in a good way while using panTo (with panTween effect), this is fixed by calling moveTo with 'dragging' and 'noEvent' options, and trigering 'moveend' internaly, r=crschmidt (Closes #1348)

Note: See TracTickets for help on using tickets.