import type { Viewer } from 'cesium'; import * as Cesium from 'cesium'; export const VIEWER_OPTIONS_FN = (): Viewer.ConstructorOptions => { return { animation: true, // .cesium-viewer-animationContainer https://cesium.com/learn/ion-sdk/ref-doc/Animation.html baseLayer: Cesium.ImageryLayer.fromProviderAsync( Cesium.TileMapServiceImageryProvider.fromUrl(Cesium.buildModuleUrl('Assets/Textures/NaturalEarthII')), ), baseLayerPicker: false, fullscreenButton: !true, // 全屏按钮 geocoder: false, // = IonGeocodeProviderType.DEFAULT] - 在使用Geocoder小部件进行搜索时使用的地理编码服务或服务。如果设置为false,则不会创建Geocoder小部件。 // globe: false, // 地球 homeButton: true, // Home按钮 infoBox: false, // InfoBox小部件。 navigationHelpButton: false, // 是否显示导航帮助按钮 orderIndependentTranslucency: false, // 顺序无关透明度 projectionPicker: !true, // 投影选择器 requestRenderMode: !true, // 如果为真,渲染帧将仅在场景内部发生变化时需要时发生。启用此功能可以减少应用程序的CPU/GPU使用率,并在移动设备上节省更多电量,但在此模式下需要使用{@link Scene#requestRender}显式渲染新帧。在API的其他部分对场景进行更改后,在许多情况下都需要这样做。请参阅{@link https://cesium.com/blog/2018/01/24/cesium-scene-rendering-performance/|使用显式渲染提高性能}。 sceneModePicker: true, // 是否显示场景模式选择器(2D/3D切换) selectionIndicator: true, shadows: true, // Determines if shadows are cast by light sources. /* animationContainer: !true, */ /* timelineContainer: true, */ /* bottomContainer: document.createElement('p'), // The DOM element or ID that will contain the bottomContainer. If not specified, the bottomContainer is added to the widget itself. */ shouldAnimate: !true, showRenderLoopErrors: true, // 如果为真,当发生渲染循环错误时,此小部件将自动向用户显示包含错误的HTML面板。 timeline: true, }; };