Cesium 界面介绍及组件显隐
体验入口
Cesium 原生控件
查找位置geocoder
ts
const geocoder = viewer!.geocoder.container as HTMLElement;
geocoder!.style.display = value ? 'inline-block' : 'none';
const geocoder = viewer!.geocoder.container as HTMLElement;
geocoder!.style.display = value ? 'inline-block' : 'none';
首页按钮homeButton
ts
const homeButton = viewer!.homeButton.container.querySelector(
'.cesium-home-button'
) as HTMLElement;
homeButton!.style.display = value ? 'inline-block' : 'none';
const homeButton = viewer!.homeButton.container.querySelector(
'.cesium-home-button'
) as HTMLElement;
homeButton!.style.display = value ? 'inline-block' : 'none';
视角模式sceneModePicker
ts
const sceneModePicker = viewer!.sceneModePicker.container.querySelector(
'.cesium-sceneModePicker-wrapper'
) as HTMLElement;
sceneModePicker!.style.display = value ? 'inline-block' : 'none';
const sceneModePicker = viewer!.sceneModePicker.container.querySelector(
'.cesium-sceneModePicker-wrapper'
) as HTMLElement;
sceneModePicker!.style.display = value ? 'inline-block' : 'none';
图层选择器baseLayerPicker
ts
const baseLayerPicker = (
viewer!.baseLayerPicker.container.querySelector(
'.cesium-baseLayerPicker-selected'
) as HTMLElement
)?.parentElement;
baseLayerPicker!.style.display = value ? 'inline-block' : 'none';
const baseLayerPicker = (
viewer!.baseLayerPicker.container.querySelector(
'.cesium-baseLayerPicker-selected'
) as HTMLElement
)?.parentElement;
baseLayerPicker!.style.display = value ? 'inline-block' : 'none';
导航帮助navigationHelpButton
ts
const navigationHelpButton =
viewer!.navigationHelpButton.container.querySelector(
'.cesium-navigationHelpButton-wrapper'
) as HTMLElement;
navigationHelpButton!.style.display = value ? 'inline-block' : 'none';
const navigationHelpButton =
viewer!.navigationHelpButton.container.querySelector(
'.cesium-navigationHelpButton-wrapper'
) as HTMLElement;
navigationHelpButton!.style.display = value ? 'inline-block' : 'none';
动画组件animation
ts
const animation = viewer!.animation.container as HTMLElement;
animation!.style.display = value ? 'inline-block' : 'none';
const animation = viewer!.animation.container as HTMLElement;
animation!.style.display = value ? 'inline-block' : 'none';
版权creditDisplay
ts
viewer!.creditDisplay.container.style.display = value ? 'inline-block' : 'none';
viewer!.creditDisplay.container.style.display = value ? 'inline-block' : 'none';
时间轴timeline
ts
const animation = viewer!.timeline.container as HTMLElement;
animation!.style.display = value ? 'inline-block' : 'none';
const animation = viewer!.timeline.container as HTMLElement;
animation!.style.display = value ? 'inline-block' : 'none';
全屏按钮fullscreenButton
ts
viewer!.fullscreenButton.viewModel.isFullscreenEnabled = value;
viewer!.fullscreenButton.viewModel.isFullscreenEnabled = value;