export enum MapboxConfig {
  ACCESS_TOKEN = 'pk.eyJ1IjoiYzRzci1nc2FwcCIsImEiOiJja2J0ajRtNzMwOHBnMnNvNnM3Ymw5MnJzIn0.fsTNczOFZG8Ik3EtO9LdNQ',
  // ACCESS_TOKEN = "1234",
  TDT_TOKEN = 'b6585bc41ee16251dbe6b1af64f375d9',
  // add more config options here
}
export const MapboxDefaultStyle = {
  glyphs: 'mapbox://fonts/mapbox/{fontstack}/{range}.pbf',
  version: 8,
  sources: {
    'raster-tiles': {
      type: 'raster',
      tiles: [
        `http://t0.tianditu.gov.cn/DataServer?T=img_w&x={x}&y={y}&l={z}&tk=${MapboxConfig.TDT_TOKEN}`,
      ],
      tileSize: 256,
      minzoom: 1,
      maxzoom: 17,
    },
    'raster-tiles-font': {
      type: 'raster',
      tiles: [
        `https://t0.tianditu.gov.cn/DataServer?T=vec_w&x={x}&y={y}&l={z}&tk=${MapboxConfig.TDT_TOKEN}`,
      ],
      tileSize: 256,
    }
  },
  layers: [
    {
      id: 'tdt-vec-tiles',
      type: 'raster',
      source: 'raster-tiles-font',
      maxZoom: 32,
    },
    {
      id: 'tdt-img-tiles',
      type: 'raster',
      source: 'raster-tiles',
      maxZoom: 32,
    }
  ],
};

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