怎样通过鼠标实时获取portal发布的scene里的地理坐标?web api js

myscene中只是添加了地形数据,现在想通过鼠标实时获取场景中的地理坐标,哪位大神能指导一下。
已邀请:

wall_et

赞同来自: zhangdian

示例里有一个点查询的例子,把你涉及的问题代码摘出来:

view.whenLayerView(layer)
 .then(function (sceneLayerView) { 
view.on("click", function (event) {
var screenPoint = { x: event.x, y: event.y };
}。。。。。。。
通过这个可以获取视图里的屏幕点
SceneView提供了这样的方法:
toMap(screenPoint, mapPoint)

Converts the given screen point to a map point.
https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html#toMap
应该能解决你的问题

要回复问题请先登录注册