My map has a list of coordinates represented by points in the map.
I’ve got a circular element that is placed on top of cesium, that is always centred.
I’d like to find which points are inside the circular area, so that after I can find which one
is in the closest distance to the centre point of the camera.
I found that someone asked a similar question in the past ( Check if a Point(Cartesia3) exists in a circle ) the answer was “You just need to check if the distance between centre and your point is equal to radius”.
What is centre? The camera viewer position?
function getMapCenter() {
var windowPosition = new window.Cesium.Cartesian2(viewer.container.clientWidth / 2, viewer.container.clientHeight / 2);
var pickRay = viewer.scene.camera.getPickRay(windowPosition);
var pickPosition = viewer.scene.globe.pick(pickRay, viewer.scene);
var pickPositionCartographic = viewer.scene.globe.ellipsoid.cartesianToCartographic(pickPosition);
console.log(pickPositionCartographic.longitude * (180/Math.PI));
console.log(pickPositionCartographic.latitude * (180/Math.PI));
}
As referenced in https://stackoverflow.com/questions/33348761/get-center-in-cesium-map
So, let’s say that my circle is always 100px, radius would be 50px but how would I translate these values against what getCenterMap function provides?
I found the Occluder might help, so will take some time to see if I can use it for my use case ( /docs/cesiumjs-ref-doc/Occluder.html ).
Thank you