# MapGIS Client for JavaScript API

Cesium MapboxGL Leaflet OpenLayers
API文档

    import Layer from './Layer'
    import { defaultValue } from '../../../util'
    import { Zondy } from '../../../base'
    import { LayerType } from '../../../base/enum'

    /**
     * 瓦片图层基类
     * @class TileLayer
     * @moduleEX LayerManagerModule
     * @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 {Object} json对象
       */
      toJSON() {
        const json = super.toJSON()
        json.url = this.url
        json.tileInfo = this.tileInfo && this.tileInfo.toJSON()
        return json
      }

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

    Zondy.Layer.TileLayer = TileLayer
    export default TileLayer

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