# MapGIS Client for JavaScript API

Cesium MapboxGL Leaflet OpenLayers
API文档

    import { defaultValue } from '../util'
    import FeatureExpressionInfo from './FeatureExpressionInfo'
    import Zondy from './Zondy'
    import { ElevationMode, LengthUnit } from './enum'

    /**
     * 高程信息
     * @classdesc 高程信息
     * @class ElevationInfo
     * @param {Object} options 构造参数
     * @param {ElevationMode} [options.mode = ElevationMode.OnTheGround] 模式
     * @param {Number} [options.offset = 0] 高程偏移
     * @param {FeatureExpressionInfo} [options.featureExpressionInfo = undefined] 高度表达式
     * @param {LengthUnit} [options.unit = LengthUnit.meter] 单位
     */
    class ElevationInfo {
      constructor(options) {
        const opts = defaultValue(options, {})
        /**
         * 高程模式
         *
         * @date 10/12/2021
         * @memberof ElevationInfo
         */
        this.mode = defaultValue(opts.OnTheGround, ElevationMode.OnTheGround)

        /**
         * 高程偏移。默认为零，默认单位为米。
         *
         * @date 10/12/2021
         * @memberof ElevationInfo
         */
        this.offset = defaultValue(opts.offset, 0)

        /**
         * 要素表达式信息
         *
         * @date 10/12/2021
         * @memberof ElevationInfo
         */
        this.featureExpressionInfo = new FeatureExpressionInfo(
          opts.featureExpressionInfo
        )

        /**
         * offset和featureExpression的单位
         *
         * @date 10/12/2021
         * @memberof ElevationInfo
         */
        this.unit = defaultValue(opts.unit, LengthUnit.meter)
      }

      clone() {
        return new ElevationInfo({
          unit: this.unit,
          mode: this.mode,
          offset: this.offset,
          featureExpressionInfo: this.featureExpressionInfo.clone()
        })
      }

      /**
       * @description 转换为json对象
       * @return {Object} json对象
       */
      toJSON() {
        return {
          unit: this.unit,
          mode: this.mode,
          offset: this.offset,
          featureExpressionInfo: this.featureExpressionInfo.toJSON()
        }
      }
    }

    Zondy.ElevationInfo = ElevationInfo
    export default ElevationInfo

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