bruce-cesium 3.6.6 → 3.6.8
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 +218 -53
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +217 -51
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/menu-item-manager.js +2 -1
- package/dist/lib/rendering/menu-item-manager.js.map +1 -1
- package/dist/lib/rendering/render-managers/data-source/data-source-static-csv-manager.js +97 -18
- package/dist/lib/rendering/render-managers/data-source/data-source-static-csv-manager.js.map +1 -1
- package/dist/lib/rendering/view-render-engine.js +47 -31
- package/dist/lib/rendering/view-render-engine.js.map +1 -1
- package/dist/lib/utils/view-utils.js +71 -1
- package/dist/lib/utils/view-utils.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/render-managers/data-source/data-source-static-csv-manager.d.ts +3 -0
- package/dist/types/utils/view-utils.d.ts +36 -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, Entity, Primitive, Cesium3DTileFeature, SceneMode,
|
|
3
|
+
import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, Primitive, Cesium3DTileFeature, SceneMode, DistanceDisplayCondition, NearFarScalar, Model, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Cesium3DTileColorBlendMode, HeadingPitchRange, GeoJsonDataSource, ColorMaterialProperty, Ion, Cesium3DTileStyle, KmlDataSource, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, OrthographicFrustum, EasingFunction, CesiumInspector, defined, ClockRange, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, BoundingSphere, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, SceneTransforms, Intersect, CzmlDataSource, Quaternion } from 'cesium';
|
|
4
4
|
|
|
5
5
|
/*! *****************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -3011,6 +3011,7 @@ var RenderManager;
|
|
|
3011
3011
|
})(RenderManager || (RenderManager = {}));
|
|
3012
3012
|
|
|
3013
3013
|
var CESIUM_INSPECTOR_KEY = "_nextspace_inspector";
|
|
3014
|
+
var CESIUM_TIMELINE_KEY = "_nextspace_timeline";
|
|
3014
3015
|
var ViewUtils;
|
|
3015
3016
|
(function (ViewUtils) {
|
|
3016
3017
|
function GatherLegacyMapTiles(params) {
|
|
@@ -3215,6 +3216,75 @@ var ViewUtils;
|
|
|
3215
3216
|
return !scene.screenSpaceCameraController.enableTranslate;
|
|
3216
3217
|
}
|
|
3217
3218
|
ViewUtils.GetLockedCameraStatus = GetLockedCameraStatus;
|
|
3219
|
+
/**
|
|
3220
|
+
* Returns the current camera time and related settings.
|
|
3221
|
+
* @param params
|
|
3222
|
+
* @returns
|
|
3223
|
+
*/
|
|
3224
|
+
function GetTimeDetails(params) {
|
|
3225
|
+
var viewer = params.viewer;
|
|
3226
|
+
var clock = viewer.clock;
|
|
3227
|
+
return {
|
|
3228
|
+
animationSpeed: clock.multiplier,
|
|
3229
|
+
isAnimating: clock.shouldAnimate,
|
|
3230
|
+
startTime: clock.startTime,
|
|
3231
|
+
startTimeIso: clock.startTime.toString(),
|
|
3232
|
+
currentTime: clock.currentTime,
|
|
3233
|
+
currentTimeIso: clock.currentTime.toString(),
|
|
3234
|
+
stopTime: clock.stopTime,
|
|
3235
|
+
stopTimeIso: clock.stopTime.toString(),
|
|
3236
|
+
areCesiumValues: clock[CESIUM_TIMELINE_KEY] != true
|
|
3237
|
+
};
|
|
3238
|
+
}
|
|
3239
|
+
ViewUtils.GetTimeDetails = GetTimeDetails;
|
|
3240
|
+
/**
|
|
3241
|
+
* Sets the Cesium clock values.
|
|
3242
|
+
* If a value is not provided, then 'areCesiumValues' checked to see if the values are Cesium values.
|
|
3243
|
+
* If they're currently Cesium set values then our defaults are used.
|
|
3244
|
+
* @param params
|
|
3245
|
+
*/
|
|
3246
|
+
function SetTimeDetails(params) {
|
|
3247
|
+
var viewer = params.viewer, animationSpeed = params.animationSpeed, isAnimating = params.isAnimating, startTime = params.startTime, currentTime = params.currentTime, stopTime = params.stopTime, startTimeIso = params.startTimeIso, stopTimeIso = params.stopTimeIso, currentTimeIso = params.currentTimeIso;
|
|
3248
|
+
var clock = viewer.clock;
|
|
3249
|
+
if (startTime) {
|
|
3250
|
+
clock.startTime = startTime;
|
|
3251
|
+
}
|
|
3252
|
+
else if (startTimeIso) {
|
|
3253
|
+
clock.startTime = JulianDate.fromIso8601(params.startTimeIso);
|
|
3254
|
+
}
|
|
3255
|
+
if (currentTime) {
|
|
3256
|
+
clock.currentTime = currentTime;
|
|
3257
|
+
}
|
|
3258
|
+
else if (currentTimeIso) {
|
|
3259
|
+
clock.currentTime = JulianDate.fromIso8601(params.currentTimeIso);
|
|
3260
|
+
}
|
|
3261
|
+
if (stopTime) {
|
|
3262
|
+
clock.stopTime = stopTime;
|
|
3263
|
+
}
|
|
3264
|
+
else if (stopTimeIso) {
|
|
3265
|
+
clock.stopTime = JulianDate.fromIso8601(params.stopTimeIso);
|
|
3266
|
+
}
|
|
3267
|
+
clock.clockRange = ClockRange.LOOP_STOP;
|
|
3268
|
+
var areCesiumValues = clock[CESIUM_TIMELINE_KEY] != true;
|
|
3269
|
+
if (areCesiumValues) {
|
|
3270
|
+
if (isNaN(animationSpeed) || animationSpeed == null) {
|
|
3271
|
+
animationSpeed = 1;
|
|
3272
|
+
}
|
|
3273
|
+
if (isAnimating == null) {
|
|
3274
|
+
isAnimating = false;
|
|
3275
|
+
}
|
|
3276
|
+
}
|
|
3277
|
+
if (!isNaN(animationSpeed) && animationSpeed != null) {
|
|
3278
|
+
clock.multiplier = animationSpeed;
|
|
3279
|
+
}
|
|
3280
|
+
if (isAnimating != null) {
|
|
3281
|
+
clock.shouldAnimate = isAnimating;
|
|
3282
|
+
}
|
|
3283
|
+
console.log("setTimeDetails", params, "areCesiumValues", areCesiumValues);
|
|
3284
|
+
viewer.scene.requestRender();
|
|
3285
|
+
clock[CESIUM_TIMELINE_KEY] = true;
|
|
3286
|
+
}
|
|
3287
|
+
ViewUtils.SetTimeDetails = SetTimeDetails;
|
|
3218
3288
|
})(ViewUtils || (ViewUtils = {}));
|
|
3219
3289
|
|
|
3220
3290
|
var MODEL_MIN_RADIUS = 10;
|
|
@@ -15265,10 +15335,11 @@ var DataSourceStaticCsvManager;
|
|
|
15265
15335
|
this.czmlDataInputs = [];
|
|
15266
15336
|
// Array of callbacks to remove from the clock tick event.
|
|
15267
15337
|
this.tickRemovals = [];
|
|
15268
|
-
var viewer = params.viewer, apiGetter = params.apiGetter, item = params.item;
|
|
15338
|
+
var viewer = params.viewer, apiGetter = params.apiGetter, item = params.item, register = params.register;
|
|
15269
15339
|
this.viewer = viewer;
|
|
15270
15340
|
this.apiGetter = apiGetter;
|
|
15271
15341
|
this.item = item;
|
|
15342
|
+
this.register = register;
|
|
15272
15343
|
}
|
|
15273
15344
|
Object.defineProperty(Manager.prototype, "Disposed", {
|
|
15274
15345
|
get: function () {
|
|
@@ -15348,19 +15419,19 @@ var DataSourceStaticCsvManager;
|
|
|
15348
15419
|
Manager.prototype.renderMovingItem = function () {
|
|
15349
15420
|
var _a;
|
|
15350
15421
|
return __awaiter(this, void 0, void 0, function () {
|
|
15351
|
-
var api, vehicleFileUrl, alarmFileUrl, lineColor, fileStrings, files, i, file, fileId, externalURL, fileUrl, fileStr, csvData, i, delimiter, fileStr, headers, rows, rowsArr, j, row, rowArr, primary, pHeaders, pLatIndex, pLonIndex, pDateTimeIndex, i, row, lat, lon, dateTimeStr, utcDate, _b, datePart, timePart, _c, year, month, day, _d, hours, minutes, seconds, milliseconds, convertTo24HourFormat, dateTime24hr, _e, datePart, timePart, _f, day, month, year, _g, hours, minutes, seconds, _h, datePart, timePart, _j, year, month, day, _k, hours, minutes, seconds,
|
|
15422
|
+
var api, vehicleFileUrl, alarmFileUrl, lineColor, vehicleEntityId, fileStrings, files, i, file, fileId, externalURL, fileUrl, fileStr, csvData, i, delimiter, fileStr, headers, rows, rowsArr, j, row, rowArr, primary, pHeaders, pLatIndex, pLonIndex, pDateTimeIndex, i, row, lat, lon, dateTimeStr, utcDate, _b, datePart, timePart, _c, year, month, day, _d, hours, minutes, seconds, milliseconds, convertTo24HourFormat, dateTime24hr, _e, datePart, timePart, _f, day, month, year, _g, hours, minutes, seconds, _h, datePart, timePart, _j, year, month, day, _k, hours, minutes, seconds, vehicleCesiumId, _l, czml, entityMapping, czmlAdjusted, curSettings, source, pHeadingIndex_1, errorsInARow_1, removal_1, vehicleEntity, cesiumEntityIds, i, cesiumEntityId, entity, nextspaceEntityId;
|
|
15352
15423
|
var _this = this;
|
|
15353
|
-
return __generator(this, function (
|
|
15354
|
-
switch (
|
|
15424
|
+
return __generator(this, function (_m) {
|
|
15425
|
+
switch (_m.label) {
|
|
15355
15426
|
case 0:
|
|
15356
15427
|
api = this.apiGetter.getApi();
|
|
15357
15428
|
return [4 /*yield*/, api.Loading];
|
|
15358
15429
|
case 1:
|
|
15359
|
-
|
|
15430
|
+
_m.sent();
|
|
15360
15431
|
fileStrings = [];
|
|
15361
15432
|
files = this.item.CSV;
|
|
15362
15433
|
i = 0;
|
|
15363
|
-
|
|
15434
|
+
_m.label = 2;
|
|
15364
15435
|
case 2:
|
|
15365
15436
|
if (!(i < files.length)) return [3 /*break*/, 6];
|
|
15366
15437
|
file = files[i];
|
|
@@ -15381,9 +15452,9 @@ var DataSourceStaticCsvManager;
|
|
|
15381
15452
|
fileUrl = externalURL;
|
|
15382
15453
|
}
|
|
15383
15454
|
return [4 /*yield*/, fetch(fileUrl)];
|
|
15384
|
-
case 3: return [4 /*yield*/, (
|
|
15455
|
+
case 3: return [4 /*yield*/, (_m.sent()).text()];
|
|
15385
15456
|
case 4:
|
|
15386
|
-
fileStr =
|
|
15457
|
+
fileStr = _m.sent();
|
|
15387
15458
|
fileStrings.push(fileStr);
|
|
15388
15459
|
if (this.disposed) {
|
|
15389
15460
|
return [2 /*return*/];
|
|
@@ -15405,7 +15476,10 @@ var DataSourceStaticCsvManager;
|
|
|
15405
15476
|
viaCdn: true
|
|
15406
15477
|
});
|
|
15407
15478
|
}
|
|
15408
|
-
|
|
15479
|
+
if (file.vehicleEntityId) {
|
|
15480
|
+
vehicleEntityId = file.vehicleEntityId;
|
|
15481
|
+
}
|
|
15482
|
+
_m.label = 5;
|
|
15409
15483
|
case 5:
|
|
15410
15484
|
i++;
|
|
15411
15485
|
return [3 /*break*/, 2];
|
|
@@ -15497,27 +15571,36 @@ var DataSourceStaticCsvManager;
|
|
|
15497
15571
|
var bDate = new Date(b[pDateTimeIndex]);
|
|
15498
15572
|
return aDate.getTime() - bDate.getTime();
|
|
15499
15573
|
});
|
|
15500
|
-
|
|
15501
|
-
|
|
15574
|
+
vehicleCesiumId = ObjectUtils.UId();
|
|
15575
|
+
_l = createJourneyCzml(vehicleCesiumId, vehicleFileUrl, alarmFileUrl, lineColor, primary), czml = _l.czml, entityMapping = _l.entityMapping;
|
|
15502
15576
|
this.czmlDataInputs.push(czml);
|
|
15503
15577
|
czmlAdjusted = JSON.parse(JSON.stringify(czml));
|
|
15504
15578
|
czmlAdjusted.forEach(function (item) {
|
|
15505
15579
|
delete item.clock;
|
|
15506
15580
|
});
|
|
15507
|
-
|
|
15581
|
+
curSettings = ViewUtils.GetTimeDetails({
|
|
15582
|
+
viewer: this.viewer
|
|
15583
|
+
});
|
|
15508
15584
|
return [4 /*yield*/, this.viewer.dataSources.add(CzmlDataSource.load(czmlAdjusted))];
|
|
15509
15585
|
case 7:
|
|
15510
|
-
source =
|
|
15586
|
+
source = _m.sent();
|
|
15511
15587
|
this.dataSource = source;
|
|
15512
15588
|
// Reset back to the previous dateTime.
|
|
15513
15589
|
// Adding the czml data source will have changed the clock.
|
|
15514
|
-
|
|
15590
|
+
ViewUtils.SetTimeDetails({
|
|
15591
|
+
viewer: this.viewer,
|
|
15592
|
+
isAnimating: curSettings.isAnimating,
|
|
15593
|
+
animationSpeed: curSettings.animationSpeed,
|
|
15594
|
+
currentTimeIso: curSettings.currentTimeIso,
|
|
15595
|
+
startTimeIso: curSettings.startTimeIso,
|
|
15596
|
+
stopTimeIso: curSettings.stopTimeIso
|
|
15597
|
+
});
|
|
15515
15598
|
// Listen to update ticks and ensure orientation of moving item is correct.
|
|
15516
15599
|
if (this.viewer.clock) {
|
|
15517
15600
|
pHeadingIndex_1 = pHeaders.findIndex(function (x) { return x.toLowerCase().includes("head"); });
|
|
15518
15601
|
errorsInARow_1 = 0;
|
|
15519
15602
|
removal_1 = this.viewer.clock.onTick.addEventListener(function () {
|
|
15520
|
-
var vehicle = source.entities.getById(
|
|
15603
|
+
var vehicle = source.entities.getById(vehicleCesiumId);
|
|
15521
15604
|
if (vehicle) {
|
|
15522
15605
|
try {
|
|
15523
15606
|
updateOrientation(primary.rows, pHeadingIndex_1, pDateTimeIndex, _this.viewer, vehicle);
|
|
@@ -15534,6 +15617,48 @@ var DataSourceStaticCsvManager;
|
|
|
15534
15617
|
}
|
|
15535
15618
|
});
|
|
15536
15619
|
this.tickRemovals.push(removal_1);
|
|
15620
|
+
// Register vehicle rego.
|
|
15621
|
+
if (vehicleEntityId) {
|
|
15622
|
+
vehicleEntity = source.entities.getById(vehicleCesiumId);
|
|
15623
|
+
if (vehicleEntity) {
|
|
15624
|
+
this.register.AddRego({
|
|
15625
|
+
rego: {
|
|
15626
|
+
entityId: vehicleEntityId,
|
|
15627
|
+
menuItemId: this.item.id,
|
|
15628
|
+
priority: 0,
|
|
15629
|
+
visual: vehicleEntity,
|
|
15630
|
+
accountId: this.apiGetter.accountId,
|
|
15631
|
+
cdn: false,
|
|
15632
|
+
overrideShow: true
|
|
15633
|
+
},
|
|
15634
|
+
requestRender: false
|
|
15635
|
+
});
|
|
15636
|
+
}
|
|
15637
|
+
}
|
|
15638
|
+
// Register alarms (and any other Entities that were created).
|
|
15639
|
+
console.log("entityMapping", entityMapping);
|
|
15640
|
+
cesiumEntityIds = Object.keys(entityMapping);
|
|
15641
|
+
for (i = 0; i < cesiumEntityIds.length; i++) {
|
|
15642
|
+
cesiumEntityId = cesiumEntityIds[i];
|
|
15643
|
+
entity = source.entities.getById(cesiumEntityId);
|
|
15644
|
+
if (entity) {
|
|
15645
|
+
nextspaceEntityId = entityMapping[cesiumEntityId];
|
|
15646
|
+
if (nextspaceEntityId) {
|
|
15647
|
+
this.register.AddRego({
|
|
15648
|
+
rego: {
|
|
15649
|
+
entityId: nextspaceEntityId,
|
|
15650
|
+
menuItemId: this.item.id,
|
|
15651
|
+
priority: 0,
|
|
15652
|
+
visual: entity,
|
|
15653
|
+
accountId: this.apiGetter.accountId,
|
|
15654
|
+
cdn: false,
|
|
15655
|
+
overrideShow: true
|
|
15656
|
+
},
|
|
15657
|
+
requestRender: false
|
|
15658
|
+
});
|
|
15659
|
+
}
|
|
15660
|
+
}
|
|
15661
|
+
}
|
|
15537
15662
|
}
|
|
15538
15663
|
return [2 /*return*/];
|
|
15539
15664
|
}
|
|
@@ -15557,6 +15682,11 @@ var DataSourceStaticCsvManager;
|
|
|
15557
15682
|
this.tickRemovals.forEach(function (removal) { return removal(); });
|
|
15558
15683
|
this.tickRemovals = [];
|
|
15559
15684
|
}
|
|
15685
|
+
this.register.RemoveRegos({
|
|
15686
|
+
menuItemId: this.item.id,
|
|
15687
|
+
doUpdate: false,
|
|
15688
|
+
requestRender: false
|
|
15689
|
+
});
|
|
15560
15690
|
};
|
|
15561
15691
|
Manager.prototype.ReRender = function (params) {
|
|
15562
15692
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -15588,6 +15718,16 @@ function createJourneyCzml(vehicleId, vehicleFileUrl, alarmFileUrl, lineColor, d
|
|
|
15588
15718
|
var lonIndex = headers.findIndex(function (x) { return x.toLowerCase().includes("lon"); });
|
|
15589
15719
|
var dateTimeIndex = headers.findIndex(function (x) { return x.toLowerCase().includes("date"); });
|
|
15590
15720
|
var alarmIndex = headers.findIndex(function (x) { return x.toLowerCase().includes("alarm"); });
|
|
15721
|
+
var entityIdIndex = headers.findIndex(function (x, i) {
|
|
15722
|
+
if (i === latIndex || i === lonIndex || i === dateTimeIndex || i === alarmIndex) {
|
|
15723
|
+
return false;
|
|
15724
|
+
}
|
|
15725
|
+
var lower = x.toLowerCase();
|
|
15726
|
+
return lower.includes("entityid") || lower.includes("bruce") || lower.includes("nextspace");
|
|
15727
|
+
});
|
|
15728
|
+
// Map between Cesium Entity ID and Nextspace Entity ID.
|
|
15729
|
+
// This is returned to the caller so they can map between the two.
|
|
15730
|
+
var entityMapping = {};
|
|
15591
15731
|
var czml = [
|
|
15592
15732
|
{
|
|
15593
15733
|
"id": "document",
|
|
@@ -15651,8 +15791,9 @@ function createJourneyCzml(vehicleId, vehicleFileUrl, alarmFileUrl, lineColor, d
|
|
|
15651
15791
|
var alarmTime = new Date(row[dateTimeIndex]).getTime();
|
|
15652
15792
|
var startTime = new Date(alarmTime - visibilityDuration_1 / 2).toISOString();
|
|
15653
15793
|
var endTime = new Date(alarmTime + visibilityDuration_1 / 2).toISOString();
|
|
15794
|
+
var alarmCesiumId = ObjectUtils.UId();
|
|
15654
15795
|
czml.push({
|
|
15655
|
-
"id":
|
|
15796
|
+
"id": alarmCesiumId,
|
|
15656
15797
|
"name": "Alarm",
|
|
15657
15798
|
"availability": startTime + "/" + endTime,
|
|
15658
15799
|
"position": {
|
|
@@ -15676,6 +15817,10 @@ function createJourneyCzml(vehicleId, vehicleFileUrl, alarmFileUrl, lineColor, d
|
|
|
15676
15817
|
}
|
|
15677
15818
|
} : undefined
|
|
15678
15819
|
});
|
|
15820
|
+
var entityId = entityIdIndex > -1 ? row[entityIdIndex] : null;
|
|
15821
|
+
if (entityId) {
|
|
15822
|
+
entityMapping[alarmCesiumId] = String(entityId);
|
|
15823
|
+
}
|
|
15679
15824
|
});
|
|
15680
15825
|
}
|
|
15681
15826
|
// Add animated point for the moving item.
|
|
@@ -15691,7 +15836,7 @@ function createJourneyCzml(vehicleId, vehicleFileUrl, alarmFileUrl, lineColor, d
|
|
|
15691
15836
|
"availability": rows[0][dateTimeIndex] + "/" + rows[rows.length - 1][dateTimeIndex],
|
|
15692
15837
|
"model": vehicleFileUrl ? {
|
|
15693
15838
|
"gltf": vehicleFileUrl,
|
|
15694
|
-
"scale":
|
|
15839
|
+
"scale": 1
|
|
15695
15840
|
} : undefined,
|
|
15696
15841
|
"point": !vehicleFileUrl ? {
|
|
15697
15842
|
"pixelSize": 20,
|
|
@@ -15707,7 +15852,10 @@ function createJourneyCzml(vehicleId, vehicleFileUrl, alarmFileUrl, lineColor, d
|
|
|
15707
15852
|
"cartographicDegrees": vehiclePositions
|
|
15708
15853
|
}
|
|
15709
15854
|
});
|
|
15710
|
-
return
|
|
15855
|
+
return {
|
|
15856
|
+
czml: czml,
|
|
15857
|
+
entityMapping: entityMapping
|
|
15858
|
+
};
|
|
15711
15859
|
}
|
|
15712
15860
|
/**
|
|
15713
15861
|
* Updates the orientation of the moving item.
|
|
@@ -16128,7 +16276,8 @@ var MenuItemManager;
|
|
|
16128
16276
|
rItem.renderManager = new DataSourceStaticCsvManager.Manager({
|
|
16129
16277
|
viewer: this.viewer,
|
|
16130
16278
|
apiGetter: params.apiGetter,
|
|
16131
|
-
item: params.item
|
|
16279
|
+
item: params.item,
|
|
16280
|
+
register: this.visualsRegister
|
|
16132
16281
|
});
|
|
16133
16282
|
break;
|
|
16134
16283
|
case MenuItem.EType.IonTileset:
|
|
@@ -21783,58 +21932,58 @@ function renderLegacyNavigator(iteration, params, bookmark, view) {
|
|
|
21783
21932
|
* @param view
|
|
21784
21933
|
*/
|
|
21785
21934
|
function renderNavigator(iteration, params, bookmark, view, getters) {
|
|
21786
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5;
|
|
21935
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
|
|
21787
21936
|
return __awaiter(this, void 0, void 0, function () {
|
|
21788
|
-
var viewer, scene, cTokenSet,
|
|
21789
|
-
return __generator(this, function (
|
|
21790
|
-
switch (
|
|
21937
|
+
var viewer, scene, cTokenSet, _7, programKey, valid, e_1, valid, vSettings, bSettings, defaults, camera, newLens, shouldBe2d, curIs2d, transition, pos, terrain, hillShades, baseColor, globeHidden, terrainWireframe, globeAlpha, shadows, size, ambientOcclusion, AO, lighting, light, quality, fxaa, dateTime, timeline, selectedIds, hiddenIds, isolatedIds, labelledIds, curLabelledIds, toUnLabel, entityOpacityMap, entityId, opacity, imagery, i, layer, legacyRelationIds, relations, curEnabled, newItemIds, _i, curEnabled_1, id, shouldRemove, rendered, menuItem, menuItem, gOcclusion;
|
|
21938
|
+
return __generator(this, function (_8) {
|
|
21939
|
+
switch (_8.label) {
|
|
21791
21940
|
case 0:
|
|
21792
21941
|
viewer = params.manager.Viewer;
|
|
21793
21942
|
scene = viewer.scene;
|
|
21794
21943
|
if (!Ion.defaultAccessToken) return [3 /*break*/, 2];
|
|
21795
21944
|
return [4 /*yield*/, ViewerUtils.AssertIonToken(Ion.defaultAccessToken)];
|
|
21796
21945
|
case 1:
|
|
21797
|
-
|
|
21946
|
+
_7 = _8.sent();
|
|
21798
21947
|
return [3 /*break*/, 3];
|
|
21799
21948
|
case 2:
|
|
21800
|
-
|
|
21801
|
-
|
|
21949
|
+
_7 = false;
|
|
21950
|
+
_8.label = 3;
|
|
21802
21951
|
case 3:
|
|
21803
|
-
cTokenSet =
|
|
21952
|
+
cTokenSet = _7;
|
|
21804
21953
|
if (!!cTokenSet) return [3 /*break*/, 9];
|
|
21805
|
-
|
|
21954
|
+
_8.label = 4;
|
|
21806
21955
|
case 4:
|
|
21807
|
-
|
|
21956
|
+
_8.trys.push([4, 8, , 9]);
|
|
21808
21957
|
return [4 /*yield*/, ProgramKey.Get({
|
|
21809
21958
|
programId: ProgramKey.EProgramId.CesiumIon,
|
|
21810
21959
|
api: getters.GetBruceApi()
|
|
21811
21960
|
})];
|
|
21812
21961
|
case 5:
|
|
21813
|
-
programKey = (
|
|
21962
|
+
programKey = (_8.sent()).programKey;
|
|
21814
21963
|
if (!(programKey === null || programKey === void 0 ? void 0 : programKey.Key)) return [3 /*break*/, 7];
|
|
21815
21964
|
return [4 /*yield*/, ViewerUtils.AssertIonToken(programKey.Key)];
|
|
21816
21965
|
case 6:
|
|
21817
|
-
valid =
|
|
21966
|
+
valid = _8.sent();
|
|
21818
21967
|
if (valid) {
|
|
21819
21968
|
Ion.defaultAccessToken = programKey.Key;
|
|
21820
21969
|
cTokenSet = true;
|
|
21821
21970
|
}
|
|
21822
|
-
|
|
21971
|
+
_8.label = 7;
|
|
21823
21972
|
case 7: return [3 /*break*/, 9];
|
|
21824
21973
|
case 8:
|
|
21825
|
-
e_1 =
|
|
21974
|
+
e_1 = _8.sent();
|
|
21826
21975
|
console.error(e_1);
|
|
21827
21976
|
return [3 /*break*/, 9];
|
|
21828
21977
|
case 9:
|
|
21829
21978
|
if (!!cTokenSet) return [3 /*break*/, 11];
|
|
21830
21979
|
return [4 /*yield*/, ViewerUtils.AssertIonToken(CESIUM_DEFAULT_TOKEN)];
|
|
21831
21980
|
case 10:
|
|
21832
|
-
valid =
|
|
21981
|
+
valid = _8.sent();
|
|
21833
21982
|
if (valid) {
|
|
21834
21983
|
Ion.defaultAccessToken = CESIUM_DEFAULT_TOKEN;
|
|
21835
21984
|
cTokenSet = true;
|
|
21836
21985
|
}
|
|
21837
|
-
|
|
21986
|
+
_8.label = 11;
|
|
21838
21987
|
case 11:
|
|
21839
21988
|
vSettings = view.Settings;
|
|
21840
21989
|
bSettings = ((_a = bookmark === null || bookmark === void 0 ? void 0 : bookmark.Settings) !== null && _a !== void 0 ? _a : {});
|
|
@@ -21902,11 +22051,11 @@ function renderNavigator(iteration, params, bookmark, view, getters) {
|
|
|
21902
22051
|
viewer: params.manager.Viewer,
|
|
21903
22052
|
})];
|
|
21904
22053
|
case 12:
|
|
21905
|
-
|
|
22054
|
+
_8.sent();
|
|
21906
22055
|
if (!assertIteration$1(params.viewer, iteration)) {
|
|
21907
22056
|
return [2 /*return*/];
|
|
21908
22057
|
}
|
|
21909
|
-
|
|
22058
|
+
_8.label = 13;
|
|
21910
22059
|
case 13:
|
|
21911
22060
|
hillShades = bSettings === null || bSettings === void 0 ? void 0 : bSettings.hillShades;
|
|
21912
22061
|
if (hillShades == null) {
|
|
@@ -22028,13 +22177,29 @@ function renderNavigator(iteration, params, bookmark, view, getters) {
|
|
|
22028
22177
|
if (dateTime == null) {
|
|
22029
22178
|
dateTime = (_x = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _x === void 0 ? void 0 : _x.dateTime;
|
|
22030
22179
|
}
|
|
22031
|
-
|
|
22032
|
-
|
|
22033
|
-
|
|
22180
|
+
timeline = bSettings === null || bSettings === void 0 ? void 0 : bSettings.timeline;
|
|
22181
|
+
if (timeline == null) {
|
|
22182
|
+
timeline = (_y = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _y === void 0 ? void 0 : _y.timeline;
|
|
22034
22183
|
}
|
|
22184
|
+
if (timeline == null) {
|
|
22185
|
+
timeline = {
|
|
22186
|
+
end: null,
|
|
22187
|
+
playing: false,
|
|
22188
|
+
speed: 1,
|
|
22189
|
+
start: null
|
|
22190
|
+
};
|
|
22191
|
+
}
|
|
22192
|
+
ViewUtils.SetTimeDetails({
|
|
22193
|
+
viewer: viewer,
|
|
22194
|
+
animationSpeed: timeline.speed,
|
|
22195
|
+
currentTimeIso: dateTime,
|
|
22196
|
+
startTimeIso: timeline.start,
|
|
22197
|
+
stopTimeIso: timeline.end,
|
|
22198
|
+
isAnimating: timeline.playing
|
|
22199
|
+
});
|
|
22035
22200
|
selectedIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.selectedEntityIds;
|
|
22036
22201
|
if (selectedIds == null) {
|
|
22037
|
-
selectedIds = (
|
|
22202
|
+
selectedIds = (_z = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _z === void 0 ? void 0 : _z.selectedEntityIds;
|
|
22038
22203
|
}
|
|
22039
22204
|
if (selectedIds != null) {
|
|
22040
22205
|
params.manager.VisualsRegister.ClearSelected();
|
|
@@ -22048,7 +22213,7 @@ function renderNavigator(iteration, params, bookmark, view, getters) {
|
|
|
22048
22213
|
params.manager.VisualsRegister.ClearHidden();
|
|
22049
22214
|
hiddenIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.hiddenEntityIds;
|
|
22050
22215
|
if (hiddenIds == null) {
|
|
22051
|
-
hiddenIds = (
|
|
22216
|
+
hiddenIds = (_0 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _0 === void 0 ? void 0 : _0.hiddenEntityIds;
|
|
22052
22217
|
}
|
|
22053
22218
|
if (hiddenIds != null) {
|
|
22054
22219
|
params.manager.VisualsRegister.SetHidden({
|
|
@@ -22060,7 +22225,7 @@ function renderNavigator(iteration, params, bookmark, view, getters) {
|
|
|
22060
22225
|
params.manager.VisualsRegister.ClearIsolated();
|
|
22061
22226
|
isolatedIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.isolatedEntityIds;
|
|
22062
22227
|
if (isolatedIds == null) {
|
|
22063
|
-
isolatedIds = (
|
|
22228
|
+
isolatedIds = (_1 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _1 === void 0 ? void 0 : _1.isolatedEntityIds;
|
|
22064
22229
|
}
|
|
22065
22230
|
if (isolatedIds != null) {
|
|
22066
22231
|
params.manager.VisualsRegister.SetIsolated({
|
|
@@ -22071,7 +22236,7 @@ function renderNavigator(iteration, params, bookmark, view, getters) {
|
|
|
22071
22236
|
}
|
|
22072
22237
|
labelledIds = bSettings === null || bSettings === void 0 ? void 0 : bSettings.labelledEntityIds;
|
|
22073
22238
|
if (labelledIds == null) {
|
|
22074
|
-
labelledIds = (
|
|
22239
|
+
labelledIds = (_2 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _2 === void 0 ? void 0 : _2.labelledEntityIds;
|
|
22075
22240
|
}
|
|
22076
22241
|
if (!(labelledIds === null || labelledIds === void 0 ? void 0 : labelledIds.length)) {
|
|
22077
22242
|
params.manager.VisualsRegister.ClearLabelled({
|
|
@@ -22095,7 +22260,7 @@ function renderNavigator(iteration, params, bookmark, view, getters) {
|
|
|
22095
22260
|
params.manager.VisualsRegister.ClearOpacity();
|
|
22096
22261
|
entityOpacityMap = bSettings === null || bSettings === void 0 ? void 0 : bSettings.entityOpacityMap;
|
|
22097
22262
|
if (entityOpacityMap == null) {
|
|
22098
|
-
entityOpacityMap = (
|
|
22263
|
+
entityOpacityMap = (_3 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _3 === void 0 ? void 0 : _3.entityOpacityMap;
|
|
22099
22264
|
}
|
|
22100
22265
|
if (entityOpacityMap != null) {
|
|
22101
22266
|
for (entityId in entityOpacityMap) {
|
|
@@ -22109,7 +22274,7 @@ function renderNavigator(iteration, params, bookmark, view, getters) {
|
|
|
22109
22274
|
}
|
|
22110
22275
|
}
|
|
22111
22276
|
}
|
|
22112
|
-
imagery = (bSettings === null || bSettings === void 0 ? void 0 : bSettings.imagery) != null ? bSettings.imagery : (
|
|
22277
|
+
imagery = (bSettings === null || bSettings === void 0 ? void 0 : bSettings.imagery) != null ? bSettings.imagery : (_4 = defaults.settings) === null || _4 === void 0 ? void 0 : _4.imagery;
|
|
22113
22278
|
if (imagery == null) {
|
|
22114
22279
|
// TODO: Need global default.
|
|
22115
22280
|
imagery = [
|
|
@@ -22164,7 +22329,7 @@ function renderNavigator(iteration, params, bookmark, view, getters) {
|
|
|
22164
22329
|
}
|
|
22165
22330
|
viewer.scene.requestRender();
|
|
22166
22331
|
curEnabled = params.manager.GetEnabledItemIds();
|
|
22167
|
-
newItemIds = (
|
|
22332
|
+
newItemIds = (_5 = bSettings === null || bSettings === void 0 ? void 0 : bSettings.menuItemIds) !== null && _5 !== void 0 ? _5 : [];
|
|
22168
22333
|
for (_i = 0, curEnabled_1 = curEnabled; _i < curEnabled_1.length; _i++) {
|
|
22169
22334
|
id = curEnabled_1[_i];
|
|
22170
22335
|
shouldRemove = void 0;
|
|
@@ -22200,11 +22365,11 @@ function renderNavigator(iteration, params, bookmark, view, getters) {
|
|
|
22200
22365
|
bookmark: bookmark
|
|
22201
22366
|
})];
|
|
22202
22367
|
case 14:
|
|
22203
|
-
|
|
22368
|
+
_8.sent();
|
|
22204
22369
|
if (!assertIteration$1(params.viewer, iteration)) {
|
|
22205
22370
|
return [2 /*return*/];
|
|
22206
22371
|
}
|
|
22207
|
-
|
|
22372
|
+
_8.label = 15;
|
|
22208
22373
|
case 15:
|
|
22209
22374
|
if (legacyRelationIds.length || relations.length) {
|
|
22210
22375
|
if (relations.length) {
|
|
@@ -22239,7 +22404,7 @@ function renderNavigator(iteration, params, bookmark, view, getters) {
|
|
|
22239
22404
|
}
|
|
22240
22405
|
gOcclusion = bSettings === null || bSettings === void 0 ? void 0 : bSettings.groundOcclusion;
|
|
22241
22406
|
if (gOcclusion == null) {
|
|
22242
|
-
gOcclusion = (
|
|
22407
|
+
gOcclusion = (_6 = defaults === null || defaults === void 0 ? void 0 : defaults.settings) === null || _6 === void 0 ? void 0 : _6.groundOcclusion;
|
|
22243
22408
|
}
|
|
22244
22409
|
if (gOcclusion == null) {
|
|
22245
22410
|
// TODO: Need global default.
|
|
@@ -22344,7 +22509,7 @@ var ViewRenderEngine;
|
|
|
22344
22509
|
ViewRenderEngine.Render = Render;
|
|
22345
22510
|
})(ViewRenderEngine || (ViewRenderEngine = {}));
|
|
22346
22511
|
|
|
22347
|
-
var VERSION = "3.6.
|
|
22512
|
+
var VERSION = "3.6.8";
|
|
22348
22513
|
|
|
22349
|
-
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, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, Draw3dPolygon, Draw3dPolyline };
|
|
22514
|
+
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 };
|
|
22350
22515
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|