bruce-cesium 2.7.3 → 2.7.4
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 +72 -21
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +71 -20
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/rendering/render-managers/common/cesium-parabola.js +64 -19
- package/dist/lib/rendering/render-managers/common/cesium-parabola.js.map +1 -1
- package/dist/lib/rendering/render-managers/other/relations-render-manager.js +6 -0
- package/dist/lib/rendering/render-managers/other/relations-render-manager.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/rendering/render-managers/common/cesium-parabola.d.ts +1 -0
- package/package.json +1 -1
package/dist/bruce-cesium.umd.js
CHANGED
|
@@ -3063,6 +3063,7 @@
|
|
|
3063
3063
|
*/
|
|
3064
3064
|
var CesiumParabola = /** @class */ (function () {
|
|
3065
3065
|
function CesiumParabola(params) {
|
|
3066
|
+
this.disposed = false;
|
|
3066
3067
|
this.color = "white";
|
|
3067
3068
|
this.width = 2;
|
|
3068
3069
|
this.duration = 10;
|
|
@@ -3144,6 +3145,9 @@
|
|
|
3144
3145
|
};
|
|
3145
3146
|
CesiumParabola.prototype.Animate = function () {
|
|
3146
3147
|
var _this = this;
|
|
3148
|
+
if (this.disposed) {
|
|
3149
|
+
return null;
|
|
3150
|
+
}
|
|
3147
3151
|
if (this.parabola && !this.viewer.entities.contains(this.parabola)) {
|
|
3148
3152
|
this.viewer.entities.add(this.parabola);
|
|
3149
3153
|
}
|
|
@@ -3175,9 +3179,34 @@
|
|
|
3175
3179
|
var RATE_PER_SECOND = 1000 / 40;
|
|
3176
3180
|
var SEC_DURATION = this.duration;
|
|
3177
3181
|
var HEIGHT_DISTANCE_RATIO = this.heightDistanceRatio;
|
|
3178
|
-
var TOTAL_POINTS =
|
|
3179
|
-
var POINT_LENGTH =
|
|
3180
|
-
var TICK_LENGTH_INC =
|
|
3182
|
+
var TOTAL_POINTS = null;
|
|
3183
|
+
var POINT_LENGTH = null;
|
|
3184
|
+
var TICK_LENGTH_INC = null;
|
|
3185
|
+
// Updates TOTAL_POINTS, POINT_LENGTH, and TICK_LENGTH_INC based on current TOTAL_LENGTH and camera position.
|
|
3186
|
+
// We want less points the further away the camera is.
|
|
3187
|
+
var updateParams = function () {
|
|
3188
|
+
var _a, _b;
|
|
3189
|
+
// TODO: Do distance to parabola line instead.
|
|
3190
|
+
var MIN_POINTS = 30;
|
|
3191
|
+
var totalPoints = 80;
|
|
3192
|
+
var cameraHeight = (_b = (_a = _this.viewer.camera) === null || _a === void 0 ? void 0 : _a.positionCartographic) === null || _b === void 0 ? void 0 : _b.height;
|
|
3193
|
+
if (isNaN(cameraHeight) || cameraHeight >= 100000) {
|
|
3194
|
+
totalPoints = MIN_POINTS;
|
|
3195
|
+
}
|
|
3196
|
+
else if (cameraHeight >= 10000) {
|
|
3197
|
+
totalPoints = 50;
|
|
3198
|
+
}
|
|
3199
|
+
else if (cameraHeight >= 1000) {
|
|
3200
|
+
totalPoints = 80;
|
|
3201
|
+
}
|
|
3202
|
+
else if (cameraHeight >= 100) {
|
|
3203
|
+
totalPoints = 100;
|
|
3204
|
+
}
|
|
3205
|
+
TOTAL_POINTS = Math.max(MIN_POINTS, Math.min(totalPoints, TOTAL_LENGTH * 0.1));
|
|
3206
|
+
POINT_LENGTH = TOTAL_LENGTH / TOTAL_POINTS;
|
|
3207
|
+
TICK_LENGTH_INC = SEC_DURATION == 0 ? TOTAL_LENGTH : TOTAL_POINTS / (RATE_PER_SECOND * SEC_DURATION);
|
|
3208
|
+
};
|
|
3209
|
+
updateParams();
|
|
3181
3210
|
var curPoint = 0;
|
|
3182
3211
|
var quadraticKey = null;
|
|
3183
3212
|
var quadratic = null;
|
|
@@ -3333,30 +3362,45 @@
|
|
|
3333
3362
|
for (var i = 0; i < totalCycles; i++) {
|
|
3334
3363
|
posses.push(getPosition(i));
|
|
3335
3364
|
}
|
|
3336
|
-
|
|
3365
|
+
if (chips) {
|
|
3366
|
+
posses.push(getPosition(increment + chips));
|
|
3367
|
+
}
|
|
3337
3368
|
if (posses.find(function (x) { return !x || !bruceModels.Cartes.ValidateCartes3(x); })) {
|
|
3338
3369
|
return;
|
|
3339
3370
|
}
|
|
3340
3371
|
_this.curPoints = posses;
|
|
3341
3372
|
};
|
|
3373
|
+
var lastTickDate = new Date();
|
|
3374
|
+
var finished = false;
|
|
3342
3375
|
var doTick = function () {
|
|
3343
|
-
var
|
|
3344
|
-
var
|
|
3345
|
-
var
|
|
3346
|
-
if (
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3376
|
+
var curDate = new Date();
|
|
3377
|
+
var seconds = (curDate.getTime() - lastTickDate.getTime()) / 1000;
|
|
3378
|
+
var ticks = seconds * RATE_PER_SECOND;
|
|
3379
|
+
if (!isNaN(ticks) && ticks >= 1) {
|
|
3380
|
+
lastTickDate = curDate;
|
|
3381
|
+
var p1 = _this.curPos1;
|
|
3382
|
+
var p2 = _this.curPos2;
|
|
3383
|
+
var newLength = p1 && p2 ? Cesium.Cartesian3.distance(p1, p2) : -1;
|
|
3384
|
+
if (newLength > 0 && newLength != TOTAL_LENGTH) {
|
|
3385
|
+
TOTAL_LENGTH = newLength;
|
|
3386
|
+
updateParams();
|
|
3387
|
+
}
|
|
3388
|
+
prepareQuadratic();
|
|
3389
|
+
if (quadratic) {
|
|
3390
|
+
if (curPoint < TOTAL_POINTS) {
|
|
3391
|
+
curPoint += (TICK_LENGTH_INC * ticks);
|
|
3392
|
+
}
|
|
3393
|
+
updatePoints();
|
|
3394
|
+
}
|
|
3395
|
+
_this.viewer.scene.requestRender();
|
|
3396
|
+
if (curPoint >= TOTAL_POINTS && !finished) {
|
|
3397
|
+
finished = true;
|
|
3398
|
+
// We can make the interval update super slow now.
|
|
3399
|
+
// We keep it updating in case the positions move.
|
|
3400
|
+
clearInterval(_this.animateInterval);
|
|
3401
|
+
_this.animateInterval = setInterval(doTick, 3000);
|
|
3356
3402
|
}
|
|
3357
|
-
updatePoints();
|
|
3358
3403
|
}
|
|
3359
|
-
_this.viewer.scene.requestRender();
|
|
3360
3404
|
};
|
|
3361
3405
|
this.animateInterval = setInterval(doTick, RATE_PER_SECOND);
|
|
3362
3406
|
return {
|
|
@@ -3366,6 +3410,7 @@
|
|
|
3366
3410
|
};
|
|
3367
3411
|
CesiumParabola.prototype.Dispose = function () {
|
|
3368
3412
|
var _this = this;
|
|
3413
|
+
this.disposed = true;
|
|
3369
3414
|
clearTimeout(this.retryTimeout);
|
|
3370
3415
|
clearInterval(this.animateInterval);
|
|
3371
3416
|
var cEntities = [
|
|
@@ -9074,6 +9119,12 @@
|
|
|
9074
9119
|
})];
|
|
9075
9120
|
case 1:
|
|
9076
9121
|
cEntities = _c.sent();
|
|
9122
|
+
if (this.disposed) {
|
|
9123
|
+
this.register.RemoveRegos({
|
|
9124
|
+
menuItemId: this.item.id
|
|
9125
|
+
});
|
|
9126
|
+
return [2 /*return*/];
|
|
9127
|
+
}
|
|
9077
9128
|
for (i = 0; i < relations.length; i++) {
|
|
9078
9129
|
relation = relations[i];
|
|
9079
9130
|
key = RelationRenderEngine.GetRenderGroupId(relation);
|
|
@@ -15167,7 +15218,7 @@
|
|
|
15167
15218
|
ViewerUtils.CreateWidgets = CreateWidgets;
|
|
15168
15219
|
})(exports.ViewerUtils || (exports.ViewerUtils = {}));
|
|
15169
15220
|
|
|
15170
|
-
var VERSION$1 = "2.7.
|
|
15221
|
+
var VERSION$1 = "2.7.4";
|
|
15171
15222
|
|
|
15172
15223
|
exports.VERSION = VERSION$1;
|
|
15173
15224
|
exports.CesiumViewMonitor = CesiumViewMonitor;
|