bruce-cesium 3.7.4 → 3.7.5
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 +141 -49
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +140 -48
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/entity-render-engine.js +32 -24
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/rendering/getters/entity-filter-getter.js +69 -2
- package/dist/lib/rendering/getters/entity-filter-getter.js.map +1 -1
- package/dist/lib/rendering/render-managers/common/shared-getters.js +2 -1
- package/dist/lib/rendering/render-managers/common/shared-getters.js.map +1 -1
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js +37 -20
- package/dist/lib/rendering/render-managers/entities/entities-render-manager.js.map +1 -1
- package/dist/lib/rendering/visuals-register.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/getters/entity-filter-getter.d.ts +15 -1
- package/dist/types/rendering/render-managers/common/shared-getters.d.ts +1 -0
- package/dist/types/rendering/visuals-register.d.ts +2 -0
- package/package.json +2 -2
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BruceEvent, Cartes, Carto, Entity as Entity$1, Geometry, Tileset, MathUtils, LRUCache, ProjectViewTile, DelayQueue, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, Api, EntityRelationType, ENVIRONMENT, EntityCoords, EntitySource, MenuItem, EntityRelation, ProgramKey, AbstractApi, ProjectViewBookmark, EntityAttachment, EntityAttachmentType, EntityAttribute, ProjectView, ProjectViewLegacyTile, Camera } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, DistanceDisplayCondition, NearFarScalar, Model, Entity, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature,
|
|
3
|
+
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, DistanceDisplayCondition, NearFarScalar, Model, Entity, HorizontalOrigin, VerticalOrigin, ConstantProperty, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, HeadingPitchRoll, Transforms, ColorBlendMode, SceneMode, Primitive, Cesium3DTileFeature, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, Cesium3DTileStyle, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Quaternion, Intersect } from 'cesium';
|
|
4
4
|
|
|
5
5
|
/*! *****************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4807,11 +4807,11 @@ function extractMetadataFromFileUrl(url) {
|
|
|
4807
4807
|
var EntityRenderEngine;
|
|
4808
4808
|
(function (EntityRenderEngine) {
|
|
4809
4809
|
function Render(params) {
|
|
4810
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
4810
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
4811
4811
|
return __awaiter(this, void 0, void 0, function () {
|
|
4812
4812
|
var groupRenderParams, i, entity, geometry, cEntities, models, multiGeometry, polygons, polylines, points, i, entity, id, zoomItem, displayType, existingRego, newRenderId, oldRenderId, mParams, mEntities, i, entity, id, cEntity, _loop_1, i, pParams, pEntities, i, entity, cEntity, pParams, pEntities, i, entity, cEntity, pParams, pEntities, i, entity, cEntity;
|
|
4813
|
-
return __generator(this, function (
|
|
4814
|
-
switch (
|
|
4813
|
+
return __generator(this, function (_m) {
|
|
4814
|
+
switch (_m.label) {
|
|
4815
4815
|
case 0:
|
|
4816
4816
|
groupRenderParams = {
|
|
4817
4817
|
apiGetter: params.apiGetter,
|
|
@@ -4859,7 +4859,11 @@ var EntityRenderEngine;
|
|
|
4859
4859
|
});
|
|
4860
4860
|
newRenderId = getRenderGroupId(zoomItem, (_b = params.viewer) === null || _b === void 0 ? void 0 : _b.terrainProvider);
|
|
4861
4861
|
oldRenderId = (_c = existingRego === null || existingRego === void 0 ? void 0 : existingRego.visual) === null || _c === void 0 ? void 0 : _c._renderGroup;
|
|
4862
|
-
if (!params.force &&
|
|
4862
|
+
if (!params.force &&
|
|
4863
|
+
newRenderId == oldRenderId &&
|
|
4864
|
+
!(existingRego === null || existingRego === void 0 ? void 0 : existingRego.stale) &&
|
|
4865
|
+
// If historic metadata is different then it's also stale.
|
|
4866
|
+
((existingRego === null || existingRego === void 0 ? void 0 : existingRego.historicDateTime) == ((_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d.historicDateTime))) {
|
|
4863
4867
|
// No sorting category needed. Already rendered the way we want.
|
|
4864
4868
|
cEntities[id] = existingRego.visual;
|
|
4865
4869
|
}
|
|
@@ -4869,12 +4873,16 @@ var EntityRenderEngine;
|
|
|
4869
4873
|
cEntities[id] = existingRego.visual;
|
|
4870
4874
|
// Flag as no longer stale as we're unlikely to recreate the rego if we're reusing the graphic.
|
|
4871
4875
|
existingRego.stale = false;
|
|
4876
|
+
// Update metadata for the same reason.
|
|
4877
|
+
existingRego.historicDateTime = (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.historicDateTime;
|
|
4878
|
+
existingRego.historicAttrKey = (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.historicAttrKey;
|
|
4879
|
+
existingRego.entityTypeId = entity.Bruce["EntityType.ID"];
|
|
4872
4880
|
}
|
|
4873
4881
|
if (displayType == ZoomControl.EDisplayType.Model3D) {
|
|
4874
4882
|
models.push(entity);
|
|
4875
4883
|
}
|
|
4876
4884
|
else if (displayType == ZoomControl.EDisplayType.Geometry) {
|
|
4877
|
-
if ((
|
|
4885
|
+
if ((_h = (_g = entity.geometry) === null || _g === void 0 ? void 0 : _g.MultiGeometry) === null || _h === void 0 ? void 0 : _h.length) {
|
|
4878
4886
|
multiGeometry.push(entity);
|
|
4879
4887
|
}
|
|
4880
4888
|
else {
|
|
@@ -4892,7 +4900,7 @@ var EntityRenderEngine;
|
|
|
4892
4900
|
mParams = __assign(__assign({}, groupRenderParams), { rendered: cEntities, entities: models });
|
|
4893
4901
|
return [4 /*yield*/, Model3d.RenderGroup(mParams)];
|
|
4894
4902
|
case 1:
|
|
4895
|
-
mEntities =
|
|
4903
|
+
mEntities = _m.sent();
|
|
4896
4904
|
for (i = 0; i < mParams.entities.length; i++) {
|
|
4897
4905
|
entity = mParams.entities[i];
|
|
4898
4906
|
id = entity.Bruce.ID;
|
|
@@ -4904,16 +4912,16 @@ var EntityRenderEngine;
|
|
|
4904
4912
|
multiGeometry.push(entity);
|
|
4905
4913
|
}
|
|
4906
4914
|
}
|
|
4907
|
-
|
|
4915
|
+
_m.label = 2;
|
|
4908
4916
|
case 2:
|
|
4909
4917
|
if (!(multiGeometry.length > 0)) return [3 /*break*/, 6];
|
|
4910
4918
|
_loop_1 = function (i) {
|
|
4911
4919
|
var entity, pParams, zoomItem, j, subEntity, cPoly, rendered, cLines, cPoints, rootEntity_1, firstEntity;
|
|
4912
|
-
return __generator(this, function (
|
|
4913
|
-
switch (
|
|
4920
|
+
return __generator(this, function (_o) {
|
|
4921
|
+
switch (_o.label) {
|
|
4914
4922
|
case 0:
|
|
4915
4923
|
entity = multiGeometry[i];
|
|
4916
|
-
if (!((
|
|
4924
|
+
if (!((_k = (_j = entity.geometry) === null || _j === void 0 ? void 0 : _j.MultiGeometry) === null || _k === void 0 ? void 0 : _k.length)) {
|
|
4917
4925
|
polygons.push(entity);
|
|
4918
4926
|
return [2 /*return*/, "continue"];
|
|
4919
4927
|
}
|
|
@@ -4926,7 +4934,7 @@ var EntityRenderEngine;
|
|
|
4926
4934
|
}
|
|
4927
4935
|
return [4 /*yield*/, Polygon.RenderGroup(pParams)];
|
|
4928
4936
|
case 1:
|
|
4929
|
-
cPoly =
|
|
4937
|
+
cPoly = _o.sent();
|
|
4930
4938
|
Object.keys(cPoly).forEach(function (key) {
|
|
4931
4939
|
if (cPoly[key]) {
|
|
4932
4940
|
pParams.entities = pParams.entities.filter(function (e) { return e.Bruce.ID != key; });
|
|
@@ -4935,7 +4943,7 @@ var EntityRenderEngine;
|
|
|
4935
4943
|
rendered = Object.values(cPoly);
|
|
4936
4944
|
return [4 /*yield*/, Polyline.RenderGroup(pParams)];
|
|
4937
4945
|
case 2:
|
|
4938
|
-
cLines =
|
|
4946
|
+
cLines = _o.sent();
|
|
4939
4947
|
Object.keys(cLines).forEach(function (key) {
|
|
4940
4948
|
if (cLines[key]) {
|
|
4941
4949
|
pParams.entities = pParams.entities.filter(function (e) { return e.Bruce.ID != key; });
|
|
@@ -4945,9 +4953,9 @@ var EntityRenderEngine;
|
|
|
4945
4953
|
if (!!rendered.length) return [3 /*break*/, 4];
|
|
4946
4954
|
return [4 /*yield*/, Point.RenderGroup(pParams)];
|
|
4947
4955
|
case 3:
|
|
4948
|
-
cPoints =
|
|
4956
|
+
cPoints = _o.sent();
|
|
4949
4957
|
rendered = rendered.concat(Object.values(cPoints));
|
|
4950
|
-
|
|
4958
|
+
_o.label = 4;
|
|
4951
4959
|
case 4:
|
|
4952
4960
|
rendered = rendered.filter(function (x) { return x != null; });
|
|
4953
4961
|
if (rendered.length) {
|
|
@@ -4955,7 +4963,7 @@ var EntityRenderEngine;
|
|
|
4955
4963
|
id: ObjectUtils.UId(10)
|
|
4956
4964
|
});
|
|
4957
4965
|
rootEntity_1._siblingGraphics = [];
|
|
4958
|
-
rootEntity_1._renderGroup = getRenderGroupId(zoomItem, (
|
|
4966
|
+
rootEntity_1._renderGroup = getRenderGroupId(zoomItem, (_l = params.viewer) === null || _l === void 0 ? void 0 : _l.terrainProvider);
|
|
4959
4967
|
rootEntity_1._siblingGraphics = rootEntity_1._siblingGraphics.concat(rendered);
|
|
4960
4968
|
cEntities[entity.Bruce.ID] = rootEntity_1;
|
|
4961
4969
|
firstEntity = rendered[0];
|
|
@@ -4974,13 +4982,13 @@ var EntityRenderEngine;
|
|
|
4974
4982
|
});
|
|
4975
4983
|
};
|
|
4976
4984
|
i = 0;
|
|
4977
|
-
|
|
4985
|
+
_m.label = 3;
|
|
4978
4986
|
case 3:
|
|
4979
4987
|
if (!(i < multiGeometry.length)) return [3 /*break*/, 6];
|
|
4980
4988
|
return [5 /*yield**/, _loop_1(i)];
|
|
4981
4989
|
case 4:
|
|
4982
|
-
|
|
4983
|
-
|
|
4990
|
+
_m.sent();
|
|
4991
|
+
_m.label = 5;
|
|
4984
4992
|
case 5:
|
|
4985
4993
|
i++;
|
|
4986
4994
|
return [3 /*break*/, 3];
|
|
@@ -4989,7 +4997,7 @@ var EntityRenderEngine;
|
|
|
4989
4997
|
pParams = __assign(__assign({}, groupRenderParams), { entities: polygons, rendered: cEntities });
|
|
4990
4998
|
return [4 /*yield*/, Polygon.RenderGroup(pParams)];
|
|
4991
4999
|
case 7:
|
|
4992
|
-
pEntities =
|
|
5000
|
+
pEntities = _m.sent();
|
|
4993
5001
|
for (i = 0; i < pParams.entities.length; i++) {
|
|
4994
5002
|
entity = pParams.entities[i];
|
|
4995
5003
|
cEntity = pEntities[entity.Bruce.ID];
|
|
@@ -5000,13 +5008,13 @@ var EntityRenderEngine;
|
|
|
5000
5008
|
polylines.push(entity);
|
|
5001
5009
|
}
|
|
5002
5010
|
}
|
|
5003
|
-
|
|
5011
|
+
_m.label = 8;
|
|
5004
5012
|
case 8:
|
|
5005
5013
|
if (!(polylines.length > 0)) return [3 /*break*/, 10];
|
|
5006
5014
|
pParams = __assign(__assign({}, groupRenderParams), { entities: polylines, rendered: cEntities });
|
|
5007
5015
|
return [4 /*yield*/, Polyline.RenderGroup(pParams)];
|
|
5008
5016
|
case 9:
|
|
5009
|
-
pEntities =
|
|
5017
|
+
pEntities = _m.sent();
|
|
5010
5018
|
for (i = 0; i < pParams.entities.length; i++) {
|
|
5011
5019
|
entity = pParams.entities[i];
|
|
5012
5020
|
cEntity = pEntities[entity.Bruce.ID];
|
|
@@ -5017,13 +5025,13 @@ var EntityRenderEngine;
|
|
|
5017
5025
|
points.push(entity);
|
|
5018
5026
|
}
|
|
5019
5027
|
}
|
|
5020
|
-
|
|
5028
|
+
_m.label = 10;
|
|
5021
5029
|
case 10:
|
|
5022
5030
|
if (!(points.length > 0)) return [3 /*break*/, 12];
|
|
5023
5031
|
pParams = __assign(__assign({}, groupRenderParams), { entities: points, rendered: cEntities });
|
|
5024
5032
|
return [4 /*yield*/, Point.RenderGroup(pParams)];
|
|
5025
5033
|
case 11:
|
|
5026
|
-
pEntities =
|
|
5034
|
+
pEntities = _m.sent();
|
|
5027
5035
|
for (i = 0; i < pParams.entities.length; i++) {
|
|
5028
5036
|
entity = pParams.entities[i];
|
|
5029
5037
|
cEntity = pEntities[entity.Bruce.ID];
|
|
@@ -5031,7 +5039,7 @@ var EntityRenderEngine;
|
|
|
5031
5039
|
cEntities[entity.Bruce.ID] = cEntity;
|
|
5032
5040
|
}
|
|
5033
5041
|
}
|
|
5034
|
-
|
|
5042
|
+
_m.label = 12;
|
|
5035
5043
|
case 12: return [2 /*return*/, cEntities];
|
|
5036
5044
|
}
|
|
5037
5045
|
});
|
|
@@ -9754,7 +9762,8 @@ var EntitiesRenderManager;
|
|
|
9754
9762
|
// So for multiple tags we'll manually sort on UI end...
|
|
9755
9763
|
tagIds: (tagsToRender === null || tagsToRender === void 0 ? void 0 : tagsToRender.length) ? tagsToRender : [],
|
|
9756
9764
|
debugShowBounds: Boolean(window === null || window === void 0 ? void 0 : window.ENTITIES_RENDER_MANAGER_SHOW_BOUNDS),
|
|
9757
|
-
cdn: this.item.cdnEnabled
|
|
9765
|
+
cdn: this.item.cdnEnabled,
|
|
9766
|
+
historicAttrKey: this.item.BruceEntity.historicAttrKey
|
|
9758
9767
|
});
|
|
9759
9768
|
var minMax = RenderManager.GetZoomMinMax({
|
|
9760
9769
|
zoomControl: this.item.CameraZoomSettings
|
|
@@ -10316,23 +10325,37 @@ var EntitiesRenderManager;
|
|
|
10316
10325
|
* @returns
|
|
10317
10326
|
*/
|
|
10318
10327
|
Manager.prototype.renderAsIndividuals = function (entities, force) {
|
|
10319
|
-
var _a, _b, _c;
|
|
10328
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
10320
10329
|
if (force === void 0) { force = false; }
|
|
10321
10330
|
return __awaiter(this, void 0, void 0, function () {
|
|
10322
|
-
var cEntities, i, entity, id, cEntity, visual, wasClustered, tagIds, rego;
|
|
10323
|
-
return __generator(this, function (
|
|
10324
|
-
switch (
|
|
10325
|
-
case 0:
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10331
|
+
var toRemove, i, entity, cEntities, i, entity, id, cEntity, visual, wasClustered, tagIds, rego;
|
|
10332
|
+
return __generator(this, function (_h) {
|
|
10333
|
+
switch (_h.label) {
|
|
10334
|
+
case 0:
|
|
10335
|
+
if ((_a = this.item.BruceEntity) === null || _a === void 0 ? void 0 : _a.historicAttrKey) {
|
|
10336
|
+
toRemove = entities.filter(function (x) { var _a; return !((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.historicAttrKey); });
|
|
10337
|
+
for (i = 0; i < toRemove.length; i++) {
|
|
10338
|
+
entity = toRemove[i];
|
|
10339
|
+
this.visualsManager.RemoveRegos({
|
|
10340
|
+
entityId: entity.Bruce.ID,
|
|
10341
|
+
menuItemId: this.item.id,
|
|
10342
|
+
requestRender: false
|
|
10343
|
+
});
|
|
10344
|
+
(_b = this.clustering) === null || _b === void 0 ? void 0 : _b.RemoveEntity(entity.Bruce.ID, false);
|
|
10345
|
+
}
|
|
10346
|
+
entities = entities.filter(function (x) { var _a; return !!((_a = x.Bruce) === null || _a === void 0 ? void 0 : _a.historicAttrKey); });
|
|
10347
|
+
}
|
|
10348
|
+
return [4 /*yield*/, EntityRenderEngine.Render({
|
|
10349
|
+
viewer: this.viewer,
|
|
10350
|
+
apiGetter: this.apiGetter,
|
|
10351
|
+
entities: entities,
|
|
10352
|
+
menuItemId: this.item.id,
|
|
10353
|
+
visualRegister: this.visualsManager,
|
|
10354
|
+
zoomControl: this.item.CameraZoomSettings,
|
|
10355
|
+
force: force
|
|
10356
|
+
})];
|
|
10334
10357
|
case 1:
|
|
10335
|
-
cEntities =
|
|
10358
|
+
cEntities = _h.sent();
|
|
10336
10359
|
if (this.disposed) {
|
|
10337
10360
|
this.doDispose();
|
|
10338
10361
|
return [2 /*return*/];
|
|
@@ -10343,13 +10366,13 @@ var EntitiesRenderManager;
|
|
|
10343
10366
|
cEntity = cEntities[id];
|
|
10344
10367
|
this.renderedEntities[id] = !!cEntity;
|
|
10345
10368
|
if (cEntity) {
|
|
10346
|
-
visual = (
|
|
10369
|
+
visual = (_c = this.visualsManager.GetRego({
|
|
10347
10370
|
entityId: id,
|
|
10348
10371
|
menuItemId: this.item.id
|
|
10349
|
-
})) === null ||
|
|
10372
|
+
})) === null || _c === void 0 ? void 0 : _c.visual;
|
|
10350
10373
|
if (!visual || visual != cEntity) {
|
|
10351
10374
|
wasClustered = this.clustering ? this.clustering.AddEntity(id, cEntity, false) : false;
|
|
10352
|
-
tagIds = (
|
|
10375
|
+
tagIds = (_d = entity.Bruce) === null || _d === void 0 ? void 0 : _d["Layer.ID"];
|
|
10353
10376
|
rego = {
|
|
10354
10377
|
entityId: id,
|
|
10355
10378
|
menuItemId: this.item.id,
|
|
@@ -10360,7 +10383,9 @@ var EntitiesRenderManager;
|
|
|
10360
10383
|
tagIds: tagIds ? [].concat(tagIds) : [],
|
|
10361
10384
|
overrideShow: wasClustered ? false : null,
|
|
10362
10385
|
name: cEntity.name,
|
|
10363
|
-
cdn: this.item.cdnEnabled
|
|
10386
|
+
cdn: this.item.cdnEnabled,
|
|
10387
|
+
historicDateTime: (_e = entity.Bruce) === null || _e === void 0 ? void 0 : _e.historicDateTime,
|
|
10388
|
+
historicAttrKey: (_f = entity.Bruce) === null || _f === void 0 ? void 0 : _f.historicAttrKey
|
|
10364
10389
|
};
|
|
10365
10390
|
this.visualsManager.AddRego({
|
|
10366
10391
|
rego: rego,
|
|
@@ -10374,7 +10399,7 @@ var EntitiesRenderManager;
|
|
|
10374
10399
|
menuItemId: this.item.id,
|
|
10375
10400
|
requestRender: false
|
|
10376
10401
|
});
|
|
10377
|
-
(
|
|
10402
|
+
(_g = this.clustering) === null || _g === void 0 ? void 0 : _g.RemoveEntity(id, false);
|
|
10378
10403
|
}
|
|
10379
10404
|
}
|
|
10380
10405
|
this.viewer.scene.requestRender();
|
|
@@ -13596,12 +13621,13 @@ var EntityFilterGetter;
|
|
|
13596
13621
|
EStatus["Loading"] = "LOADING";
|
|
13597
13622
|
})(EStatus = EntityFilterGetter.EStatus || (EntityFilterGetter.EStatus = {}));
|
|
13598
13623
|
var Getter = /** @class */ (function () {
|
|
13599
|
-
function Getter(api, viewPort, typeId, batchSize, attrFilter, viaCdn) {
|
|
13624
|
+
function Getter(api, viewer, viewPort, typeId, batchSize, attrFilter, historicAttrKey, viaCdn) {
|
|
13600
13625
|
this.onUpdate = null;
|
|
13601
13626
|
this.LastStateUpdates = {};
|
|
13602
13627
|
this.onStateUpdate = null;
|
|
13603
13628
|
this.onScanUpdate = null;
|
|
13604
13629
|
this.viewPortChangeRemoval = null;
|
|
13630
|
+
this.viewerDateTimeChangeRemoval = null;
|
|
13605
13631
|
this.cells = null;
|
|
13606
13632
|
this.registeredItems = {};
|
|
13607
13633
|
this.getterLoopId = 0;
|
|
@@ -13612,10 +13638,12 @@ var EntityFilterGetter;
|
|
|
13612
13638
|
this.viewCenter = null;
|
|
13613
13639
|
this.api = api;
|
|
13614
13640
|
this.typeId = typeId;
|
|
13641
|
+
this.historicAttrKey = historicAttrKey;
|
|
13615
13642
|
this.viaCdn = Boolean(viaCdn);
|
|
13616
13643
|
this.batchSize = isNaN(batchSize) ? 300 : batchSize;
|
|
13617
13644
|
this.viewPort = viewPort;
|
|
13618
13645
|
this.attrFilter = attrFilter;
|
|
13646
|
+
this.viewer = viewer;
|
|
13619
13647
|
this.updateBounds();
|
|
13620
13648
|
}
|
|
13621
13649
|
Object.defineProperty(Getter.prototype, "OnUpdate", {
|
|
@@ -13654,7 +13682,14 @@ var EntityFilterGetter;
|
|
|
13654
13682
|
* @returns
|
|
13655
13683
|
*/
|
|
13656
13684
|
Getter.prototype.getIntegrityId = function () {
|
|
13657
|
-
|
|
13685
|
+
var integrity = this.tagIds == null ? "" : this.tagIds.join();
|
|
13686
|
+
if (this.historicAttrKey) {
|
|
13687
|
+
integrity += this.historicAttrKey;
|
|
13688
|
+
if (this.historicAttrDateTime) {
|
|
13689
|
+
integrity += this.historicAttrDateTime;
|
|
13690
|
+
}
|
|
13691
|
+
}
|
|
13692
|
+
return integrity;
|
|
13658
13693
|
};
|
|
13659
13694
|
Getter.prototype.viewAreaSub = function () {
|
|
13660
13695
|
var _this = this;
|
|
@@ -13667,6 +13702,57 @@ var EntityFilterGetter;
|
|
|
13667
13702
|
Getter.prototype.viewAreaDispose = function () {
|
|
13668
13703
|
var _a;
|
|
13669
13704
|
(_a = this.viewPortChangeRemoval) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
13705
|
+
this.viewPortChangeRemoval = null;
|
|
13706
|
+
};
|
|
13707
|
+
/**
|
|
13708
|
+
* Monitors the Cesium viewer and updates the historic data filter values.
|
|
13709
|
+
* If there is no historic attr set, this will do nothing.
|
|
13710
|
+
*/
|
|
13711
|
+
Getter.prototype.viewerDateTimeSub = function () {
|
|
13712
|
+
var _this = this;
|
|
13713
|
+
this.viewerDateTimeDispose();
|
|
13714
|
+
if (!this.historicAttrKey) {
|
|
13715
|
+
return;
|
|
13716
|
+
}
|
|
13717
|
+
var delayQueue = new DelayQueue(function () {
|
|
13718
|
+
var current = _this.getIntegrityId();
|
|
13719
|
+
_this.updateHistoricDateTime();
|
|
13720
|
+
if (current != _this.getIntegrityId()) {
|
|
13721
|
+
_this.updateState();
|
|
13722
|
+
}
|
|
13723
|
+
}, 250);
|
|
13724
|
+
var postUpdateRemoval = this.viewer.scene.postUpdate.addEventListener(function () {
|
|
13725
|
+
if (delayQueue) {
|
|
13726
|
+
delayQueue.Call();
|
|
13727
|
+
}
|
|
13728
|
+
});
|
|
13729
|
+
this.viewerDateTimeChangeRemoval = function () {
|
|
13730
|
+
delayQueue === null || delayQueue === void 0 ? void 0 : delayQueue.Dispose();
|
|
13731
|
+
postUpdateRemoval === null || postUpdateRemoval === void 0 ? void 0 : postUpdateRemoval();
|
|
13732
|
+
delayQueue = null;
|
|
13733
|
+
postUpdateRemoval = null;
|
|
13734
|
+
};
|
|
13735
|
+
};
|
|
13736
|
+
Getter.prototype.updateHistoricDateTime = function () {
|
|
13737
|
+
var newDateTime = JulianDate.toDate(this.viewer.clock.currentTime);
|
|
13738
|
+
// Has previous value. Let's compare.
|
|
13739
|
+
if (this.historicAttrDateTime) {
|
|
13740
|
+
var oldDateTime = new Date(this.historicAttrDateTime);
|
|
13741
|
+
// Change must be at least 0.1 seconds.
|
|
13742
|
+
// TODO: This is just a random value I picked. We may need to make a setting or refine this.
|
|
13743
|
+
if (Math.abs(newDateTime.getTime() - oldDateTime.getTime()) < 100) {
|
|
13744
|
+
return;
|
|
13745
|
+
}
|
|
13746
|
+
}
|
|
13747
|
+
this.historicAttrDateTime = newDateTime.toISOString();
|
|
13748
|
+
// Set min/max to be the value increased/decreased by 1 minute.
|
|
13749
|
+
this.historicAttrDateTimeMin = new Date(newDateTime.getTime() - 60000).toISOString();
|
|
13750
|
+
this.historicAttrDateTimeMax = new Date(newDateTime.getTime() + 60000).toISOString();
|
|
13751
|
+
};
|
|
13752
|
+
Getter.prototype.viewerDateTimeDispose = function () {
|
|
13753
|
+
var _a;
|
|
13754
|
+
(_a = this.viewerDateTimeChangeRemoval) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
13755
|
+
this.viewerDateTimeChangeRemoval = null;
|
|
13670
13756
|
};
|
|
13671
13757
|
Getter.prototype.GetMenuItems = function () {
|
|
13672
13758
|
return Object.keys(this.registeredItems);
|
|
@@ -13726,8 +13812,10 @@ var EntityFilterGetter;
|
|
|
13726
13812
|
this.minHeight = minHeight;
|
|
13727
13813
|
this.maxHeight = maxHeight;
|
|
13728
13814
|
this.updateBounds();
|
|
13815
|
+
this.updateHistoricDateTime();
|
|
13729
13816
|
this.startGetterLoop();
|
|
13730
13817
|
this.viewAreaSub();
|
|
13818
|
+
this.viewerDateTimeSub();
|
|
13731
13819
|
}
|
|
13732
13820
|
else {
|
|
13733
13821
|
this.getterLoopId += 1;
|
|
@@ -13823,6 +13911,9 @@ var EntityFilterGetter;
|
|
|
13823
13911
|
_j.trys.push([8, 10, , 11]);
|
|
13824
13912
|
return [4 /*yield*/, Entity$1.GetList({
|
|
13825
13913
|
api: this.api,
|
|
13914
|
+
historicKey: this.historicAttrKey,
|
|
13915
|
+
historicFrom: this.historicAttrKey ? this.historicAttrDateTimeMin : null,
|
|
13916
|
+
historicTo: this.historicAttrKey ? this.historicAttrDateTimeMax : null,
|
|
13826
13917
|
filter: {
|
|
13827
13918
|
pageSize: PAGE_SIZE,
|
|
13828
13919
|
pageIndex: curCell.FetchPageIndex,
|
|
@@ -13920,6 +14011,7 @@ function createFilterGetterCacheKey(params) {
|
|
|
13920
14011
|
cacheKey += params.batchSize;
|
|
13921
14012
|
cacheKey += String(params.cdn);
|
|
13922
14013
|
cacheKey += JSON.stringify(params.tagIds ? params.tagIds : []);
|
|
14014
|
+
cacheKey += params.historicAttrKey ? params.historicAttrKey : "";
|
|
13923
14015
|
// This could potentially crash, but if it crashes here then it would crash during API request anyways.
|
|
13924
14016
|
cacheKey += JSON.stringify(params.attrFilter ? params.attrFilter : {});
|
|
13925
14017
|
return cacheKey;
|
|
@@ -13935,7 +14027,7 @@ var SharedGetters;
|
|
|
13935
14027
|
var cacheKey = createFilterGetterCacheKey(params);
|
|
13936
14028
|
var getter = this.data[cacheKey];
|
|
13937
14029
|
if (!getter) {
|
|
13938
|
-
getter = new EntityFilterGetter.Getter(params.api, params.monitor, params.typeId, params.batchSize, params.attrFilter, params.cdn);
|
|
14030
|
+
getter = new EntityFilterGetter.Getter(params.api, params.viewer, params.monitor, params.typeId, params.batchSize, params.attrFilter, params.historicAttrKey, params.cdn);
|
|
13939
14031
|
this.data[cacheKey] = getter;
|
|
13940
14032
|
/**
|
|
13941
14033
|
* Debug option.
|
|
@@ -23345,7 +23437,7 @@ var ViewRenderEngine;
|
|
|
23345
23437
|
ViewRenderEngine.Render = Render;
|
|
23346
23438
|
})(ViewRenderEngine || (ViewRenderEngine = {}));
|
|
23347
23439
|
|
|
23348
|
-
var VERSION = "3.7.
|
|
23440
|
+
var VERSION = "3.7.5";
|
|
23349
23441
|
|
|
23350
23442
|
export { VERSION, CesiumViewMonitor, ViewerUtils, MenuItemManager, EntityRenderEngine, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, Draw3dPolygon, Draw3dPolyline };
|
|
23351
23443
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|