    import { getBaseUrl } from '@mapgis/webclient-common'
    import FeatureRenderView from './support/FeatureRenderView'
    import IGSVectorUtil from '../view/utils/IGSVectorUtil'

    class IGSFeatureLayerView extends FeatureRenderView {
      _processData() {
        const layer = this.layer
        // (默认查询100000条要素)
        const queryCount = 100000
        const query = layer._createQueryOption()
        query.resultRecordCount = queryCount
        return layer.queryFeatures(query).then((res) => {
          return res
        })
      }

      /**
       * 添加图层视图
       * @param {LayerEvent} event 图层事件
       * @return {Promise<LayerView>} 图层视图
       */
      onAdd(event) {
        const self = this
        const layer = this.layer
        const innerView = this.innerView

        // 设置渲染模式
        if (layer.renderMode === 'server') {
          const resourceUrl = layer.url
          if (layer._igsVersion === '1.0') {
            const httpString = getBaseUrl(resourceUrl)
            // 加载IGS二维矢量图层服务
            self.innerLayer = IGSVectorUtil.addIGSVectorLayer(
              `${httpString}/igs/rest/mrms/layers`,
              layer,
              innerView
            )
          } else {
            const httpString = getBaseUrl(resourceUrl)
            // 加载IGS二维矢量图层服务
            self.innerLayer = IGSVectorUtil.addIGSVectorLayer(
              `${httpString}/igs/rest/mrms/layers`,
              layer,
              innerView
            )
          }

          return Promise.resolve(self)
        } else {
          return super.onAdd(event)
        }
      }

      /**
       * 移除图层视图
       * @param {LayerEvent} 图层事件
       * @return {Promise<LayerView>} 图层视图
       */
      onRemove(event) {
        const self = this
        const layer = this.layer
        if (layer.gdbp) {
          this.innerView.removeLayer(this.innerLayer)
          return Promise.resolve(self)
        }
        return super.onRemove(event)
      }
    }
    export default IGSFeatureLayerView