-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Calling setStyle doesn't clear previously set root properties. #11939
Comments
Likely related to #11916 |
In addition, when setting "exaggeration" in style b, it overwrites the "exaggeration" value in style a. See codepen (click map to toggle styles): https://codepen.io/avpeery/pen/OJQzmrG |
@avpeery yeah, I think this is the case for all root properties. If the next style doesn't contain a previously set property, it's not discarded. My expectation is that the default value would be used if the property is no longer present. If |
@tristen The codepen example has exaggeration set in both style a and style b. If you click the map in the code pen example from style a to style b to style a again, style a’s exaggeration is overwritten to be style b’s exaggeration. I feel like this should not be expected behavior? I opened a PR that prevents overwriting stylesheet properties (and includes setting the default value for the style terrain exaggeration if not present). |
Ah! I missed that in the example you shared. Not expected no 😛 |
@avpeery can we mark this as a release blocker to v2.9.0? |
@tristen Discussed this with @karimnaaji and since this has been in a couple of the past releases we were planning on not releasing it with 2.9.0 and waiting for the next beta. Is this very high priority for you? cc: @karimnaaji |
I would consider this a high priority. With globe support in Studio adding broader editing capabilities to root properties than before (like authoring expressions and clearing values) it amplifies this older issue. |
Thanks for the feedback @tristen , we'll wrap this one up and include it! The fix is almost ready, we just need to make sure to carefully profile it as it can have a performance impact. |
In this example, I have two stylesheets with terrain properties that look like this:
Calling setStyle to replace version A with version B results in a situation where
exaggeration
is still set to500
and not the default value of1
Demo to reproduce: https://jsfiddle.net/tristen/ucpynakb/
Version: Latest stable
v2.8.2
The text was updated successfully, but these errors were encountered: