config.ts 2.33 KB
import { PublicConfigClass } from '@/packages/public'
import { CreateComponentType } from '@/packages/index.d'
import { AddRealTimeTrajectoryAmapConfig } from './index'
import { chartInitConfig } from '@/settings/designSetting'
import cloneDeep from 'lodash/cloneDeep'
import dataJson from './data.json'
import markImage from '@/assets/external/marker/1.png'

export type dataJsonType = typeof dataJson //data.json类型

export enum ThemeEnum {
  NORMAL = 'normal',
  DARK = 'dark',
  LIGHT = 'light',
  WHITES_MOKE = 'whitesmoke',
  FRESH = 'fresh',
  GREY = 'grey',
  GRAFFITI = 'graffiti',
  MACARON = 'macaron',
  BLUE = 'blue',
  DARKBLUE = 'darkblue',
  WINE = 'wine',
  WEIXIN = 'tileLayer'
}

export enum LangEnum {
  ZH_CN = 'zh_cn',
  EN = 'en',
  ZH_EN = 'zh_en'
}

export enum ViewModeEnum {
  PLANE = '2D',
  STEREOSCOPIC = '3D'
}

export enum FeaturesEnum {
  BG = 'bg',
  POINT = 'point',
  ROAD = 'road',
  BUILDING = 'building'
}

export enum MarkerEnum {
  // 圆圈
  CIRCLE_MARKER = 'CircleMarker',
  // 定位标点
  MARKER = 'Marker',
  // 暂无
  NONE = 'none'
}

export const option = {
  dataset: dataJson,
  mapOptions: {
    lineColor:'#53A9DE',
    lineWidth:2,
    pitch: 60,
    skyColor: '#53A9DE',
    amapKey: 'd5f3e16589dbecae64d05fe90e2ba4f2',
    amapStyleKey: ThemeEnum.DARK,
    amapStyleKeyCustom: '',
    amapLon: 104.108689,
    amapLat: 30.66176,
    amapZindex: 11,
    iconMarker: markImage,
    lineOpacity: 0.5,
    lineShowDir: false,
    mpBorderConfig: {
      value: 'Border01'
    },
    bgColor: 'rgba(255, 255, 255, 0.05)',
    marker: {
      fillColor: '#E98984FF',
      fillOpacity: 0.5,
      strokeColor: 'white',
      strokeWeight: 2,
      strokeOpacity: 0.5,
      zIndex: 10,
      bubble: true,
      cursor: 'pointer',
      clickable: true
    },
    mapMarkerType: MarkerEnum.MARKER,
    viewMode: ViewModeEnum.STEREOSCOPIC,
    lang: LangEnum.ZH_CN,
    features: [FeaturesEnum.BG, FeaturesEnum.POINT, FeaturesEnum.ROAD, FeaturesEnum.BUILDING]
  }
}

export type mapOption =typeof option['mapOptions']

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