/**
 * 线类型
 * @readonly
 * @enum
 * @property {string} MapLineType.Solid 实线
 * @property {string} MapLineType.Dashed 虚线
 */
export const MapLineType = {
  /**实线 */
  Solid: 'solid',
  /**虚线 */
  Dashed: 'dashed'
}
/**
 * 图层类型
 * @readonly
 * @enum
 * @property {string} MapLayerType.line 线图层
 * @property {string} MapLayerType.point 点图层
 * @property {string} MapLayerType.polygon 面图层
 * @property {string} MapLayerType.text 文字标注图层
 * @property {string} MapLayerType.infowindow 信息弹窗图层
 * @property {string} MapLayerType.animation 动效图层
 */
export const MapLayerType = {
  Line: 'line',
  Point: 'point',
  Polygon: 'polygon',
  Text: 'text',
  Infowindow: 'infowindow',
  Animation: 'animation',
  Mask: 'mask'
}
/**
 * 要素类型
 * @readonly
 * @enum
 * @property {string} MapFeatureType.line 线要素
 * @property {string} MapFeatureType.point 点要素
 * @property {string} MapFeatureType.polygon 面要素
 */
export const MapFeatureType = {
  Line: 'line',
  Point: 'point',
  Polygon: 'polygon'
}
/**
 * 点样式
 * @class
 * @param {number} width    点宽
 * @param {number} height   点高
 * @param {string} icon     图片url
 * @param {number} xOffset  x偏移
 * @param {number} yOffset  y偏移
 * @param {number} angle    角度
 */
export class MapPointStyle {
  constructor(width, height, icon, xOffset, yOffset, angle) {
    this.width = width
    this.height = height
    this.icon = icon
    this.xOffset = xOffset
    this.yOffset = yOffset
    this.angle = angle
  }
}
/**
 * 线样式
 * @class
 * @param {string} color         颜色
 * @param {number} width         宽度
 * @param {number} opacity       透明度
 * @param {MapLineType} lineType 线类型
 */
export class MapLineStyle {
  constructor(color, width, opacity, lineType) {
    this.color = color
    this.width = width
    this.opacity = opacity
    this.lineType = lineType
  }
}
/**
 * 面样式
 * @class
 * @param {string} fillcolor       填充颜色
 * @param {string} strokeColor     边线颜色
 * @param {number} strokeWeight    边线宽
 * @param {number} strokeOpacity   边线透明度
 * @param {number} fillOpacity     填充透明度
 * @param {MapLineType} strokeType 边线样式（Solid/Dashed）
 */
export class MapPolygonStyle {
  constructor(fillColor, strokeColor, strokeWeight, strokeOpacity, fillOpacity, strokeType) {
    this.fillColor = fillColor
    this.strokeColor = strokeColor
    this.strokeWeight = strokeWeight
    this.strokeOpacity = strokeOpacity
    this.fillOpacity = fillOpacity
    this.strokeType = strokeType
  }
}
/**
 * 文字样式
 * @class
 * @param {string} fontFamily   字体
 * @param {number} fontSize     字体大小
 * @param {string} fontWeight   字体粗细
 * @param {array} fontColor     字体大小
 * @param {number} xOffset      x偏移
 * @param {number} yOffset      y偏移
 */
export class MapTextStyle {
  constructor(fontFamily, fontSize, fontWeight, fontColor, xOffset, yOffset) {
    this.fontFamily = fontFamily
    this.fontSize = fontSize
    this.fontWeight = fontWeight
    this.fontColor = fontColor
    this.xOffset = xOffset
    this.yOffset = yOffset
  }
}
/**
 * 点类
 * @class
 * @param {string} name         名称，唯一标识
 * @param {object[]} attribute     属性  [{name: '属性1', value: '1'}, {name: '属性2', value: 2}]
 * @param {number} longitude    经度
 * @param {number} latitude     纬度
 * @param {MapPointStyle} style 样式
 */
export class MapPoint {
  constructor(name, attribute, longitude, latitude, style) {
    this.name = name
    this.attribute = attribute
    this.longitude = longitude
    this.latitude = latitude
    this.style = style
  }
}
/**
 * 带文字点类
 * @class
 * @param {string} name         名称，唯一标识
 * @param {object[]} attribute     属性  [{name: '属性1', value: '1'}, {name: '属性2', value: 2}]
 * @param {number} longitude    经度
 * @param {number} latitude     纬度
 * @param {MapPointStyle} ptStyle 点样式
 * @param {MapTextStyle} txtStyle 文字样式
 */
export class MapPointText {
  constructor(name, attribute, longitude, latitude, text, ptStyle, txtStyle) {
    this.name = name
    this.attribute = attribute
    this.longitude = longitude
    this.latitude = latitude
    this.text = text
    this.ptStyle = ptStyle
    this.txtStyle = txtStyle
  }
}
/**
 *  线类
 * @class
 * @param {string} name         名称，唯一标识
 * @param {array} attribute     属性
 * @param {number[][]} path          组成线的点集[[x1,y1],[x2,y2]...]
 * @param {MapLineStyle} style  样式
 */
export class MapPolyline {
  constructor(name, attribute, path, style) {
    this.name = name
    this.attribute = attribute
    this.path = path
    this.style = style
  }
}
/**
 *  面类
 * @class
 * @param {string} name            名称，唯一标识
 * @param {array} attribute        属性
 * @param {number[][]} path             组成面的点集[[x1,y1],[x2,y2]...]
 * @param {MapPolygonStyle} style  样式
 */
export class MapPolygon {
  constructor(name, attribute, path, style) {
    this.name = name
    this.attribute = attribute
    this.path = path
    this.style = style
  }
}
/**
 *  文字类
 * @class
 * @param {string} name        名称，唯一标识
 * @param {string} content     标注内容
 * @param {number} longitude   经度
 * @param {number} latitude    纬度
 * @param {MapTextStyle} style 样式
 */
export class MapText {
  constructor(name, content, longitude, latitude, style) {
    this.name = name
    this.content = content
    this.longitude = longitude
    this.latitude = latitude
    this.style = style
  }
}
/**
 * 信息窗类
 * @class
 * @param {string} name 名称，唯一标识
 * @param {string} content 标注内容
 * @param {number} longitude   经度
 * @param {number} latitude   纬度
 * @param {number} xOffset x偏移
 * @param {number} yOffset y偏移
 */
export class MapInfowindow {
  constructor(name, content, longitude, latitude, xOffset, yOffset) {
    this.name = name
    this.content = content
    this.latitude = latitude
    this.longitude = longitude
    this.xOffset = xOffset
    this.yOffset = yOffset
  }
}
/**
 * 动画图层类
 * @class
 * @param {string} name 名称，唯一标识
 * @param {number} longitude   经度
 * @param {number} latitude   纬度
 * @param {string} content 标注内容 HTMLElement（百度/高德）｜gif图片地址（esri）
 * @param {number} xOffset x偏移
 * @param {number} yOffset y偏移
 */
export class MapAnimation {
  constructor(name, longitude, latitude, content, xOffset, yOffset) {
    this.name = name
    this.longitude = longitude
    this.latitude = latitude
    this.content = content
    this.xOffset = xOffset
    this.yOffset = yOffset
  }
}

/**
 * 三维镜头信息类
 * @class
 * @param {number} pitch 镜头俯仰角
 * @param {number} yaw 镜头偏航角
 * @param {number[]}  position 镜头位置 [x,y,z]
 * @param {number[]}  lonlat 镜头经纬度 [lon,lat,z]
 * @param {number} duration 镜头移动时间，单位秒
 * @param {number} distance 镜头离中心点的距离
 * @param {number} zoom 缩放级别
 * @param {number} target 三维镜头目标
 */
export class CameraInfo {
  constructor(pitch, yaw, position, lonlat, duration, distance, zoom, target) {
    this.pitch = pitch
    this.yaw = yaw
    this.position = position
    this.lonlat = lonlat
    this.duration = duration
    this.distance = distance
    this.zoom = zoom
    this.target = target
  }
}
/**
 * 镜头旋转方向
 * @readonly
 * @enum
 * @property {string} RotateDirection.clockwise 顺时针旋转
 * @property {string} RotateDirection.anticlockwise 逆时针旋转
 * @property {string} RotateDirection.stop 停止旋转
 */
export const RotateDirection = {
  Clockwise: 'clockwise',
  Anticlockwise: 'anticlockwise',
  Stop: 'stop'
}
/**
 * 实体类型
 * @readonly
 * @enum
 * @property {string} EntityType.POI POI点
 * @property {string} EntityType.Path 路径
 * @property {string} EntityType.Raster	栅格图
 * @property {string} EntityType.HeatMap 区域热力图
 * @property {string} EntityType.RoadHeatMap 路径热力图
 * @property {string} EntityType.Range 区域轮廓
 * @property {string} EntityType.Effect 特效
 * @property {string} EntityType.Object 实体
 * @property {string} EntityType.Text 3d 文字
 */
export const EntityType = {
  POI: 'poi',
  Path: 'path',
  Raster: 'raster',
  HeatMap: 'heatmap',
  RoadHeatMap: 'road_heatmap',
  Range: 'range',
  Effect: 'scene_effect',
  Object: 'aes_object',
  Text: '3d_text'
}
/**
 * 路径样式
 * @readonly
 * @enum
 * @property {number} PathStyle.Solid  实线
 * @property {number} PathStyle.Dashed 虚线
 * @property {number} PathStyle.Arrow 箭头
 * @property {number} PathStyle.Flash 流线
 */
export const PathStyle = {
  Solid: 1,
  Dashed: 2,
  Arrow: 3,
  Flash: 4
}
/**
 * 区域样式
 * @readonly
 * @enum
 * @property {number} AreaStyle.Solid 实体
 * @property {number} AreaStyle.Strip 横纹
 * @property {number} AreaStyle.Grid 网格
 */
export const AreaStyle = {
  Solid: 1,
  Strip: 2,
  Grid: 3
}
/**
 * 天气
 * @readonly
 * @enum
 * @property {number} Weather.晴天
 * @property {number} Weather.阴天
 * @property {number} Weather.小雨
 * @property {number} Weather.中雨
 * @property {number} Weather.大雨
 * @property {number} Weather.少云
 * @property {number} Weather.雾霾
 * @property {number} Weather.小雪
 * @property {number} Weather.中雪
 * @property {number} Weather.大雪
 */
export const Weather = {
  晴天: 1,
  阴天: 2,
  小雨: 3,
  中雨: 4,
  大雨: 5,
  少云: 6,
  雾霾: 7,
  小雪: 8,
  中雪: 9,
  大雪: 10
}
/**
 * POI点数据
 * @class
 * @param {string} id 唯一标识
 * @param {string} resourceName 资源库中资源名称
 * @param {number[]} position POI位置
 * @param {number[]} scale x,y,z方向缩放比例
 * @param {string} label POI文字
 * @param {number[]} labelOffset 偏移量
 * @param {string} iconUrl POI图标url
 * @param {number[]} iconOffset 偏移量
 */
export class POI {
  constructor(id, resourceName, position, scale, label, labelOffset, iconUrl, iconOffset) {
    this.id = id
    this.resourceName = resourceName
    this.position = position
    this.scale = scale
    this.label = label
    this.labelOffset = labelOffset
    this.iconUrl = iconUrl
    this.iconOffset = iconOffset
  }
}
