import MapboxStyleLayer from "../MapboxStyleLayer";

/**
 * Layer for SchmalspurLayer
 * Extends {@link https://mobility-toolbox-js.geops.io/doc/class/build/ol/layers/MapboxStyleLayer%20js~MapboxStyleLayer%20html-offset-anchor}
 * @private
 * @class
 * @param {Object} [options] Layer options.
 */
class SchmalspurLayer extends MapboxStyleLayer {
  onLoad() {
    super.onLoad();
    this.fetchSource();
  }
  fetchSource() {
    var _this$mapboxLayer;
    const {
      url
    } = ((_this$mapboxLayer = this.mapboxLayer) === null || _this$mapboxLayer === void 0 || (_this$mapboxLayer = _this$mapboxLayer.mbMap) === null || _this$mapboxLayer === void 0 ? void 0 : _this$mapboxLayer.getSource("ch.sbb.isb.schmalspur")) || {};
    fetch(url).then(res => res.json()).then(data => {
      this.tuInfos = data["geops.isb.schmalspur.tu_info"];
    })
    // eslint-disable-next-line no-console
    .catch(err => console.error(err));
  }
}
export default SchmalspurLayer;
//# sourceMappingURL=SchmalspurLayer.js.map