-
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
Dynamic Distance Display Condition Not Working #4714
Comments
Hello Cesium team! It would be super if you all were able to work this for the December 2015 code sprint!. Thanks for all your hard work and enjoy the Poconos! I'm throwing this comment in here per the S.O.P. in https://groups.google.com/forum/#!topic/cesium-dev/zkekUUpM0u8. |
Thanks for all of the information and screen shots @billwritescode! I'm not sure if we'll have a chance to look at this at the code sprint, but if not we'll try to put in some time shortly after. We have a few other open bug reports related to distance display conditions |
Thanks for the reply @hpinkos! Looking forward to it. |
CC #4696 |
This happens because the distance for polygons is the distance to it's bounding sphere. The other option was to use the distance to the center of the polygon, but there are different ways to pick a center and the position of the point/label could still be different. I could add an optional position property to a distance display condition so it could be the same as the point/label and fall back to the bounding sphere. |
@bagnell sounds like a good approach. |
It seems like you could test that by dynamically making the distance display condition's far property set to a really low value (say, 1). That would make the distance display condition always (except in the case where you are zoomed in really close) exclude the polygon, because the distance calculated to the bounding sphere, it is likely greater than 1. In that case, I would expect the polygon not to be displayed. This sandcastle does that, but the polygon still appears: http://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=b64af30b9c8f3f8f868c3a59cb276a68 https://lh3.googleusercontent.com/-_a-pIEkXQHg/WD2yeQRbiQI/AAAAAAAABAc/63rLOYTD2zkoyH_UpisbPKqyV2DsTHxtQCLcB/s1600/persisting_polygons_ddc_2.gif In that example, you have to first pan the map away from California and the entities, pan back, and then zoom out a couple of times in order to get the issue to appear. Is something else going on? |
So, since December, there have been some updates to how Cesium displays labels, so the above sandcastle doesn't show the cluster labels anymore on Cesium 1.32. @pjcozzi @bagnell, just bumping this thread -- any thoughts on the above comments? |
@billwritescode I've been looking at your latest code example. I think there are multiple issues. I still stand by my first comment. To get the correct distance for the 'TOO FAR' value you need to take the bounding sphere into account. The distance should be If I simplify your second example, everything starts to work fine, which makes me think there is more that one issue. I'm still looking into it. |
Congratulations on closing the issue! I found these Cesium forum links in the comments above: https://groups.google.com/forum/#!topic/cesium-dev/N7vPMwXtiGg If this issue affects any of these threads, please post a comment like the following:
I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
@billwritescode I believe I fixed this in #6835. The fix will be included in the Cesium 1.48 release available on August 1st. If you still see this problem in 1.48 feel free to reopen this issue. Thanks! |
Reported on the forum: https://groups.google.com/forum/#!topic/cesium-dev/N7vPMwXtiGg and https://groups.google.com/forum/#!topic/cesium-dev/zSXhiqaPt8k
Dynamic distance display conditions have a bug where the polygon is displayed even though the distance between it and the camera is greater than the distance display condition.
This is easier to reproduce when the camera is moved so that the entities are out of view. This is done upon initial load of the sandcastle.
Clicking on an entity will display (TOO FAR) if the polygon should not be visible by the distance display condition. This is only a problem in the case where the polygon is also displayed. The below screenshot is an example of a false positive by this (TOO FAR) test. Note how (TOO FAR) is displayed in the entity's description, but the polygon for Missouri is not visible on the map. In this case, it is safe to ignore the (TOO FAR) test.
It is the other cases that are troubling. If the (TOO FAR) test is coming up as (TOO FAR) when the polygon is displayed, Houston, we have a problem.
This is reproducible in the below sandcastle without too much trouble by slightly adjusting the zoom and camera position via the mouse after the camera movements have finished.
Sandcastle: http://cesiumjs.org/Cesium/Apps/Sandcastle/?src=Hello%20World.html&label=Showcases&gist=59039e5c204b9fe673d1cbf1c4f2cc83
The below screenshot demonstrates the issue in Internet Explorer:
The below screenshot demonstrates the issue in Firefox:
In the below case, the (TOO FAR) test was not applied. However, the fact that the polygon and label for Kansas are both present at the same time raises suspicions. The fact that both the polygon and label for Texas are visible on the map is similarly suspicious.
The source for the (TOO FAR) test:
The source for the camera zooms:
The code for the dynamic distance display condition, credit (and thanks!) to @bagnell in #4403 (comment):
The text was updated successfully, but these errors were encountered: