cesiumlab / cesiumlab/XbsjEarthUI

请问earthsdk的双击旋转功能可以自定义一下吗?

Open
#29 0 comments 0 reactions 0 assignees View on GitHub
documentation question
Dominant language
JavaScript
Stars
734
Forks
193
PR merge metrics
No merged PRs in 30d

Description

请问earthsdk的双击旋转功能可以自定义一下吗?
请问双击旋转可以写死中心点和半径吗

---

## flyAround
可以使用earth.camera.flyAround来操作。
![image](https://user-images.githubusercontent.com/13550568/69205921-4f2b9180-0b86-11ea-8ec3-c98e1944b0b0.png)
比如这样:
`earth.camera.flyAround([2.1206125026580582,0.545178729438238,15], 3000, [0, -Math.PI / 5, 0], 0, 3.14/50); `

## 示例
效果参见数字城市示例:http://earthsdk.com/v/last/Apps/Examples/earth-digitalCity.html

## 取消操作
如果需要取消默认的双击旋转事件,可以使用这个方法
`earth.czm.viewer.screenSpaceEventHandler.removeInputAction(Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);`

## 左键双击自定义
添加新方法可以这样:
```
earth.czm.viewer.screenSpaceEventHandler.setInputAction(event => {
// 以下代码根据需要自行修改
const pp = Cesium.xbsjPickPosition(viewer.scene, event.position, scratchCartesian);
if (pp) {
Cesium.xbsjFlyAround(viewer.camera, pp);
}
}, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading the issue's references to earth.camera.flyAround, screenSpaceEventHandler, and Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK. Determine whether the requested customization is still needed beyond the documented cancellation and replacement handlers; done would require a specific, agreed customization scope and a corresponding example or implementation path.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.