export enum MapboxConfig {
  ACCESS_TOKEN = 'pk.eyJ1IjoieHVqaW5nbGlhbmciLCJhIjoiY2w3bzFzZnZqMjdieTN1cG92N2I1d2huOSJ9.aQqMz4S-cTziUYizIH_gNg',
  // ACCESS_TOKEN = "1234",
  TDT_TOKEN = 'b6585bc41ee16251dbe6b1af64f375d9',
  // add more config options here
}
export const MapboxDefaultStyle = {
  glyphs: 'mapbox://fonts/mapbox/{fontstack}/{range}.pbf',
  version: 8,
  sources: {
    'dianzi': {
          type: 'raster',
          tiles: [
              `https://t0.tianditu.gov.cn/DataServer?T=cva_w&x={x}&y={y}&l={z}&tk=${MapboxConfig.TDT_TOKEN}`,
          ],
          tileSize: 256,
          minzoom:18,
          maxzoom:24,
      },
      'dianzi-biaozhu': {
          type: 'raster',
          tiles: [
              `https://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=${MapboxConfig.TDT_TOKEN}`,
          ],
          tileSize: 256,
      },
      'raster-tiles': {
        type: 'raster',
        tiles: [
          `https://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=${MapboxConfig.TDT_TOKEN}`,
        ],
        tileSize: 256,
        minzoom:0,
        maxzoom:18,
      },
  },
  layers: [
    {
      id: 'dianzi-biaozhu',
      type: 'raster',
      source: 'dianzi-biaozhu',
      layout: {
        visibility: 'visible',
      },
    },{
      id: 'tdt-img-tiles',
      type: 'raster',
      source: 'raster-tiles',
      minzoom: 0,
      maxzoom: 18,
    },{
      id: 'dianzi',
      type: 'raster',
      source: 'dianzi',
      layout: {
        visibility: 'visible',
      },
      minzoom: 18,
      maxzoom: 24,
    }
  ],
};

export const MapControlConfig = {
  DrawPoint: {
    handler: 'handlerDrawPoint',
    icon: '/point.png',
    title: '绘制点',
  },
  DrawLineString: {
    handler: 'handlerDrawLineString',
    icon: '/line.png',
    title: '绘制线',
  },
  DrawPolygon: {
    handler: 'handlerDrawPolygon',
    icon: '/polygon.png',
    title: '绘制面',
  },
};
