# MapGIS Client for JavaScript API

Cesium MapboxGL Leaflet OpenLayers
API文档

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

    class M3DCacheLayerView extends LayerView {
      /**
       * 添加图层视图
       * @param {LayerEvent} event 图层事件
       * @return {Promise<LayerView>} 图层视图
       */
      onAdd(event) {
        const layer = this.layer
        const innerView = this.innerView
        const self = this
        return new Promise((reslove) => {
          IGSM3DLayerUtil.addM3DLayer(layer, innerView, this.view, (layer) => {
            self.innerLayer = layer
            reslove(self)
          })
        })
      }

      /**
       * 移除图层视图
       * @param {LayerEvent} event 图层事件
       * @return {Promise<LayerView>} 图层视图
       */
      onRemove(event) {
        IGSM3DLayerUtil.removeLayer(this.layer, this.innerView, this.view)
        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 M3DCacheLayerView

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