Skip to main content
Glama

setBasemap

Change the base map style for 3D globe visualization. Select from dark, satellite, or standard map types to customize the underlying terrain display in CesiumJS.

Instructions

切换底图风格(暗色/卫星影像/标准)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
basemapYes底图类型:dark=暗色, satellite=卫星影像, standard=标准

Implementation Reference

  • The actual implementation of the setBasemap tool which updates the Cesium imagery layers based on the provided basemap parameter.
    setBasemap(params: SetBasemapParams): string {
      const basemap = params.basemap ?? 'dark'
      this._viewer.imageryLayers.removeAll()
    
      switch (basemap) {
        case 'satellite':
          this._viewer.imageryLayers.addImageryProvider(
            new Cesium.UrlTemplateImageryProvider({
              url: 'https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
              maximumLevel: 18,
            }),
          )
          break
        case 'standard':
          this._viewer.imageryLayers.addImageryProvider(
            new Cesium.UrlTemplateImageryProvider({
              url: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png',
              maximumLevel: 19,
            }),
          )
          break
        case 'dark':
        default:
          this._viewer.imageryLayers.addImageryProvider(
            new Cesium.UrlTemplateImageryProvider({
  • Type definition for the input parameters of the setBasemap tool.
    export interface SetBasemapParams {
      basemap: 'dark' | 'satellite' | 'standard' | string
    }

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