Skip to content
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

Control StartMove #943

Closed
romulYurch opened this issue Apr 20, 2023 · 2 comments
Closed

Control StartMove #943

romulYurch opened this issue Apr 20, 2023 · 2 comments
Labels
Milestone

Comments

@romulYurch
Copy link

Describe the feature

I'm using v4 now, but as i see my issue works the same in v5.
So when you clicking on marker and using viewer.animate to point the camera to the marker - you expect that nothing will break this animation and viewer.animate.then will work to set new panorama by using viewer.setPanorama.
But if you click in any point of the viewer during animation, it stopped, because StartMove fires and it tries to start new rotation of the viewer.
It`ll be great if you give ability to control StartMove method with some property.

Alternatives you've considered

For my goals, i had to create new global variable ignoreMoving and set it true before animate() and set it false when .then() fired. And i changed method __startMove() in library by adding return if ignoreMoving eq true.

.... ignoreMoving = true;
this.viewer.animate({
longitude: clickedMarkerData.longitude,
latitude: clickedMarkerData.latitude,
zoom: 100,
speed: '-5rpm',
}).then( () =>
{
ignoreMoving = false;
this.viewer.setPanorama(image.path, {
zoom: 0,
transition: false,
longitude: pov.longitude,
latitude: pov.latitude,
}).then( () => {
this.drawMarkers();
if(then)
then(image);
});
});
....

_proto.__startMove = function __startMove(evt) {
var _this5 = this;
if(ignoreMoving)
return;
.....

Additional context

No response

@mistic100
Copy link
Owner

You can disable "mousemove" before starting the animation

  viewer.setOption('mousemove', false);
  viewer.animate({
      yaw: .....,
      pitch: ......,
  })
  .then(() => {
      viewer.setOption('mousemove', true);
  });

Currently, click+drag will still cancel the animation but I will fix that.

@mistic100 mistic100 added this to the 5.1.5 milestone Apr 23, 2023
@github-actions
Copy link

This feature/bug fix has been released in version 5.1.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants