function I3SBuildingSceneLayerExplorerViewModel(i3sProvider) {
  const that = this;
  this.levels = [];
  this.viewModel = {
    sublayers: [],
    levels: this.levels,
    currentLevel: knockout.observable(),
    selectedLevel: "All",
    topLayers: [
      {
        name: "Select a layer to explore...",
        disable: knockout.observable(true),
        index: -1,
      },
    ],
    currentLayer: knockout.observable(),
    expandClickHandler: expandItemsHandler,
    setOptionDisable: function (option, item) {
      knockout.applyBindingsToNode(option, { disable: item.disable }, item);
    },
    defaultLayer: undefined,
  };

  // Handling change of a layer for exploring
  this.viewModel.currentLayer.subscribe(function (layer) {
    handleTopLayerSelector(layer, that.viewModel);
  });

  // Setting a sublayers tree to the viewModel
  const sublayers = i3sProvider.sublayers;
  for (let i = 0; i < sublayers.length; i++) {
    trackSublayer(sublayers[i], this.viewModel);
    const topLayer = addTopLayer(sublayers[i], this.viewModel);
    if (
      defined(topLayer) &&
      (isOverview(topLayer) ||
        (!defined(this.viewModel.defaultLayer) && isFullModel(topLayer)))
    ) {
      this.viewModel.defaultLayer = topLayer;
    }
  }
  // There is no Full Model and/or Overview
  if (this.viewModel.topLayers.length === 1 && sublayers.length > 0) {
    i3sProvider.show = false;
    const fullModel = {
      name: "Full Model",
      modelName: "FullModel",
      visibility: i3sProvider.show,
      sublayers: i3sProvider.sublayers,
    };
    this.viewModel.defaultLayer = addTopLayer(fullModel, this.viewModel);
    this.viewModel.currentLayer.subscribe(function (layer) {
      i3sProvider.show = isFullModel(layer);
    });
  } else if (this.viewModel.topLayers.length === 1) {
    this.viewModel.topLayers[0].name = "Building layers not found";
  }

  // Setting levels to the viewModel
  setLevels(i3sProvider, this.levels);

  // Filtering by levels
  this.viewModel.currentLevel.subscribe(function (newValue) {
    if (newValue !== "All") {
      i3sProvider.filterByAttributes([
        {
          name: "BldgLevel",
          values: [newValue],
        },
      ]);
    } else {
      i3sProvider.filterByAttributes();
    }
  });

  return this.viewModel;
}
The view model for {@link I3SBuildingSceneLayerExplorer}.
@alias I3sBslExplorerViewModel
@constructor

@param {I3SDataProvider} i3sProvider I3S Data provider instance.