Skip to main content
Glama

flyTo

Navigate to specific geographic coordinates with animated camera transitions in 3D globe visualization.

Instructions

飞行到指定经纬度位置(带动画过渡)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
longitudeYes经度(-180 ~ 180)
latitudeYes纬度(-90 ~ 90)
heightNo相机高度(米),默认 50000
headingNo航向角(度),0 为正北
pitchNo俯仰角(度),-90 为正下方
durationNo飞行动画时长(秒)

Implementation Reference

  • The actual implementation of the flyTo functionality that manipulates the Cesium viewer camera.
    export function flyTo(viewer: Cesium.Viewer, params: FlyToParams): Promise<void> {
      const {
        longitude,
        latitude,
        height = 50000,
        heading = 0,
        pitch = -45,
        roll = 0,
        duration = 2,
      } = params
    
      validateCoordinate(longitude, latitude, height)
    
      return new Promise((resolve) => {
        viewer.camera.flyTo({
          destination: Cesium.Cartesian3.fromDegrees(longitude, latitude, height),
          orientation: {
            heading: Cesium.Math.toRadians(heading),
            pitch: Cesium.Math.toRadians(pitch),
            roll: Cesium.Math.toRadians(roll),
          },
          duration,
          complete: resolve,
        })
      })
    }
  • The tool registration in the bridge class, which dispatches 'flyTo' actions.
    case 'flyTo':
      await this.flyTo(p as FlyToParams)
      return { success: true, message: 'Camera flew to target position' }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gaopengbin/cesium-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server