setView
Instantly change the camera view to specific geographic coordinates and orientation in a 3D globe without animation.
Instructions
瞬间切换到指定经纬度视角(无动画)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| longitude | Yes | 经度(-180 ~ 180) | |
| latitude | Yes | 纬度(-90 ~ 90) | |
| height | No | 高度(米) | |
| heading | No | 航向角(度) | |
| pitch | No | 俯仰角(度) | |
| roll | No | 翻滚角(度) |
Implementation Reference
- The setView tool handler implementation which sets the camera view on the Cesium viewer.
export function setView(viewer: Cesium.Viewer, params: SetViewParams): void { const { longitude, latitude, height = 50000, heading = 0, pitch = -45, roll = 0 } = params validateCoordinate(longitude, latitude, height) viewer.camera.setView({ destination: Cesium.Cartesian3.fromDegrees(longitude, latitude, height), orientation: { heading: Cesium.Math.toRadians(heading), pitch: Cesium.Math.toRadians(pitch), roll: Cesium.Math.toRadians(roll), }, }) } - Input parameter validation schema for the setView tool.
export interface SetViewParams { longitude: number latitude: number height?: number heading?: number pitch?: number roll?: number } - packages/cesium-mcp-bridge/src/bridge.ts:92-93 (registration)Tool registration and invocation logic within the main Bridge class.
case 'setView': this.setView(p as SetViewParams)