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

Cesium3DTileStyle.style is not reactive #7567

Closed
bkuster opened this issue Feb 13, 2019 · 1 comment · Fixed by #7573
Closed

Cesium3DTileStyle.style is not reactive #7567

bkuster opened this issue Feb 13, 2019 · 1 comment · Fixed by #7573

Comments

@bkuster
Copy link
Contributor

bkuster commented Feb 13, 2019

The Issue

If a Cesium3DTileStyle is created, its options are used to populate the readonly style property, which is described by the docs as follows:

Gets the object defining the style using the 3D Tiles Styling language.

This is not the case, since style.style is only evaluated at style creation. Thus the following fails, making cloning & persisting of styles tedious:

var style = new Cesium3DTileStyle({ show: true });
style.color = "rgb(125, 125, 125)";
var clone = new Cesium3DTileStyle(style.style);
expect(clone.color).to.equal(style.color);
// fails: expected undefined to equal "rgba(125, 125, 125)"

Proposed Solution

When setting an expression on the style, the getExpression function not only receives this.style and value but also key. The key is then set on this.style to reflect the current value. You can see an implementation of this solution here, I would gladly open a PR for this.

@hpinkos
Copy link
Contributor

hpinkos commented Feb 14, 2019

@bkuster I can't see any reason for not updating _style as the properties change. Please open that PR and we'd be happy to review it =) Thanks!

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.

2 participants