import { PublicConfigClass } from '@/packages/public'
import { chartInitConfig } from '@/settings/designSetting'
import { CreateComponentType } from '@/packages/index.d'
import { NowPositionConfig } from './index'
import cloneDeep from 'lodash/cloneDeep'

export const option = {
  borderColor: '#457453',
  socketSrc: 'ws://111.36.45.20:18088/uav/ws/v1/admin/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJjdXJyZW50VXNlciI6IlRLNHp5OTMyME1tS3BzdE9zVkpmdDlXanlKMjhBSThKVnV2OU55UjU1Vmw3WWptVUFZUCsveVV3eU1PaUE1VEc5Ykt1bGNhTnNsc0l6dkQ5M0ZkWGhxNlYxVm44L0dUL2NNQ2JhYjhvV0hwQ3BmTGRyNk5IQnorcytGOXM4YmNVZy9CSDlPRGlHck9ZSDhwbkpIclNjM0pIdEZFa09iSTAyVjY4RFdwNG8wRWZqYjE5YjJVQTE2WGpmWEhZUWZvNVpmMnNERzlxMnNsQ1R5VmJVUlBaMTJ1M25EWGI2TnNnODRHblM1ZVdYZTNHaFJ6VmZkYWdSMGMraG9lWG9UVTFLei9yZU1JUzlvZ3Zyb0ZWLzNpdUF6c1B1MVlVcm9RT3RheDNRdlF4WllXdGM4RFhoYlFLRFFiVXlBMGtZR2JHajFKQ3B0VFI0Y1B0aGhlb3N2dnhQTnV1ZjcyWmFUbDR3amgzUENMZVdrNThTc0Z3SjFJNnJGa3lGYWlTVlpUUSs0RzhIV2phRlIzUG9DSkk0QzAvRnM1bU16YTR4dldzZlUyZTgvKzhzSE1iUUtOZWlacjJ0cUxoTlVvN0Y5OURrbEJHbzZMcmJsMXR1bVFHdlN1bGMxL1RoaEZ3WUx0cS8zRnVybTNuMEJQS21JT2dKRGlPUmtYR1lObE4wUy9DeU1qVlRpNzJWOHoxdHhDNWl5VzlmM29od0NjazZJaVhSK2lZeXJ6N2I3YWpkN3ZZUkdCNU8wRmxaOGJRaTZXVnM1STgzSDMwREcwNEtTdWFybnJpNncvNm83NkJrTW1RQnlwbzI3NnlUMnJm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LYzRKR08yakZOTVB4ZXpzaFdsdHpKVjhZeGxJZ0tnZEtPT0kySm8yUTVhbkYxSTRtN01jQ2ZQIiwiZXhwIjoxNzQyNzg0MjU1fQ.p5g59OlxRrof3q-mRXErhyP21f3wkIpeSz3FNaJUGR8',
  mapOptions:{
    "scene": {
      "center": {"lat":35.362625,"lng":118.033886,"alt":22306.3,"heading":360,"pitch":-70},
      "scene3DOnly": false,
      "shadows": false,
      "removeDblClick": true,
      "sceneMode": 2,
      "showSun": true,
      "showMoon": true,
      "showSkyBox": true,
      "showSkyAtmosphere": true,
      "fog": true,
      "fxaa": true,
      "requestRenderMode": true,
      "contextOptions": {
        "requestWebgl1": false,
        "webgl": {
          "preserveDrawingBuffer": true
        }
      },
      "globe": {
        "depthTestAgainstTerrain": false,
        "baseColor": "#546a53",
        "showGroundAtmosphere": true,
        "enableLighting": false
      },
      "cameraController": {
        "zoomFactor": 3.0,
        "minimumZoomDistance": 1,
        "maximumZoomDistance": 500000,
        "enableRotate": true,
        "enableTranslate": true,
        "enableTilt": true,
        "enableZoom": true,
        "enableCollisionDetection": true,
        "minimumCollisionTerrainHeight": 15000
      }
    },
    "control": {
      "homeButton": false,
      "baseLayerPicker": false,
      "sceneModePicker": false,
      "vrButton": false,
      "fullscreenButton": false,
      "navigationHelpButton": false,
      "animation": false,
      "timeline": false,
      "infoBox": false,
      "geocoder": false,
      "selectionIndicator": false,
      "showRenderLoopErrors": false,
      "contextmenu": {
        "hasDefault": false
      },
      "mouseDownView": false,
      "zoom": {
        "enabled": false,
        "insertIndex": 1
      },
      "compass": {
        "enabled": false,
        "bottom": "toolbar",
        "left": "5px"
      },
      "distanceLegend": {
        "left": "10px",
        "bottom": "2px"
      },
      // "locationBar": {
      //   "crs": "CGCS2000_GK_Zone_3",
      //   "crsDecimal": 0,
      //   "template": "<div>经度:{lng}</div> <div>纬度:{lat}</div> <div class='hide1000'>横{crsx}  纵{crsy}</div> <div>海拔：{alt}米</div> <div class='hide700'>层级：{level}</div><div>方向：{heading}°</div> <div>俯仰角：{pitch}°</div><div class='hide700'>视高：{cameraHeight}米</div>"
      // }
    },
    "method": {
      "templateValues": {
        "dataServer": "//data.mars3d.cn",
        "gltfServerUrl": "//data.mars3d.cn/gltf"
      }
    },
    "terrain": {
      "url": "//data.mars3d.cn/terrain",
      "show": false,
      "clip": true
    },
    "basemaps": [
      {
        "id": 10,
        "name": "地图底图",
        "type": "group"
      },
      {
        "pid": 10,
        "name": "天地图影像",
        "icon": "//data.mars3d.cn/img/thumbnail/basemap/tdt_img.png",
        "type": "group",
        "layers": [
          {
            "name": "底图",
            "type": "tdt",
            "layer": "img_d"
          },
          {
            "name": "注记",
            "type": "tdt",
            "layer": "img_z"
          }
        ],
        "show": true
      }
    ],
    "layers": []
  }
}

export default class Config extends PublicConfigClass implements CreateComponentType {
  public key = NowPositionConfig.key
  public attr = { ...chartInitConfig, w: 343, h: 224, zIndex: -1 }
  public chartConfig = cloneDeep(NowPositionConfig)
  public option = cloneDeep(option)
}
