encima / encima/jsc3d

Canvas or viewer loading complete?

Open
#111 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-migrated Priority-Medium Type-Defect
Dominant language
HTML
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Hi.
I want export image of canvas on new tab when replace scene complete. I write 
this:

viewer.replaceSceneFromUrl(url);
viewer.onloadingcomplete = function () {
   window.open(canvas.toDataURL());
};

It's open blank page. So I solve this:

viewer.replaceSceneFromUrl(url);
viewer.onloadingcomplete = function () {
  setTimeout(function(){
     window.open(canvas.toDataURL());
  },3000)
};

It's ok. But setTimeout is not a good choice. How to identify the view or 
canvas is loading complete, please?

Original issue reported on code.google.com by fabien...@gmail.com on 4 Sep 2014 at 8:33

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at viewer.replaceSceneFromUrl and the viewer.onloadingcomplete callback, then trace when the canvas is rendered relative to that callback. Reproduce the window.open(canvas.toDataURL()) example and verify that export works without a fixed delay; the issue names no file or test.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.