-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Less API indirection? #2183
Comments
I think the better approach would be to just expose ES5 properties on Viewer that call through to the underlying scene. We could only do this for the most common properties to keep the api clean. We actually were doing this at one point but someone asked they be removed to avoid having the property in two places. (I think it was you 😛) I'm not sure combining them magically is the correct way to go. If we really wanted to do that, then I would make scene an implementation detail and only expose selected properties through Viewer. I'm also not sure how big of a deal this is since when I wrote code I would just do add Technically CesiumWidget has this problem too, so we would have to decide if we want similar changes there or we could just treat it as "lower-level" and have it expose scene like it does now. |
I think this would be fine for Viewer and CesiumWidget.
I would not be surprised.
I agree it is not a problem for non-novice users, but our API requires touching too many objects to do simple things compared to similar APIs so if we can do very trivial things to improve this, I think it is a win. |
If we just created
viewer
, we need to go quite deep to access things:viewer
represents the container and UI, andscene
represents the 3D scene - this is exactly what we want inside Cesium, but externally, there is a lot of indirection.How crazy is it to combine
scene
andviewer
into one object perhaps with some JavaScript magic so thatviewer
gets all thescene
properties. Perhaps we would even renameviewer
toscene
.I'm not married to the idea, just asking.
CC #2114
The text was updated successfully, but these errors were encountered: