bruce-cesium 4.6.6 → 4.6.7
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 +329 -188
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +327 -186
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/getters/entity-filter-getter.js +244 -180
- package/dist/lib/rendering/getters/entity-filter-getter.js.map +1 -1
- package/dist/lib/rendering/getters/entity-globe.js +6 -6
- package/dist/lib/rendering/getters/entity-globe.js.map +1 -1
- package/dist/lib/rendering/render-managers/common/shared-getters.js +114 -0
- package/dist/lib/rendering/render-managers/common/shared-getters.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/render-managers/common/shared-getters.d.ts +15 -0
- package/package.json +1 -1
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { BruceEvent, Cartes, Entity as Entity$1, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, ProjectViewTile, DelayQueue, EntityLod, Bounds, ZoomControl, EntityRelationType, ENVIRONMENT, EntityHistoricData, Tileset, EntityCoords, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark,
|
|
1
|
+
import { BruceEvent, Cartes, Entity as Entity$1, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, ProjectViewTile, DelayQueue, EntityLod, Bounds, ZoomControl, EntityRelationType, ENVIRONMENT, EntityHistoricData, Tileset, EntityCoords, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, Camera, ProjectViewLegacyTile, AbstractApi, EntityAttribute, EntityAttachment, EntityAttachmentType, Session } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle,
|
|
3
|
+
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, Entity, DistanceDisplayCondition, JulianDate, ClassificationType, ArcType, CornerType, ShadowMode, ConstantProperty, ConstantPositionProperty, HorizontalOrigin, VerticalOrigin, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, OrthographicFrustum, EasingFunction, NearFarScalar, SceneTransforms, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, CesiumInspector, defined, ClockRange, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, Quaternion, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
|
|
4
4
|
|
|
5
5
|
/*! *****************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -16115,22 +16115,22 @@ function getCellSizeFromHeight(height) {
|
|
|
16115
16115
|
return 0.01;
|
|
16116
16116
|
}
|
|
16117
16117
|
if (height < 5000) {
|
|
16118
|
-
return 0.
|
|
16118
|
+
return 0.04;
|
|
16119
16119
|
}
|
|
16120
16120
|
else if (height < 10000) {
|
|
16121
|
-
return 0.
|
|
16121
|
+
return 0.15;
|
|
16122
16122
|
}
|
|
16123
16123
|
else if (height < 30000) {
|
|
16124
|
-
return 0.
|
|
16124
|
+
return 0.5;
|
|
16125
16125
|
}
|
|
16126
16126
|
else if (height < 70000) {
|
|
16127
|
-
return 0.
|
|
16127
|
+
return 0.5;
|
|
16128
16128
|
}
|
|
16129
16129
|
else if (height < 100000) {
|
|
16130
|
-
return
|
|
16130
|
+
return 1;
|
|
16131
16131
|
}
|
|
16132
16132
|
else if (height < 150000) {
|
|
16133
|
-
return
|
|
16133
|
+
return 1;
|
|
16134
16134
|
}
|
|
16135
16135
|
else if (height < 200000) {
|
|
16136
16136
|
return 1.5;
|
|
@@ -16477,7 +16477,8 @@ var EntityFilterGetter;
|
|
|
16477
16477
|
}
|
|
16478
16478
|
var abortController = this.getterLoopAbortControllers[abortId] = new AbortController();
|
|
16479
16479
|
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16480
|
-
var MIN_HEIGHT, MAX_HEIGHT, PAGE_SIZE, retryAttempts, retryDelay, prevFirstId, prevLastId, prevTicks, alt, cells, curCellIndex, postedScanning, postedLoading, total,
|
|
16480
|
+
var MIN_HEIGHT, MAX_HEIGHT, PAGE_SIZE, retryAttempts, retryDelay, prevFirstId, prevLastId, prevTicks, alt, cells, curCellIndex, postedScanning, postedLoading, total, _loop_1, this_1, state_1;
|
|
16481
|
+
var _this = this;
|
|
16481
16482
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
16482
16483
|
return __generator(this, function (_j) {
|
|
16483
16484
|
switch (_j.label) {
|
|
@@ -16520,142 +16521,172 @@ var EntityFilterGetter;
|
|
|
16520
16521
|
postedScanning = false;
|
|
16521
16522
|
postedLoading = false;
|
|
16522
16523
|
total = 0;
|
|
16524
|
+
_loop_1 = function () {
|
|
16525
|
+
var curCell, entities_1, integrity, i, entity, first, last, e_1;
|
|
16526
|
+
return __generator(this, function (_k) {
|
|
16527
|
+
switch (_k.label) {
|
|
16528
|
+
case 0:
|
|
16529
|
+
if (!(retryDelay > 0)) return [3 /*break*/, 2];
|
|
16530
|
+
return [4 /*yield*/, delay(retryDelay)];
|
|
16531
|
+
case 1:
|
|
16532
|
+
_k.sent();
|
|
16533
|
+
_k.label = 2;
|
|
16534
|
+
case 2:
|
|
16535
|
+
if (this_1.getterLoopId != loopId) {
|
|
16536
|
+
return [2 /*return*/, "break"];
|
|
16537
|
+
}
|
|
16538
|
+
if (!postedScanning) {
|
|
16539
|
+
this_1.postStatus({ msg: EStatus.Scanning, revoking: false });
|
|
16540
|
+
postedScanning = true;
|
|
16541
|
+
}
|
|
16542
|
+
curCell = cells[curCellIndex];
|
|
16543
|
+
if (curCell.IsFetched()) {
|
|
16544
|
+
curCell.Fetching = false;
|
|
16545
|
+
curCellIndex += 1;
|
|
16546
|
+
if (cells[curCellIndex]) {
|
|
16547
|
+
cells[curCellIndex].Fetching = true;
|
|
16548
|
+
}
|
|
16549
|
+
else {
|
|
16550
|
+
curCellIndex = null;
|
|
16551
|
+
}
|
|
16552
|
+
(_b = this_1.onScanUpdate) === null || _b === void 0 ? void 0 : _b.Trigger(cells);
|
|
16553
|
+
return [2 /*return*/, "continue"];
|
|
16554
|
+
}
|
|
16555
|
+
_k.label = 3;
|
|
16556
|
+
case 3:
|
|
16557
|
+
_k.trys.push([3, 5, , 6]);
|
|
16558
|
+
entities_1 = [];
|
|
16559
|
+
return [4 /*yield*/, SharedGetters.Queue.Run("Loading Entities from Menu Item that loads Entity Type: " + this_1.typeId, function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16560
|
+
var _a;
|
|
16561
|
+
return __generator(this, function (_b) {
|
|
16562
|
+
switch (_b.label) {
|
|
16563
|
+
case 0:
|
|
16564
|
+
if (abortController.signal.aborted || !((_a = this.GetMenuItems()) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
16565
|
+
return [2 /*return*/];
|
|
16566
|
+
}
|
|
16567
|
+
return [4 /*yield*/, Entity$1.GetList({
|
|
16568
|
+
api: this.api,
|
|
16569
|
+
historicKey: this.historicAttrKey,
|
|
16570
|
+
historicPoint: this.historicAttrDateTime,
|
|
16571
|
+
schemaId: this.schemaId,
|
|
16572
|
+
filter: {
|
|
16573
|
+
pageSize: PAGE_SIZE,
|
|
16574
|
+
pageIndex: curCell.FetchPageIndex,
|
|
16575
|
+
entityTypeId: this.typeId,
|
|
16576
|
+
layerIds: this.tagIds,
|
|
16577
|
+
// Any tag specified will be allowed.
|
|
16578
|
+
layerIdsOperator: "in",
|
|
16579
|
+
bounds: curCell.GetBounds(),
|
|
16580
|
+
sortOrder: Api.ESortOrder.Asc,
|
|
16581
|
+
entityTypeConditions: this.attrFilter
|
|
16582
|
+
},
|
|
16583
|
+
viaCdn: this.viaCdn,
|
|
16584
|
+
migrated: true,
|
|
16585
|
+
req: {
|
|
16586
|
+
// If we are passing in an abort, we MUST pass in noCache.
|
|
16587
|
+
// Otherwise we will cache an aborted request.
|
|
16588
|
+
noCache: true,
|
|
16589
|
+
abortSignal: abortController.signal
|
|
16590
|
+
}
|
|
16591
|
+
})];
|
|
16592
|
+
case 1:
|
|
16593
|
+
entities_1 = (_b.sent()).entities;
|
|
16594
|
+
return [2 /*return*/];
|
|
16595
|
+
}
|
|
16596
|
+
});
|
|
16597
|
+
}); })];
|
|
16598
|
+
case 4:
|
|
16599
|
+
_k.sent();
|
|
16600
|
+
integrity = this_1.getIntegrityId();
|
|
16601
|
+
if (loopIntegrity == integrity && entities_1) {
|
|
16602
|
+
(_c = this_1.onUpdate) === null || _c === void 0 ? void 0 : _c.Trigger(entities_1);
|
|
16603
|
+
}
|
|
16604
|
+
if (this_1.gatheredIntegrity != integrity) {
|
|
16605
|
+
this_1.gatheredIntegrity = integrity;
|
|
16606
|
+
this_1.gatheredEntityIds = [];
|
|
16607
|
+
}
|
|
16608
|
+
// Add to the integrity list for any new IDs found.
|
|
16609
|
+
// This lets us keep track of all IDs we've found within the same integrity for historic data.
|
|
16610
|
+
if (this_1.historicAttrKey) {
|
|
16611
|
+
for (i = 0; i < entities_1.length; i++) {
|
|
16612
|
+
entity = entities_1[i];
|
|
16613
|
+
if (!this_1.gatheredEntityIds.includes(entity.Bruce.ID)) {
|
|
16614
|
+
this_1.gatheredEntityIds.push(entity.Bruce.ID);
|
|
16615
|
+
}
|
|
16616
|
+
}
|
|
16617
|
+
}
|
|
16618
|
+
if (this_1.getterLoopId != loopId) {
|
|
16619
|
+
return [2 /*return*/, "break"];
|
|
16620
|
+
}
|
|
16621
|
+
if (entities_1.length) {
|
|
16622
|
+
total += entities_1.length;
|
|
16623
|
+
}
|
|
16624
|
+
if (!postedLoading) {
|
|
16625
|
+
this_1.postStatus({ msg: EStatus.Loading, revoking: false });
|
|
16626
|
+
postedLoading = true;
|
|
16627
|
+
}
|
|
16628
|
+
// Only mark as fetched when ALL pages are done.
|
|
16629
|
+
// Known issue where external sources may return less than page size.
|
|
16630
|
+
// Right now we're making it as fetched as we're siding with the majority use-case.
|
|
16631
|
+
if (entities_1.length <= 0 || entities_1.length < PAGE_SIZE) {
|
|
16632
|
+
curCell.Fetched = true;
|
|
16633
|
+
curCell.Fetching = false;
|
|
16634
|
+
(_d = this_1.onScanUpdate) === null || _d === void 0 ? void 0 : _d.Trigger(cells);
|
|
16635
|
+
return [2 /*return*/, "continue"];
|
|
16636
|
+
}
|
|
16637
|
+
// Checking to make sure it's not just the same batch over and over again.
|
|
16638
|
+
if (entities_1.length > 0) {
|
|
16639
|
+
first = (_f = (_e = entities_1[0]) === null || _e === void 0 ? void 0 : _e.Bruce) === null || _f === void 0 ? void 0 : _f.ID;
|
|
16640
|
+
last = (_h = (_g = entities_1[entities_1.length - 1]) === null || _g === void 0 ? void 0 : _g.Bruce) === null || _h === void 0 ? void 0 : _h.ID;
|
|
16641
|
+
if (prevFirstId == first && prevLastId == last) {
|
|
16642
|
+
prevTicks += 1;
|
|
16643
|
+
if (prevTicks > 3) {
|
|
16644
|
+
return [2 /*return*/, "break"];
|
|
16645
|
+
}
|
|
16646
|
+
}
|
|
16647
|
+
else {
|
|
16648
|
+
prevFirstId = first;
|
|
16649
|
+
prevLastId = last;
|
|
16650
|
+
prevTicks = 0;
|
|
16651
|
+
}
|
|
16652
|
+
}
|
|
16653
|
+
curCell.FetchPageIndex++;
|
|
16654
|
+
// Request passed so let's assume it was server hiccup and refresh counts.
|
|
16655
|
+
retryAttempts = MAX_RETRY_ATTEMPTS;
|
|
16656
|
+
retryDelay = 0;
|
|
16657
|
+
return [3 /*break*/, 6];
|
|
16658
|
+
case 5:
|
|
16659
|
+
e_1 = _k.sent();
|
|
16660
|
+
// Ignore abort errors.
|
|
16661
|
+
if (e_1 && typeof e_1 === "object" && e_1.name == "AbortError") {
|
|
16662
|
+
return [2 /*return*/, "break"];
|
|
16663
|
+
}
|
|
16664
|
+
console.error(e_1);
|
|
16665
|
+
if (this_1.getterLoopId != loopId) {
|
|
16666
|
+
return [2 /*return*/, "break"];
|
|
16667
|
+
}
|
|
16668
|
+
// Request failed so let's add a delay and try again soon.
|
|
16669
|
+
retryDelay += RETRY_DELAY_INCREMENT;
|
|
16670
|
+
retryAttempts -= 1;
|
|
16671
|
+
return [3 /*break*/, 6];
|
|
16672
|
+
case 6: return [4 /*yield*/, delay(REQUEST_PAGE_DELAY)];
|
|
16673
|
+
case 7:
|
|
16674
|
+
_k.sent();
|
|
16675
|
+
return [2 /*return*/];
|
|
16676
|
+
}
|
|
16677
|
+
});
|
|
16678
|
+
};
|
|
16679
|
+
this_1 = this;
|
|
16523
16680
|
_j.label = 5;
|
|
16524
16681
|
case 5:
|
|
16525
|
-
if (!(retryAttempts > 0 && curCellIndex != null)) return [3 /*break*/,
|
|
16526
|
-
|
|
16527
|
-
return [4 /*yield*/, delay(retryDelay)];
|
|
16682
|
+
if (!(retryAttempts > 0 && curCellIndex != null)) return [3 /*break*/, 7];
|
|
16683
|
+
return [5 /*yield**/, _loop_1()];
|
|
16528
16684
|
case 6:
|
|
16529
|
-
_j.sent();
|
|
16530
|
-
|
|
16531
|
-
|
|
16532
|
-
if (this.getterLoopId != loopId) {
|
|
16533
|
-
return [3 /*break*/, 13];
|
|
16534
|
-
}
|
|
16535
|
-
if (!postedScanning) {
|
|
16536
|
-
this.postStatus({ msg: EStatus.Scanning, revoking: false });
|
|
16537
|
-
postedScanning = true;
|
|
16538
|
-
}
|
|
16539
|
-
curCell = cells[curCellIndex];
|
|
16540
|
-
if (curCell.IsFetched()) {
|
|
16541
|
-
curCell.Fetching = false;
|
|
16542
|
-
curCellIndex += 1;
|
|
16543
|
-
if (cells[curCellIndex]) {
|
|
16544
|
-
cells[curCellIndex].Fetching = true;
|
|
16545
|
-
}
|
|
16546
|
-
else {
|
|
16547
|
-
curCellIndex = null;
|
|
16548
|
-
}
|
|
16549
|
-
(_b = this.onScanUpdate) === null || _b === void 0 ? void 0 : _b.Trigger(cells);
|
|
16550
|
-
return [3 /*break*/, 5];
|
|
16551
|
-
}
|
|
16552
|
-
_j.label = 8;
|
|
16553
|
-
case 8:
|
|
16554
|
-
_j.trys.push([8, 10, , 11]);
|
|
16555
|
-
return [4 /*yield*/, Entity$1.GetList({
|
|
16556
|
-
api: this.api,
|
|
16557
|
-
historicKey: this.historicAttrKey,
|
|
16558
|
-
historicPoint: this.historicAttrDateTime,
|
|
16559
|
-
schemaId: this.schemaId,
|
|
16560
|
-
filter: {
|
|
16561
|
-
pageSize: PAGE_SIZE,
|
|
16562
|
-
pageIndex: curCell.FetchPageIndex,
|
|
16563
|
-
entityTypeId: this.typeId,
|
|
16564
|
-
layerIds: this.tagIds,
|
|
16565
|
-
// Any tag specified will be allowed.
|
|
16566
|
-
layerIdsOperator: "in",
|
|
16567
|
-
bounds: curCell.GetBounds(),
|
|
16568
|
-
sortOrder: Api.ESortOrder.Asc,
|
|
16569
|
-
entityTypeConditions: this.attrFilter
|
|
16570
|
-
},
|
|
16571
|
-
viaCdn: this.viaCdn,
|
|
16572
|
-
migrated: true,
|
|
16573
|
-
req: {
|
|
16574
|
-
// If we are passing in an abort, we MUST pass in noCache.
|
|
16575
|
-
// Otherwise we will cache an aborted request.
|
|
16576
|
-
noCache: true,
|
|
16577
|
-
abortSignal: abortController.signal
|
|
16578
|
-
}
|
|
16579
|
-
})];
|
|
16580
|
-
case 9:
|
|
16581
|
-
entities = (_j.sent()).entities;
|
|
16582
|
-
integrity = this.getIntegrityId();
|
|
16583
|
-
if (loopIntegrity == integrity && entities) {
|
|
16584
|
-
(_c = this.onUpdate) === null || _c === void 0 ? void 0 : _c.Trigger(entities);
|
|
16585
|
-
}
|
|
16586
|
-
if (this.gatheredIntegrity != integrity) {
|
|
16587
|
-
this.gatheredIntegrity = integrity;
|
|
16588
|
-
this.gatheredEntityIds = [];
|
|
16589
|
-
}
|
|
16590
|
-
// Add to the integrity list for any new IDs found.
|
|
16591
|
-
// This lets us keep track of all IDs we've found within the same integrity for historic data.
|
|
16592
|
-
if (this.historicAttrKey) {
|
|
16593
|
-
for (i = 0; i < entities.length; i++) {
|
|
16594
|
-
entity = entities[i];
|
|
16595
|
-
if (!this.gatheredEntityIds.includes(entity.Bruce.ID)) {
|
|
16596
|
-
this.gatheredEntityIds.push(entity.Bruce.ID);
|
|
16597
|
-
}
|
|
16598
|
-
}
|
|
16599
|
-
}
|
|
16600
|
-
if (this.getterLoopId != loopId) {
|
|
16601
|
-
return [3 /*break*/, 13];
|
|
16602
|
-
}
|
|
16603
|
-
if (entities.length) {
|
|
16604
|
-
total += entities.length;
|
|
16605
|
-
}
|
|
16606
|
-
if (!postedLoading) {
|
|
16607
|
-
this.postStatus({ msg: EStatus.Loading, revoking: false });
|
|
16608
|
-
postedLoading = true;
|
|
16609
|
-
}
|
|
16610
|
-
// Only mark as fetched when ALL pages are done.
|
|
16611
|
-
// Known issue where external sources may return less than page size.
|
|
16612
|
-
// Right now we're making it as fetched as we're siding with the majority use-case.
|
|
16613
|
-
if (entities.length <= 0 || entities.length < PAGE_SIZE) {
|
|
16614
|
-
curCell.Fetched = true;
|
|
16615
|
-
curCell.Fetching = false;
|
|
16616
|
-
(_d = this.onScanUpdate) === null || _d === void 0 ? void 0 : _d.Trigger(cells);
|
|
16617
|
-
return [3 /*break*/, 5];
|
|
16618
|
-
}
|
|
16619
|
-
// Checking to make sure it's not just the same batch over and over again.
|
|
16620
|
-
if (entities.length > 0) {
|
|
16621
|
-
first = (_f = (_e = entities[0]) === null || _e === void 0 ? void 0 : _e.Bruce) === null || _f === void 0 ? void 0 : _f.ID;
|
|
16622
|
-
last = (_h = (_g = entities[entities.length - 1]) === null || _g === void 0 ? void 0 : _g.Bruce) === null || _h === void 0 ? void 0 : _h.ID;
|
|
16623
|
-
if (prevFirstId == first && prevLastId == last) {
|
|
16624
|
-
prevTicks += 1;
|
|
16625
|
-
if (prevTicks > 3) {
|
|
16626
|
-
return [3 /*break*/, 13];
|
|
16627
|
-
}
|
|
16628
|
-
}
|
|
16629
|
-
else {
|
|
16630
|
-
prevFirstId = first;
|
|
16631
|
-
prevLastId = last;
|
|
16632
|
-
prevTicks = 0;
|
|
16633
|
-
}
|
|
16634
|
-
}
|
|
16635
|
-
curCell.FetchPageIndex++;
|
|
16636
|
-
// Request passed so let's assume it was server hiccup and refresh counts.
|
|
16637
|
-
retryAttempts = MAX_RETRY_ATTEMPTS;
|
|
16638
|
-
retryDelay = 0;
|
|
16639
|
-
return [3 /*break*/, 11];
|
|
16640
|
-
case 10:
|
|
16641
|
-
e_1 = _j.sent();
|
|
16642
|
-
// Ignore abort errors.
|
|
16643
|
-
if (e_1 && typeof e_1 === "object" && e_1.name == "AbortError") {
|
|
16644
|
-
return [3 /*break*/, 13];
|
|
16645
|
-
}
|
|
16646
|
-
console.error(e_1);
|
|
16647
|
-
if (this.getterLoopId != loopId) {
|
|
16648
|
-
return [3 /*break*/, 13];
|
|
16649
|
-
}
|
|
16650
|
-
// Request failed so let's add a delay and try again soon.
|
|
16651
|
-
retryDelay += RETRY_DELAY_INCREMENT;
|
|
16652
|
-
retryAttempts -= 1;
|
|
16653
|
-
return [3 /*break*/, 11];
|
|
16654
|
-
case 11: return [4 /*yield*/, delay(REQUEST_PAGE_DELAY)];
|
|
16655
|
-
case 12:
|
|
16656
|
-
_j.sent();
|
|
16685
|
+
state_1 = _j.sent();
|
|
16686
|
+
if (state_1 === "break")
|
|
16687
|
+
return [3 /*break*/, 7];
|
|
16657
16688
|
return [3 /*break*/, 5];
|
|
16658
|
-
case
|
|
16689
|
+
case 7:
|
|
16659
16690
|
if (postedLoading) {
|
|
16660
16691
|
this.postStatus({ msg: EStatus.Loading, revoking: true });
|
|
16661
16692
|
}
|
|
@@ -16685,7 +16716,8 @@ var EntityFilterGetter;
|
|
|
16685
16716
|
this.historicRefreshAbortController = null;
|
|
16686
16717
|
}
|
|
16687
16718
|
(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16688
|
-
var
|
|
16719
|
+
var _loop_2, this_2, i, state_2, e_2;
|
|
16720
|
+
var _this = this;
|
|
16689
16721
|
var _a;
|
|
16690
16722
|
return __generator(this, function (_b) {
|
|
16691
16723
|
switch (_b.label) {
|
|
@@ -16693,57 +16725,87 @@ var EntityFilterGetter;
|
|
|
16693
16725
|
_b.label = 1;
|
|
16694
16726
|
case 1:
|
|
16695
16727
|
_b.trys.push([1, 6, , 7]);
|
|
16728
|
+
_loop_2 = function (i) {
|
|
16729
|
+
var batch, controller, entities;
|
|
16730
|
+
return __generator(this, function (_c) {
|
|
16731
|
+
switch (_c.label) {
|
|
16732
|
+
case 0:
|
|
16733
|
+
batch = this_2.gatheredEntityIds.slice(i, i + SCAN_BATCH_SIZE);
|
|
16734
|
+
if (!batch.length) {
|
|
16735
|
+
return [2 /*return*/, "break"];
|
|
16736
|
+
}
|
|
16737
|
+
controller = this_2.historicRefreshAbortController = new AbortController();
|
|
16738
|
+
entities = [];
|
|
16739
|
+
return [4 /*yield*/, SharedGetters.Queue.Run("Refreshing historic data in Menu Item that loads Entity Type: " + this_2.typeId, function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16740
|
+
var _a;
|
|
16741
|
+
return __generator(this, function (_b) {
|
|
16742
|
+
switch (_b.label) {
|
|
16743
|
+
case 0:
|
|
16744
|
+
if (controller.signal.aborted || !((_a = this.GetMenuItems()) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
16745
|
+
return [2 /*return*/];
|
|
16746
|
+
}
|
|
16747
|
+
return [4 /*yield*/, Entity$1.GetList({
|
|
16748
|
+
api: this.api,
|
|
16749
|
+
historicKey: this.historicAttrKey,
|
|
16750
|
+
historicPoint: historicAttrDateTime,
|
|
16751
|
+
schemaId: this.schemaId,
|
|
16752
|
+
filter: {
|
|
16753
|
+
pageSize: batch.length,
|
|
16754
|
+
pageIndex: 0,
|
|
16755
|
+
entityTypeId: this.typeId,
|
|
16756
|
+
layerIds: this.tagIds,
|
|
16757
|
+
layerIdsOperator: "in",
|
|
16758
|
+
sortOrder: Api.ESortOrder.Asc,
|
|
16759
|
+
entityTypeConditions: {
|
|
16760
|
+
"ID": {
|
|
16761
|
+
"in": batch
|
|
16762
|
+
}
|
|
16763
|
+
},
|
|
16764
|
+
},
|
|
16765
|
+
viaCdn: this.viaCdn,
|
|
16766
|
+
migrated: true,
|
|
16767
|
+
req: {
|
|
16768
|
+
// If we are passing in an abort, we MUST pass in noCache.
|
|
16769
|
+
// Otherwise we will cache an aborted request.
|
|
16770
|
+
noCache: true,
|
|
16771
|
+
abortSignal: controller.signal
|
|
16772
|
+
}
|
|
16773
|
+
})];
|
|
16774
|
+
case 1:
|
|
16775
|
+
entities = (_b.sent()).entities;
|
|
16776
|
+
return [2 /*return*/];
|
|
16777
|
+
}
|
|
16778
|
+
});
|
|
16779
|
+
}); })];
|
|
16780
|
+
case 1:
|
|
16781
|
+
_c.sent();
|
|
16782
|
+
// Date changed.
|
|
16783
|
+
if (this_2.historicAttrDateTime != historicAttrDateTime) {
|
|
16784
|
+
return [2 /*return*/, "break"];
|
|
16785
|
+
}
|
|
16786
|
+
// Integrity changed.
|
|
16787
|
+
if (this_2.gatheredIntegrity != integrity) {
|
|
16788
|
+
return [2 /*return*/, "break"];
|
|
16789
|
+
}
|
|
16790
|
+
// No Menu Items.
|
|
16791
|
+
if (!this_2.GetMenuItems().length) {
|
|
16792
|
+
return [2 /*return*/, "break"];
|
|
16793
|
+
}
|
|
16794
|
+
(_a = this_2.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(entities);
|
|
16795
|
+
return [2 /*return*/];
|
|
16796
|
+
}
|
|
16797
|
+
});
|
|
16798
|
+
};
|
|
16799
|
+
this_2 = this;
|
|
16696
16800
|
i = 0;
|
|
16697
16801
|
_b.label = 2;
|
|
16698
16802
|
case 2:
|
|
16699
16803
|
if (!(i < this.gatheredEntityIds.length)) return [3 /*break*/, 5];
|
|
16700
|
-
|
|
16701
|
-
if (!batch.length) {
|
|
16702
|
-
return [3 /*break*/, 5];
|
|
16703
|
-
}
|
|
16704
|
-
controller = this.historicRefreshAbortController = new AbortController();
|
|
16705
|
-
return [4 /*yield*/, Entity$1.GetList({
|
|
16706
|
-
api: this.api,
|
|
16707
|
-
historicKey: this.historicAttrKey,
|
|
16708
|
-
historicPoint: historicAttrDateTime,
|
|
16709
|
-
schemaId: this.schemaId,
|
|
16710
|
-
filter: {
|
|
16711
|
-
pageSize: batch.length,
|
|
16712
|
-
pageIndex: 0,
|
|
16713
|
-
entityTypeId: this.typeId,
|
|
16714
|
-
layerIds: this.tagIds,
|
|
16715
|
-
layerIdsOperator: "in",
|
|
16716
|
-
sortOrder: Api.ESortOrder.Asc,
|
|
16717
|
-
entityTypeConditions: {
|
|
16718
|
-
"ID": {
|
|
16719
|
-
"in": batch
|
|
16720
|
-
}
|
|
16721
|
-
},
|
|
16722
|
-
},
|
|
16723
|
-
viaCdn: this.viaCdn,
|
|
16724
|
-
migrated: true,
|
|
16725
|
-
req: {
|
|
16726
|
-
// If we are passing in an abort, we MUST pass in noCache.
|
|
16727
|
-
// Otherwise we will cache an aborted request.
|
|
16728
|
-
noCache: true,
|
|
16729
|
-
abortSignal: controller.signal
|
|
16730
|
-
}
|
|
16731
|
-
})];
|
|
16804
|
+
return [5 /*yield**/, _loop_2(i)];
|
|
16732
16805
|
case 3:
|
|
16733
|
-
|
|
16734
|
-
|
|
16735
|
-
if (this.historicAttrDateTime != historicAttrDateTime) {
|
|
16806
|
+
state_2 = _b.sent();
|
|
16807
|
+
if (state_2 === "break")
|
|
16736
16808
|
return [3 /*break*/, 5];
|
|
16737
|
-
}
|
|
16738
|
-
// Integrity changed.
|
|
16739
|
-
if (this.gatheredIntegrity != integrity) {
|
|
16740
|
-
return [3 /*break*/, 5];
|
|
16741
|
-
}
|
|
16742
|
-
// No Menu Items.
|
|
16743
|
-
if (!this.GetMenuItems().length) {
|
|
16744
|
-
return [3 /*break*/, 5];
|
|
16745
|
-
}
|
|
16746
|
-
(_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(entities);
|
|
16747
16809
|
_b.label = 4;
|
|
16748
16810
|
case 4:
|
|
16749
16811
|
i += SCAN_BATCH_SIZE;
|
|
@@ -16753,6 +16815,7 @@ var EntityFilterGetter;
|
|
|
16753
16815
|
e_2 = _b.sent();
|
|
16754
16816
|
// Ignore abort errors.
|
|
16755
16817
|
if (e_2 && typeof e_2 === "object" && e_2.name == "AbortError") {
|
|
16818
|
+
// console.debug("Aborted entity-filter-getter historic refresh request.");
|
|
16756
16819
|
return [2 /*return*/];
|
|
16757
16820
|
}
|
|
16758
16821
|
console.error(e_2);
|
|
@@ -16884,6 +16947,84 @@ var SharedGetters;
|
|
|
16884
16947
|
return Cache;
|
|
16885
16948
|
}());
|
|
16886
16949
|
SharedGetters.Cache = Cache;
|
|
16950
|
+
/**
|
|
16951
|
+
* To avoid performing multiple expensive queries at the same time,
|
|
16952
|
+
* we'll have the getters work through a queue of requests.
|
|
16953
|
+
*/
|
|
16954
|
+
var Queue;
|
|
16955
|
+
(function (Queue) {
|
|
16956
|
+
var queue = [];
|
|
16957
|
+
var isProcessing = false;
|
|
16958
|
+
/**
|
|
16959
|
+
* Called to run a provided function.
|
|
16960
|
+
* When the function is complete, the next function in the queue will be called.
|
|
16961
|
+
* This function will resolve when the provided function is complete.
|
|
16962
|
+
* If the provided function crashes, the error bubbles up to the caller.
|
|
16963
|
+
* @param name
|
|
16964
|
+
* @param call
|
|
16965
|
+
*/
|
|
16966
|
+
function Run(name, call) {
|
|
16967
|
+
var _this = this;
|
|
16968
|
+
return new Promise(function (resolve, reject) {
|
|
16969
|
+
queue.push(function () { return __awaiter(_this, void 0, void 0, function () {
|
|
16970
|
+
var result, error_1;
|
|
16971
|
+
return __generator(this, function (_a) {
|
|
16972
|
+
switch (_a.label) {
|
|
16973
|
+
case 0:
|
|
16974
|
+
_a.trys.push([0, 2, 3, 4]);
|
|
16975
|
+
return [4 /*yield*/, call()];
|
|
16976
|
+
case 1:
|
|
16977
|
+
result = _a.sent();
|
|
16978
|
+
resolve(result);
|
|
16979
|
+
return [3 /*break*/, 4];
|
|
16980
|
+
case 2:
|
|
16981
|
+
error_1 = _a.sent();
|
|
16982
|
+
reject(error_1);
|
|
16983
|
+
return [3 /*break*/, 4];
|
|
16984
|
+
case 3:
|
|
16985
|
+
// Process the next function in the queue.
|
|
16986
|
+
queue.shift();
|
|
16987
|
+
// If there are more functions in the queue, process the next one.
|
|
16988
|
+
if (queue.length > 0) {
|
|
16989
|
+
processNext();
|
|
16990
|
+
}
|
|
16991
|
+
// No more items to process.
|
|
16992
|
+
else {
|
|
16993
|
+
isProcessing = false;
|
|
16994
|
+
}
|
|
16995
|
+
return [7 /*endfinally*/];
|
|
16996
|
+
case 4: return [2 /*return*/];
|
|
16997
|
+
}
|
|
16998
|
+
});
|
|
16999
|
+
}); });
|
|
17000
|
+
if (!isProcessing) {
|
|
17001
|
+
// If not currently processing, start processing the queue.
|
|
17002
|
+
isProcessing = true;
|
|
17003
|
+
processNext();
|
|
17004
|
+
}
|
|
17005
|
+
});
|
|
17006
|
+
}
|
|
17007
|
+
Queue.Run = Run;
|
|
17008
|
+
function processNext() {
|
|
17009
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
17010
|
+
var nextCall;
|
|
17011
|
+
return __generator(this, function (_a) {
|
|
17012
|
+
switch (_a.label) {
|
|
17013
|
+
case 0:
|
|
17014
|
+
nextCall = queue[0];
|
|
17015
|
+
if (!nextCall) return [3 /*break*/, 2];
|
|
17016
|
+
// Call the next function in the queue.
|
|
17017
|
+
return [4 /*yield*/, nextCall()];
|
|
17018
|
+
case 1:
|
|
17019
|
+
// Call the next function in the queue.
|
|
17020
|
+
_a.sent();
|
|
17021
|
+
_a.label = 2;
|
|
17022
|
+
case 2: return [2 /*return*/];
|
|
17023
|
+
}
|
|
17024
|
+
});
|
|
17025
|
+
});
|
|
17026
|
+
}
|
|
17027
|
+
})(Queue = SharedGetters.Queue || (SharedGetters.Queue = {}));
|
|
16887
17028
|
})(SharedGetters || (SharedGetters = {}));
|
|
16888
17029
|
|
|
16889
17030
|
var MAX_BATCHES = 2;
|
|
@@ -28076,7 +28217,7 @@ var WidgetViewBar = /** @class */ (function (_super) {
|
|
|
28076
28217
|
return WidgetViewBar;
|
|
28077
28218
|
}(Widget.AWidget));
|
|
28078
28219
|
|
|
28079
|
-
var VERSION = "4.6.
|
|
28220
|
+
var VERSION = "4.6.7";
|
|
28080
28221
|
|
|
28081
28222
|
export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar, WidgetControlViewBar, WidgetControlViewBarSearch, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks };
|
|
28082
28223
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|