import TrafimageMapboxLayer from "../../layers/TrafimageMapboxLayer";
import MapboxStyleLayer from "../../layers/MapboxStyleLayer";
import { DV_HIT_TOLERANCE, DV_KEY } from "../../utils/constants";
import DirektverbindungenSingleLayer from "../../layers/DirektverbindungenLayer/DirektverbindungenSingleLayer";
export const DV_DAY_LAYER_KEY = "".concat(DV_KEY, ".day");
export const DV_NIGHT_LAYER_KEY = "".concat(DV_KEY, ".night");

// eslint-disable-next-line import/prefer-default-export
export const getDirektverbindungenSingleLayers = () => {
  const dataLayer = new TrafimageMapboxLayer({
    name: "".concat(DV_KEY, ".data"),
    visible: true,
    zIndex: -1,
    // Add zIndex as the MapboxLayer would block tiled layers (buslines)
    style: "basemap_bright_direktverbindungen_single",
    hitTolerance: DV_HIT_TOLERANCE,
    properties: {
      hideInLegend: true
    },
    mapOptions: {
      preserveDrawingBuffer: true
    }
  });
  const dvBaseLight = new MapboxStyleLayer({
    name: "".concat(DV_KEY, ".base-light"),
    key: "".concat(DV_KEY, ".base-light"),
    group: "baseLayer",
    properties: {
      previewImage: "ch.sbb.netzkarte",
      isBaseLayer: true,
      deselectOnChangeVisible: true
    },
    visible: true,
    mapboxLayer: dataLayer,
    style: "basemap_bright_direktverbindungen_single"
  });
  const dvBaseDark = new MapboxStyleLayer({
    name: "".concat(DV_KEY, ".base-dark"),
    key: "".concat(DV_KEY, ".base-dark"),
    group: "baseLayer",
    properties: {
      previewImage: "ch.sbb.netzkarte.dark",
      isBaseLayer: true,
      deselectOnChangeVisible: true
    },
    visible: false,
    mapboxLayer: dataLayer,
    style: "basemap_dark_direktverbindungen_single"
  });
  const dvBaseAerial = new MapboxStyleLayer({
    name: "".concat(DV_KEY, ".base-aerial"),
    key: "".concat(DV_KEY, ".base-aerial"),
    group: "baseLayer",
    properties: {
      previewImage: "ch.sbb.netzkarte.luftbild.group",
      isBaseLayer: true,
      deselectOnChangeVisible: true
    },
    visible: false,
    mapboxLayer: dataLayer,
    style: "aerial_sbb_direktverbindungen_single"
  });
  const dvMain = new DirektverbindungenSingleLayer({
    visible: false,
    key: "".concat(DV_KEY, ".main"),
    mapboxLayer: dataLayer,
    styleLayersFilter: _ref => {
      let {
        metadata
      } = _ref;
      return !!metadata && /^ipv_single/.test(metadata === null || metadata === void 0 ? void 0 : metadata["trafimage.filter"]);
    },
    queryRenderedLayersFilter: _ref2 => {
      let {
        metadata
      } = _ref2;
      return !!metadata && /^ipv_single/.test(metadata === null || metadata === void 0 ? void 0 : metadata["trafimage.filter"]);
    },
    properties: {
      popupComponent: "DvPopup",
      useOverlay: true
    }
  });
  return [dataLayer, dvBaseLight, dvBaseDark, dvBaseAerial, dvMain];
};
//# sourceMappingURL=index.js.map