alberto-acevedo / cesium-navigation

Cesium plugin that adds to the Cesium map a compass, navigator (zoom in/out), and distance scale.
304 stars 123 forks source link

Coordinate control for cesiumjs #50

Open adeelahmed1981 opened 3 years ago

adeelahmed1981 commented 3 years ago

Hi, Is there any coordinate control avalible for cesium viewer as we have navigation control? .i have seen such kind control in terriajs viewer.There control show lat,long and elevation on mouse move . Thanks

alberto-acevedo commented 3 years ago

Take a look to this demo in Cesium SandCastle that shows how to add a label and display the coordinates from the mousemove event.

https://sandcastle.cesium.com/index.html?#c=lVVtb9s2EP4rB3+RjLq0k+1DIdnBuizDBiTosGbtNhgYaOpsEaFIgaTsOEX/+460XvzSDJg/iby75557eHeeTuEPhyCUrGupN1ArrtGBN+BQofByi2oPpSwQam69A7MGXyJslFkhuMauuUC21Eu95Ra2EndoYQEad3CLTjYV+xTv0kTE463RnkuNNpnAl6UG+rmn/XtfGVeXaDGDNVcOJ62pNI0q3mtZcY+QgbdNZ/JoLQH9Zs2WyNmsSycsku9nY1XxeHBJx0v9dZwHjsQysmEvxlSPJm1PqL30El1wOrtivCjSlqgsMkgq0yQtBcVXqLKujPCbTqE2jgKNhp7RLelGX1xfs7/vfv8wgcGf6tudVPW1pdqycAI1MsFJ3Mjkbku87qXzdE2SEheHldkiiblutAh5Uxx3jMKLxDr29CLndW3Q/7j/tYggSUjZRyjqBWdkMQQdaMQnZ725DaGSHwINIBr2qDViB2G8ECSA2Vhel1IM+gwZRSfQkFHwCi1ntRRPd13C9Kipek2/S0kfJamsPyfQff41ngxldLXJNaR9pvHxq3Uceo6LIZr1IY/m9sjnCCo/RVJGb6RvCvzobZioRcf5gfuSefMTbiyiS48zsj5oTB4/y2cs0qvZBTL3/x+4jXkN99AfrH+VxfAal16x4VloWvILXfuay5qm/B/n9wrJ8d33+fGEnGVcvDImObyC7fHZE2qSJvDmQuw3QKMQDada0f04OZPTomtUgLqAz0NX70LjavIKze1L6YbowoimoqgwRHcKw2ecpeWooHFcjsZMahrQXx4f7r8J3846dRlBf/lvmeM6zE+3w1KPJqN51PfmYPlBVrWxHhqrUsamHita5CTndNWIJ/RMuLjc5tMuaF7ILS20RUcZomGRvLyVusDnDK5ns1neT2sGfOWMajzmUKLclD67ms3q5xx2svBldn042GiBq3hYGe9NlUE8hLrfCqMMbepdKT0mN/MpcTihcvYXQayE4s6RZd0o9VG+4HL0jTBleEGP/IEWkOL74FJe3dwfLhlj8ykdL6O8MWrF7RHivw

You need to use Cesium.sampleTerrain to get the terrain elevation asynchronously. Take a look to this link that describes the solution: https://community.cesium.com/t/display-mouse-position-and-elevation-value-question/1058

v/r,

Alberto

adeelahmed1981 commented 3 years ago

thanks @alberto-acevedo for you help I will try it then let you know