bruce-cesium 5.6.1 → 5.6.2
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.
- package/dist/bruce-cesium.es5.js +112 -72
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +111 -71
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +111 -71
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/render-managers/entities/entities-render-manager.d.ts +1 -0
- package/package.json +1 -1
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -12684,6 +12684,10 @@
|
|
|
12684
12684
|
this.zoomControl = [];
|
|
12685
12685
|
// Scenario for retrieving Entities.
|
|
12686
12686
|
this.scenario = null;
|
|
12687
|
+
// Type IDs that we'll allow to be rendered when receiving Entities.
|
|
12688
|
+
// This is a band-aid for that fact that locally sourced Entities across Types are trickier to filter out.
|
|
12689
|
+
// So we request source info and use that to figure the situation out.
|
|
12690
|
+
this.allowedTypeIDs = [];
|
|
12687
12691
|
const { viewer, apiGetter, monitor, item, register: visualsManager, sharedGetters } = params;
|
|
12688
12692
|
this.viewer = viewer;
|
|
12689
12693
|
this.sharedGetters = sharedGetters;
|
|
@@ -12697,81 +12701,115 @@
|
|
|
12697
12701
|
}
|
|
12698
12702
|
}
|
|
12699
12703
|
Init(params) {
|
|
12700
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
12701
12704
|
if (this.disposed) {
|
|
12702
12705
|
throw (new Error("This item is disposed."));
|
|
12703
12706
|
}
|
|
12704
12707
|
if (params === null || params === void 0 ? void 0 : params.item) {
|
|
12705
12708
|
this.item = params.item;
|
|
12706
12709
|
}
|
|
12707
|
-
|
|
12708
|
-
|
|
12709
|
-
this.
|
|
12710
|
-
|
|
12711
|
-
|
|
12712
|
-
|
|
12713
|
-
|
|
12714
|
-
|
|
12715
|
-
|
|
12716
|
-
|
|
12710
|
+
(async () => {
|
|
12711
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
12712
|
+
if (this.disposed) {
|
|
12713
|
+
return;
|
|
12714
|
+
}
|
|
12715
|
+
try {
|
|
12716
|
+
// Get type sources to look for locally sourced entity types.
|
|
12717
|
+
if ((_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a["EntityType.ID"]) {
|
|
12718
|
+
this.allowedTypeIDs = [];
|
|
12719
|
+
this.allowedTypeIDs.push((_b = this.item.BruceEntity) === null || _b === void 0 ? void 0 : _b["EntityType.ID"]);
|
|
12720
|
+
try {
|
|
12721
|
+
const api = this.apiGetter.getApi();
|
|
12722
|
+
const typeId = (_c = this.item.BruceEntity) === null || _c === void 0 ? void 0 : _c["EntityType.ID"];
|
|
12723
|
+
const { Items: items } = await api.GET(`entitytype/${typeId}/sources`);
|
|
12724
|
+
for (const item of items) {
|
|
12725
|
+
if (item.Type == 0 && item["Source.EntityType.ID"] && (item.Kind == "ENTITY" || item.Kind == "UNSET")) {
|
|
12726
|
+
const typeId = item["Source.EntityType.ID"];
|
|
12727
|
+
if (typeId && !this.allowedTypeIDs.includes(typeId)) {
|
|
12728
|
+
this.allowedTypeIDs.push(typeId);
|
|
12729
|
+
}
|
|
12730
|
+
}
|
|
12731
|
+
}
|
|
12732
|
+
}
|
|
12733
|
+
catch (e) {
|
|
12734
|
+
console.error(e);
|
|
12735
|
+
}
|
|
12717
12736
|
}
|
|
12718
|
-
|
|
12719
|
-
|
|
12720
|
-
|
|
12721
|
-
|
|
12722
|
-
|
|
12723
|
-
|
|
12724
|
-
|
|
12725
|
-
|
|
12726
|
-
|
|
12727
|
-
|
|
12728
|
-
|
|
12729
|
-
|
|
12730
|
-
|
|
12731
|
-
|
|
12732
|
-
|
|
12733
|
-
|
|
12734
|
-
|
|
12735
|
-
|
|
12736
|
-
|
|
12737
|
-
|
|
12738
|
-
|
|
12739
|
-
|
|
12740
|
-
|
|
12741
|
-
|
|
12742
|
-
|
|
12743
|
-
|
|
12744
|
-
|
|
12745
|
-
|
|
12746
|
-
|
|
12747
|
-
|
|
12748
|
-
|
|
12749
|
-
|
|
12750
|
-
|
|
12751
|
-
|
|
12752
|
-
|
|
12753
|
-
|
|
12754
|
-
|
|
12755
|
-
|
|
12756
|
-
|
|
12757
|
-
|
|
12758
|
-
|
|
12759
|
-
|
|
12760
|
-
|
|
12761
|
-
|
|
12762
|
-
|
|
12763
|
-
|
|
12764
|
-
|
|
12765
|
-
|
|
12766
|
-
|
|
12767
|
-
|
|
12768
|
-
|
|
12769
|
-
|
|
12770
|
-
|
|
12771
|
-
|
|
12772
|
-
|
|
12737
|
+
if (this.disposed) {
|
|
12738
|
+
return;
|
|
12739
|
+
}
|
|
12740
|
+
this.zoomControl = this.item.CameraZoomSettings;
|
|
12741
|
+
if (!((_d = this.zoomControl) === null || _d === void 0 ? void 0 : _d.length)) {
|
|
12742
|
+
this.zoomControl = [
|
|
12743
|
+
{
|
|
12744
|
+
MinZoom: 0,
|
|
12745
|
+
MaxZoom: 200000,
|
|
12746
|
+
DisplayType: BModels.ZoomControl.EDisplayType.Model3D,
|
|
12747
|
+
LODCategoryID: "glb",
|
|
12748
|
+
LODLevel: 0,
|
|
12749
|
+
StyleID: 0
|
|
12750
|
+
}
|
|
12751
|
+
];
|
|
12752
|
+
}
|
|
12753
|
+
this.renderPriority = this.item.renderPriority;
|
|
12754
|
+
if (this.renderPriority == null) {
|
|
12755
|
+
this.renderPriority = 1;
|
|
12756
|
+
}
|
|
12757
|
+
if (this.useGeojson && this.zoomControl.length > 1) {
|
|
12758
|
+
console.warn("Geojson rendering does not support multiple zoom controls. Only the first one will be used.");
|
|
12759
|
+
this.zoomControl = [this.zoomControl[0]];
|
|
12760
|
+
}
|
|
12761
|
+
this.scenario = (_e = this.item.BruceEntity) === null || _e === void 0 ? void 0 : _e.Scenario;
|
|
12762
|
+
const isTagItem = Boolean(this.item.BruceEntity.ExpandLayers);
|
|
12763
|
+
let tagsToRender = isTagItem ? this.item.BruceEntity.SelectedExpandLayers : null;
|
|
12764
|
+
if (!tagsToRender) {
|
|
12765
|
+
tagsToRender = [];
|
|
12766
|
+
}
|
|
12767
|
+
tagsToRender = [].concat(tagsToRender);
|
|
12768
|
+
const shouldRender = !isTagItem || tagsToRender.length > 0;
|
|
12769
|
+
this.unsetGetter();
|
|
12770
|
+
(_f = this.viewMonitorRemoval) === null || _f === void 0 ? void 0 : _f.call(this);
|
|
12771
|
+
this.viewMonitorRemoval = null;
|
|
12772
|
+
(_g = this.entityCheckQueue) === null || _g === void 0 ? void 0 : _g.Dispose();
|
|
12773
|
+
this.entityCheckQueue = null;
|
|
12774
|
+
clearInterval(this.renderQueueInterval);
|
|
12775
|
+
this.renderQueueInterval = null;
|
|
12776
|
+
this.renderQueue = [];
|
|
12777
|
+
// Remove just the ones that shouldn't be rendered.
|
|
12778
|
+
// Eg: for a tag menu item we can see what tags are selected and only render those.
|
|
12779
|
+
if (shouldRender) {
|
|
12780
|
+
this.visualsManager.RemoveRegos({
|
|
12781
|
+
menuItemId: this.item.id,
|
|
12782
|
+
retainTagIds: tagsToRender
|
|
12783
|
+
});
|
|
12784
|
+
(_h = this.clustering) === null || _h === void 0 ? void 0 : _h.Dispose();
|
|
12785
|
+
}
|
|
12786
|
+
else {
|
|
12787
|
+
this.visualsManager.RemoveRegos({
|
|
12788
|
+
menuItemId: this.item.id
|
|
12789
|
+
});
|
|
12790
|
+
(_j = this.clustering) === null || _j === void 0 ? void 0 : _j.Dispose();
|
|
12791
|
+
return;
|
|
12792
|
+
}
|
|
12793
|
+
if (this.item.enableClustering) {
|
|
12794
|
+
this.clustering = new PointClustering(this.visualsManager, this.item.id, (_k = this.item) === null || _k === void 0 ? void 0 : _k.clustering);
|
|
12795
|
+
}
|
|
12796
|
+
this.setGetter();
|
|
12797
|
+
this.viewMonitorRemoval = this.monitor.Updated().Subscribe(() => {
|
|
12798
|
+
this.entityCheckQueue.Call();
|
|
12799
|
+
});
|
|
12800
|
+
this.entityCheckQueue = new BModels.DelayQueue(() => {
|
|
12801
|
+
// Don't bother checking for zoom control changes if we only have 1 item.
|
|
12802
|
+
// We'll let Cesium handle hide/show at max zoom range.
|
|
12803
|
+
const shouldCheck = this.zoomControl && this.zoomControl.length > 1;
|
|
12804
|
+
if (shouldCheck) {
|
|
12805
|
+
this.doEntityCheck(Object.keys(this.renderedEntities));
|
|
12806
|
+
}
|
|
12807
|
+
}, 3000);
|
|
12773
12808
|
}
|
|
12774
|
-
|
|
12809
|
+
catch (e) {
|
|
12810
|
+
console.error(e);
|
|
12811
|
+
}
|
|
12812
|
+
})();
|
|
12775
12813
|
}
|
|
12776
12814
|
setGetter() {
|
|
12777
12815
|
var _a, _b, _c;
|
|
@@ -12994,9 +13032,11 @@
|
|
|
12994
13032
|
return;
|
|
12995
13033
|
}
|
|
12996
13034
|
// Ensuring a re-render call with improper entity ids doesn't cause them to render here.
|
|
12997
|
-
|
|
12998
|
-
|
|
12999
|
-
|
|
13035
|
+
if (this.allowedTypeIDs) {
|
|
13036
|
+
const typeId = (_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a["EntityType.ID"];
|
|
13037
|
+
if (typeId) {
|
|
13038
|
+
entities = entities.filter(x => { var _a; return this.allowedTypeIDs.includes((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a["EntityType.ID"]); });
|
|
13039
|
+
}
|
|
13000
13040
|
}
|
|
13001
13041
|
if (this.useGeojson) {
|
|
13002
13042
|
const zoomItem = this.zoomControl[0];
|
|
@@ -31517,7 +31557,7 @@
|
|
|
31517
31557
|
}
|
|
31518
31558
|
}
|
|
31519
31559
|
|
|
31520
|
-
const VERSION = "5.6.
|
|
31560
|
+
const VERSION = "5.6.2";
|
|
31521
31561
|
|
|
31522
31562
|
exports.VERSION = VERSION;
|
|
31523
31563
|
exports.isHistoricMetadataChanged = isHistoricMetadataChanged;
|