import { Layer } from "mobility-toolbox-js/ol";
import TrafimageMapboxLayer from "../../layers/TrafimageMapboxLayer";
import DirektverbindungenLayer from "../../layers/DirektverbindungenLayer";
import MapboxStyleLayer from "../../layers/MapboxStyleLayer";
import { DV_HIT_TOLERANCE, DV_KEY } from "../../utils/constants";
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 getDirektverbindungenLayers = () => {
  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",
    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"
  });
  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"
  });
  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_dark"
  });
  const dvDay = new Layer({
    name: DV_DAY_LAYER_KEY,
    key: DV_DAY_LAYER_KEY,
    mapboxLayer: dataLayer,
    visible: true,
    properties: {
      routeType: "day",
      color: "rgb(247, 181, 0)",
      hasInfos: true,
      layerInfoComponent: "DvLayerInfo",
      dataLink: "https://data.sbb.ch/explore/dataset/direktverbindungen/information/",
      deselectOnChangeVisible: true
    }
  });
  const dvNight = new Layer({
    name: DV_NIGHT_LAYER_KEY,
    key: DV_NIGHT_LAYER_KEY,
    mapboxLayer: dataLayer,
    visible: true,
    properties: {
      routeType: "night",
      color: "rgb(0, 110, 179)",
      hasInfos: true,
      layerInfoComponent: "DvLayerInfo",
      dataLink: "https://data.sbb.ch/explore/dataset/direktverbindungen/information/",
      deselectOnChangeVisible: true
    }
  });
  const dvMain = new DirektverbindungenLayer({
    visible: true,
    key: "".concat(DV_KEY, ".main"),
    mapboxLayer: dataLayer,
    properties: {
      isQueryable: true,
      hideInLegend: true,
      dayLayer: dvDay,
      nightLayer: dvNight,
      popupComponent: "DvPopup",
      useOverlay: true,
      priorityFeatureInfo: true,
      // This property will block display of others featureInfos
      highlightPointFeatureFilter: () => false
    }
  });
  return [dataLayer, dvBaseLight, dvBaseDark, dvBaseAerial, dvNight, dvDay, dvMain];
};
//# sourceMappingURL=index.js.map