Sandcastle: Cesium & viewer vars

You don’t seem to need window.Cesium as it appears to be already accessible via
document.getElementById(“bucketFrame”).contentWindow.Cesium

However you seemed to have solved the problem of getting access to viewer with ‘window.viewer=viewer’ from within the textbox code!

Without 'window.viewer=viewer (from top page, not iframe)
document.getElementById(“bucketFrame”).contentWindow.viewer
fails, undefined

With 'window.viewer=viewer (from top page, not iframe)
document.getElementById(“bucketFrame”).contentWindow.viewer
works!

I’m gonna see if I can finally get my plugin to work in remote sandcastle instances with these new discoveries.

EDIT: making progress, I’ve got portions of my plugin working in a remote sandcastle.
EDIT2: shazam, working totally, I just copy/paste a few lines of code and I can use my plugin in any remote sandcastle. Thanks for the tip of window.viewer=viewer, that was key!

1 Like