How to detect if the mouse pointer is within terrain provider

Hello! I’m trying to get the elevation height of the terrain provider if the mouse pointer is within the terrain provider. Anyone has any idea how to get this? Thanks!