Hi,
In order to add points to positions where user clicks, I need to know if currently mousing over terrain or not so I can use viewer.scene.pickPosition
or viewer.camera.pickEllipsoid,
because points will show wrongly if the right method is not used:
Is there any way to know this so I can conditionally use one or the other?
Any terrain provider you add in CesiumJS is considered global. So all you’d need to do is keep track of whether or not you’ve added terrain to your scene, right?
I’ve created a sandcastle for you to check my code here;
All you need to do is click on the globe and add points. They look great, right?
Now, click on the basemap selector and scroll to bottom, change the terrain option from ‘wgs84 ellipsoid’ to ‘cesium world terrain’, as in picture:
Now, the points look half cut. How can I make sure they always look good, on ANY map mode?