bruce-cesium 1.2.4 → 1.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1934,19 +1934,42 @@
1934
1934
  enumerable: false,
1935
1935
  configurable: true
1936
1936
  });
1937
- Manager.prototype.Init = function () {
1938
- var _a;
1937
+ Manager.prototype.Init = function (params) {
1938
+ var _a, _b, _c, _d, _e;
1939
1939
  return __awaiter(this, void 0, void 0, function () {
1940
- var api, minMax;
1940
+ var isTagItem, tagsToRender, shouldRender, api, minMax;
1941
1941
  var _this = this;
1942
- return __generator(this, function (_b) {
1942
+ return __generator(this, function (_f) {
1943
1943
  if (this.disposed) {
1944
1944
  throw (new Error("This item is disposed."));
1945
1945
  }
1946
+ if (params === null || params === void 0 ? void 0 : params.item) {
1947
+ this.item = params.item;
1948
+ }
1949
+ isTagItem = Boolean(this.item.BruceEntity.ExpandLayers);
1950
+ tagsToRender = isTagItem ? this.item.BruceEntity.SelectedExpandLayers : null;
1951
+ if (!tagsToRender) {
1952
+ tagsToRender = [];
1953
+ }
1954
+ shouldRender = !isTagItem || tagsToRender.length > 0;
1955
+ (_a = this.getter) === null || _a === void 0 ? void 0 : _a.ExcludeMenuItem(this.item.id);
1956
+ this.getter = null;
1957
+ (_b = this.getterSub) === null || _b === void 0 ? void 0 : _b.call(this);
1958
+ this.getterSub = null;
1959
+ (_c = this.viewMonitorRemoval) === null || _c === void 0 ? void 0 : _c.call(this);
1960
+ this.viewMonitorRemoval = null;
1961
+ (_d = this.entityCheckQueue) === null || _d === void 0 ? void 0 : _d.Dispose();
1962
+ this.entityCheckQueue = null;
1963
+ this.visualsManager.RemoveRegos({
1964
+ menuItemId: this.item.id
1965
+ });
1966
+ if (!shouldRender) {
1967
+ return [2 /*return*/];
1968
+ }
1946
1969
  api = this.apiGetter.getApi();
1947
1970
  this.getter = this.sharedGetters.GetOrCreateFilterGetter({
1948
1971
  api: api,
1949
- attrFilter: (_a = this.item.BruceEntity.Filter) !== null && _a !== void 0 ? _a : {},
1972
+ attrFilter: (_e = this.item.BruceEntity.Filter) !== null && _e !== void 0 ? _e : {},
1950
1973
  batchSize: 500,
1951
1974
  typeId: this.item.BruceEntity["EntityType.ID"],
1952
1975
  monitor: this.monitor
@@ -1954,9 +1977,22 @@
1954
1977
  minMax = exports.RenderManager.GetZoomMinMax({
1955
1978
  zoomControl: this.item.CameraZoomSettings
1956
1979
  });
1957
- this.getter.IncludeMenuItem(this.item.id, [], minMax[0], minMax[1]);
1980
+ this.getter.IncludeMenuItem(this.item.id, isTagItem ? tagsToRender : [], minMax[0], minMax[1]);
1958
1981
  this.getterSub = this.getter.OnUpdate.Subscribe(function (entities) {
1959
- _this.onGetterUpdate(entities);
1982
+ if (isTagItem) {
1983
+ _this.onGetterUpdate(entities.filter(function (entity) {
1984
+ var entityTags = entity.Bruce["Layer.ID"];
1985
+ if (!entityTags) {
1986
+ entityTags = [];
1987
+ }
1988
+ return entityTags.some(function (tag) {
1989
+ return tagsToRender.indexOf(tag) !== -1;
1990
+ });
1991
+ }));
1992
+ }
1993
+ else {
1994
+ _this.onGetterUpdate(entities);
1995
+ }
1960
1996
  });
1961
1997
  this.viewMonitorRemoval = this.monitor.Updated().Subscribe(function () {
1962
1998
  _this.entityCheckQueue.Call();
@@ -2079,13 +2115,13 @@
2079
2115
  }
2080
2116
  };
2081
2117
  Manager.prototype.onGetterUpdate = function (entities) {
2082
- var _a, _b;
2118
+ var _a, _b, _c;
2083
2119
  return __awaiter(this, void 0, void 0, function () {
2084
- var typeId_1, cEntities, i, entity, id, cEntity, visual, e_2;
2085
- return __generator(this, function (_c) {
2086
- switch (_c.label) {
2120
+ var typeId_1, cEntities, i, entity, id, cEntity, visual, tagIds, e_2;
2121
+ return __generator(this, function (_d) {
2122
+ switch (_d.label) {
2087
2123
  case 0:
2088
- _c.trys.push([0, 2, , 3]);
2124
+ _d.trys.push([0, 2, , 3]);
2089
2125
  if (this.disposed || this.viewer.isDestroyed()) {
2090
2126
  return [2 /*return*/];
2091
2127
  }
@@ -2102,7 +2138,7 @@
2102
2138
  zoomControl: this.item.CameraZoomSettings
2103
2139
  })];
2104
2140
  case 1:
2105
- cEntities = _c.sent();
2141
+ cEntities = _d.sent();
2106
2142
  for (i = 0; i < entities.length; i++) {
2107
2143
  entity = entities[i];
2108
2144
  id = entity.Bruce.ID;
@@ -2114,6 +2150,7 @@
2114
2150
  menuItemId: this.item.id
2115
2151
  })) === null || _b === void 0 ? void 0 : _b.visual;
2116
2152
  if (!visual || visual != cEntity) {
2153
+ tagIds = (_c = entity.Bruce) === null || _c === void 0 ? void 0 : _c["Layer.ID"];
2117
2154
  this.visualsManager.AddRego({
2118
2155
  rego: {
2119
2156
  entityId: id,
@@ -2121,7 +2158,8 @@
2121
2158
  visual: cEntity,
2122
2159
  priority: 0,
2123
2160
  entityTypeId: entity.Bruce["EntityType.ID"],
2124
- accountId: this.apiGetter.accountId
2161
+ accountId: this.apiGetter.accountId,
2162
+ tagIds: tagIds ? tagIds : []
2125
2163
  }
2126
2164
  });
2127
2165
  }
@@ -2135,7 +2173,7 @@
2135
2173
  }
2136
2174
  return [3 /*break*/, 3];
2137
2175
  case 2:
2138
- e_2 = _c.sent();
2176
+ e_2 = _d.sent();
2139
2177
  console.error(e_2);
2140
2178
  return [3 /*break*/, 3];
2141
2179
  case 3: return [2 /*return*/];
@@ -6018,6 +6056,13 @@
6018
6056
  enumerable: false,
6019
6057
  configurable: true
6020
6058
  });
6059
+ Object.defineProperty(Manager.prototype, "Monitor", {
6060
+ get: function () {
6061
+ return this.sharedMonitor;
6062
+ },
6063
+ enumerable: false,
6064
+ configurable: true
6065
+ });
6021
6066
  /**
6022
6067
  * Renders a given menu item and all its children.
6023
6068
  * Will return the enabled item id.
@@ -6392,10 +6437,7 @@
6392
6437
  }
6393
6438
  ],
6394
6439
  id: bruceModels.ObjectUtils.UId(),
6395
- Children: [],
6396
- showAllLayers: true,
6397
- showAllLayersExcludeBelow: false,
6398
- tagIds: []
6440
+ Children: []
6399
6441
  };
6400
6442
  return [4 /*yield*/, params.manager.RenderItem({
6401
6443
  apiGetter: params.apiGetter,