Skip to main content
Glama

setView

Instantly change the camera view to specific geographic coordinates and orientation in a 3D globe without animation.

Instructions

瞬间切换到指定经纬度视角(无动画)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
longitudeYes经度(-180 ~ 180)
latitudeYes纬度(-90 ~ 90)
heightNo高度(米)
headingNo航向角(度)
pitchNo俯仰角(度)
rollNo翻滚角(度)

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
    }
  • Tool registration and invocation logic within the main Bridge class.
    case 'setView':
      this.setView(p as SetViewParams)

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