import { MapImageLayer } from '../baseLayer'
import { LayerType } from '../../../base/enum'
import { Zondy } from '../../../base'
import { defaultValue } from '../../../util'
/**
* IGS影像图层
* @class IGSImageLayer
* @moduleEX LayerModule
* @classdesc IGS影像图层
* @extends MapImageLayer
* @param {Object} options 构造参数
* @param {String} [options.url = ''] 服务链接
*/
class IGSImageLayer extends MapImageLayer {
constructor(options) {
super(options)
// eslint-disable-next-line no-param-reassign
options = defaultValue(options, {})
this.type = LayerType.igsMapImage
this.description = 'IGS影像图层'
/**
* 服务基地址
* @member {String} IGSImageLayer.prototype.url
*/
this.url = defaultValue(options.url, '')
}
/**
* @description 转换为json对象
* @return {Object} json对象
*/
toJSON() {
const json = super.toJSON()
json.url = this.url
return json
}
/**
* @description 克隆方法
* @return {IGSImageLayer} 图层
*/
clone() {
return new IGSImageLayer(this.toJSON())
}
}
Zondy.Layer.IGSImageLayer = IGSImageLayer
export default IGSImageLayer