import EchartsLayer from './echarts/EchartsLayerPlugin'

class EchartsLayerUtil {}

EchartsLayerUtil.addEchartsLayer = function (layer, sceneView) {
  const echartsLayer = new EchartsLayer(sceneView, layer.echartsOptions).addTo(
    sceneView
  )
  echartsLayer.id = layer.id
  return echartsLayer
}

/**
 * 移除图层
 * @param {Object} layer 图层对象
 * */
EchartsLayerUtil.removeLayer = function (layer) {
  layer.remove()
}

export default EchartsLayerUtil
