[cesium-dev] sampleTerrain inside an event

So sampleTerrain is asynchronous by nature and there’s no way to avoid that (because it has to go to the server to get the relevant terrain tiles). However, for this type of interactivity, you may have luck with scene.globe.getHeight, which is synchronous because it only uses the terrain currently loaded and visualized by Cesium (which should work well for your use case). Once editing is finished, you can always perform a second pass with sampleTerrain to get the most accurate heights available and adjust accordingly.

Let me know if you still run into problems.