    import Layer from './Layer'
    import {defaultValue, toJSON} from '../../../util'
    import { Zondy } from '../../../base'
    import { LayerType } from '../../../base/enum'
    import TileInfo from '../support/TileInfo';

    /**
     * 瓦片图层基类
     * @class TileLayer
     * @moduleEX LayerModule
     * @extends Layer
     * @param {Object} options 构造参数
     * @param {String} [options.url] 服务基地址
     */
    class TileLayer extends Layer {
      constructor(options) {
        super(options)
        options = defaultValue(options, {})
        this.type = LayerType.tile
        /**
         * 服务基地址
         * @member {String} TileLayer.prototype.url
         */
        this.url = defaultValue(options.url, undefined)
        /**
         * 图层信息
         * @readonly
         * @member {TileInfo|undefined} TileLayer.prototype.tileInfo
         */
        this.tileInfo = undefined
      }

      /**
       * @description 转换为json对象
       * @return {TileInfo} json对象
       */
      toJSON() {
        const json = super.toJSON()
        json.url = this.url
        json.tileInfo = toJSON(this.tileInfo, TileInfo)
        return json
      }

      /**
       * @description 克隆方法
       * @return {FeatureLayer} 图层
       */
      clone() {
        return new TileLayer(this.toJSON())
      }
    }

    Zondy.Layer.TileLayer = TileLayer
    export default TileLayer