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

Race condition in viewer.zoomTo #2680

Closed
mramato opened this issue May 1, 2015 · 0 comments · Fixed by #2775
Closed

Race condition in viewer.zoomTo #2680

mramato opened this issue May 1, 2015 · 0 comments · Fixed by #2775
Assignees

Comments

@mramato
Copy link
Contributor

mramato commented May 1, 2015

  1. Run one of the [Geometry examples](http://localhost:8080/Apps/Sandcastle/index.html?src=Circles and Ellipses.html&label=All)
  2. Add viewer.scene.morphTo2D(); to the bottom.

When you run the app, you'll get a crash because viewer.zoomTo ends up calling viewBoundingSphere during the morph. We need to detect that the morph is in process and wait for it to complete before zooming.

Here's the callstack.

DeveloperError: viewBoundingSphere is not supported while morphing.
Error
   at DeveloperError (http://localhost:8080/Source/Core/DeveloperError.js:43:13)
   at Camera.prototype.viewBoundingSphere (http://localhost:8080/Source/Scene/Camera.js:2372:13)
   at updateZoomTarget (http://localhost:8080/Source/Widgets/Viewer/Viewer.js:1584:13)
   at Viewer.prototype._postRender (http://localhost:8080/Source/Widgets/Viewer/Viewer.js:1546:9)
   at Event.prototype.raiseEvent (http://localhost:8080/Source/Core/Event.js:146:17)
   at render (http://localhost:8080/Source/Scene/Scene.js:1432:9)
   at Scene.prototype.render (http://localhost:8080/Source/Scene/Scene.js:1440:13)
   at CesiumWidget.prototype.render (http://localhost:8080/Source/Widgets/CesiumWidget/CesiumWidget.js:650:13)
   at render (http://localhost:8080/Source/Widgets/CesiumWidget/CesiumWidget.js:68:25)
@mramato mramato self-assigned this May 1, 2015
mramato added a commit that referenced this issue Jun 2, 2015
If viewer.zoomTo found itself in the middle of a morph it would crash. We
now wait for the morph to complete.  I couldn't think of a good unit for
this because it's a race condition, but there are instructions in the linked
issue on reproducing it in Sandcastle.  Fixes #2680
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant