export default [
  {
    'id': 'annotation_polygon',
    'type': 'fill',
    source: 'annotations',
    metadata: {
      layerType: 'annotation'
    },
    filter: ['all', ['==', '$type', 'Polygon'], ['==', 'visible', true]],
    paint: {
      'fill-color': ['get', 'color'],
      'fill-opacity': [
        'case',
        ['boolean', ['feature-state', 'selected'], false], 0,
        0.2
      ]
    }
  },
  // {
  //   'id': 'annotation_circle',
  //   'type': 'circle',
  //   source: 'annotations',
  //   metadata: {
  //     layerType: 'annotation'
  //   },
  //   filter: ['all', ['==', '$type', 'Point'], ['==', 'visible', true]],
  //   paint: {
  //     'circle-color': ['get', 'color'],
  //     'circle-radius': 5,
  //     'circle-opacity': [
  //       'case',
  //       ['boolean', ['feature-state', 'selected'], false], 0,
  //       1
  //     ],
  //     'circle-stroke-color': '#ffffff',
  //     'circle-stroke-opacity': [
  //       'case',
  //       ['boolean', ['feature-state', 'selected'], false], 0,
  //       1
  //     ],
  //     'circle-stroke-width': 1
  //   }
  // },
  {
    'id': 'annotation_marker',
    'type': 'symbol',
    source: 'annotations',
    metadata: {
      layerType: 'annotation'
    },
    filter: ['all', ['==', '$type', 'Point'], ['==', 'visible', true]],
    'layout': {
      'icon-image': 'locate',
      'icon-size': 1,
      'icon-allow-overlap': true,
      'icon-offset': [0, -15]
    },
    'paint': {
      'icon-color': ['get', 'color'],
      'icon-halo-width': [
        'case',
        ['boolean', ['feature-state', 'hovered'], false], 4,
        ['boolean', ['feature-state', 'selected'], false], 4,
        0
      ],
      'icon-halo-color': '#ffffff',
      'icon-halo-blur': 0
    }
  },
  {
    'id': 'annotation_line_stroke',
    'type': 'line',
    source: 'annotations',
    metadata: {
      layerType: 'annotation'
    },
    filter: ['all', ['any', ['==', '$type', 'Polygon'], ['==', '$type', 'LineString']], ['==', 'visible', true]],
    'layout': {
      'line-cap': 'round',
      'line-join': 'round'
    },
    paint: {
      'line-color': '#ffffff',
      'line-opacity': [
        'case',
        ['boolean', ['feature-state', 'selected'], false], 0,
        1
      ],
      'line-width': [
        'case',
        ['boolean', ['feature-state', 'hovered'], false], 4,
        0
      ]
    }
  },
  {
    'id': 'annotation_line',
    'type': 'line',
    source: 'annotations',
    metadata: {
      layerType: 'annotation'
    },
    filter: ['all', ['any', ['==', '$type', 'Polygon'], ['==', '$type', 'LineString']], ['==', 'visible', true]],
    'layout': {
      'line-cap': 'round',
      'line-join': 'round'
    },
    paint: {
      'line-color': ['get', 'color'],
      'line-opacity': [
        'case',
        ['boolean', ['feature-state', 'selected'], false], 0,
        1
      ],
      'line-width': 2
    }
  }
]