cesiumBug.rar (3.5 MB)
please have a look at the video I provided. As video file endings are not allowed to be uploaded I put it into a rar file. You see the sandbox code and the resulting behaviour.
I place a label and set scaleByDistance: new Cesium.NearFarScalar(3000.0, 1.0, 10000.0, 0.2)
when I pan back and forth at probably the 3000 mark, there is a sudden change where I expect a smoth transition. Is that a bug?
Welcome to the community and thank you for your question!
Can you please share this video via an online video platform (YouTube, Vimeo, etc.)? For security reasons, I would prefer to not download this file directly onto my computer.
Thank you for sending over the video. I just watched the video that you shared and read through our NearFarScale documentation. To the best of my knowledge, this is not a bug. I believe that the sudden change that you are witnessing is due to the large discrepancy between the nearValue and the farValue parameters.
Well if that is the case then this does not meet the description of scaleByDistance Label - Cesium Documentation parameter as I read it.
What I expected in this example would be a scale of 1 for a distance of 3’000 and less to the label, which will then fall down in a linear fashion to a scale of 0.2 at a distance of 10’000, and then level out at 0.2 for any larger distance.
I actually do assume this was the intention of that parameter, I may stand corrected?
You bring up another good point. The documentation states that “a label’s scale will interpolate between the NearFarScalar#nearValue and NearFarScalar#farValue.” It is unclear what interpolation algorithm we are using behind the scenes. Are you seeing the same issues when you use different values for nearValue and farValue? In the meantime, I am going to take a look at our source code and try to learn more about our interpolation algorithm.
That is the very issue, I can run the sandcastle example given in that original post on 19 Sep 2019, and when I zoom in and out I see the same unexpected jump in size I experienced
Great! I am glad that we were able to find an issue on GitHub that outlines the problem that you are facing. To the best of my knowledge, we do not have a timeline for resolving this bug. However, if you submit a pull request, we would be happy to review it as soon as possible.