# MapGIS Client for JavaScript API

Cesium MapboxGL Leaflet OpenLayers
API文档

    import { LayerView } from '@mapgis/webclient-common'
    import { Cesium3DTilesLayerUtil } from '../view/utils'
    import ApplyLayerUpdateUtil from './support/ApplyLayerUpdateUtil'

    class Cesium3DTilesLayerView extends LayerView {
      /**
       * 添加图层视图
       * @param {LayerEvent} event 图层事件
       * @return {Promise<LayerView>} 图层视图
       */
      onAdd(event) {
        const layer = this.layer
        const innerView = this.innerView
        const that = this
        return new Promise((reslove) => {
          Cesium3DTilesLayerUtil.addCesium3DTilesLayer(
            layer,
            innerView,
            (layer) => {
              this.innerLayer = layer
              reslove(that)
            }
          )
        })
      }

      /**
       * 移除图层视图
       * @param {LayerEvent} event 图层事件
       * @return {Promise<LayerView>} 图层视图
       */
      onRemove(event) {
        Cesium3DTilesLayerUtil.removeLayer(this.layer, this.innerView)
        return Promise.resolve(this)
      }

      /**
       * 更新图层视图
       * @param {LayerViewUpdateEvent} event 图层事件
       * @return {Promise<LayerView>} 图层视图
       */
      onUpdate(event) {
        const _layer = this.innerLayer
        ApplyLayerUpdateUtil.applyUpdate(this.view, this.layer, _layer, event)
        return Promise.resolve(this)
      }
    }
    export default Cesium3DTilesLayerView

构造函数
成员变量
方法
事件