bruce-cesium 3.1.0 → 3.1.1
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 +35 -8
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +34 -7
- package/dist/bruce-cesium.umd.js.map +1 -1
- package/dist/lib/bruce-cesium.js +1 -1
- package/dist/lib/utils/entity-utils.js +33 -6
- package/dist/lib/utils/entity-utils.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/dist/types/utils/entity-utils.d.ts +1 -0
- package/package.json +2 -2
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BruceEvent, Cartes, ProjectViewTile, Carto, Entity as Entity$1, Geometry, Tileset, MathUtils, LRUCache, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, EntityRelationType, DelayQueue, EntityCoords, Api, EntitySource, MenuItem, EntityRelation, ENVIRONMENT, ProjectView, ProjectViewBookmark, ProjectViewLegacyTile, ProgramKey, Camera, AbstractApi, EntityAttachment, EntityAttachmentType, EntityAttribute } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic, Cartesian2, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1, HeightReference, DistanceDisplayCondition, NearFarScalar, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Model,
|
|
3
|
+
import { Cartographic, Cartesian2, CallbackProperty, Cartesian3, Color, Rectangle, Math as Math$1, JulianDate, HeightReference, DistanceDisplayCondition, NearFarScalar, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Model, Primitive, Cesium3DTileFeature, SceneMode, HeadingPitchRange, Cesium3DTileColorBlendMode, createOsmBuildings, Cesium3DTileStyle, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, Cesium3DTileset, Matrix4, Matrix3, IonResource, Ion, EllipsoidTerrainProvider, CesiumInspector, defined, createWorldTerrain, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, ScreenSpaceEventHandler, ScreenSpaceEventType, ColorMaterialProperty, BoundingSphere, GeometryInstance, Intersect } from 'cesium';
|
|
4
4
|
|
|
5
5
|
var TIME_LAG = 300;
|
|
6
6
|
var POSITION_CHECK_TIMER = 950;
|
|
@@ -1127,7 +1127,7 @@ var EntityUtils;
|
|
|
1127
1127
|
function GetLocation(params) {
|
|
1128
1128
|
var _a, _b;
|
|
1129
1129
|
return __awaiter(this, void 0, void 0, function () {
|
|
1130
|
-
var api, viewer, samples, visualRegister, minimumAlt, paddingAlt, MAX_DISTANCE_BETWEEN_SAMPLES, MAX_TERRAIN_SAMPLES, terrainSamples, MAX_API_CALLS, apiCalls, MAX_VALID_SAMPLES, validSamples, MIN_RECT_DIAGONAL_LENGTH, terrainProviderReady, data, processPosHeight, ensureHeightRefs, getEntityPositions, allPosses, i, sample, samplePosses, valid, j, samplePos, k, allPos, distance, rect, factor, marginX, marginY, diagonalLen, terrData, posCarto, height, MIN_POSSES_LEN;
|
|
1130
|
+
var api, viewer, samples, visualRegister, minimumAlt, paddingAlt, MAX_DISTANCE_BETWEEN_SAMPLES, MAX_TERRAIN_SAMPLES, terrainSamples, MAX_API_CALLS, apiCalls, MAX_VALID_SAMPLES, validSamples, MIN_RECT_DIAGONAL_LENGTH, terrainProviderReady, data, spheres, processPosHeight, ensureHeightRefs, getEntityPositions, allPosses, i, sample, samplePosses, valid, j, samplePos, k, allPos, distance, rect, factor, marginX, marginY, diagonalLen, terrData, posCarto, height, MIN_POSSES_LEN, allPointSphere, rectSphere, combinedSphere;
|
|
1131
1131
|
var _this = this;
|
|
1132
1132
|
return __generator(this, function (_c) {
|
|
1133
1133
|
switch (_c.label) {
|
|
@@ -1150,8 +1150,10 @@ var EntityUtils;
|
|
|
1150
1150
|
terrainProviderReady = Boolean((_a = viewer === null || viewer === void 0 ? void 0 : viewer.terrainProvider) === null || _a === void 0 ? void 0 : _a.ready);
|
|
1151
1151
|
data = {
|
|
1152
1152
|
pos3d: null,
|
|
1153
|
-
rectangle: null
|
|
1153
|
+
rectangle: null,
|
|
1154
|
+
sphere: null
|
|
1154
1155
|
};
|
|
1156
|
+
spheres = [];
|
|
1155
1157
|
processPosHeight = function (pos3d, heightRef) { return __awaiter(_this, void 0, void 0, function () {
|
|
1156
1158
|
var carto, baseHeight, terrData, height, carto;
|
|
1157
1159
|
return __generator(this, function (_a) {
|
|
@@ -1235,7 +1237,7 @@ var EntityUtils;
|
|
|
1235
1237
|
});
|
|
1236
1238
|
}); };
|
|
1237
1239
|
getEntityPositions = function (sample) { return __awaiter(_this, void 0, void 0, function () {
|
|
1238
|
-
var entityId, entity, tileset, tilesetId, e_1, evaluateRendered, evaluateRecord, renderedPosses, recordPosses, e_2, tSettings, pos3d, alt, alt, heading, pitch, roll, matrix4, offset, m1, hpr, transform, transformedOffset;
|
|
1240
|
+
var entityId, entity, tileset, tilesetId, e_1, evaluateRendered, evaluateRecord, renderedPosses, recordPosses, e_2, tSettings, pos3d, alt, alt, heading, pitch, roll, matrix4, offset, m1, hpr, transform, transformedOffset, sphere;
|
|
1239
1241
|
var _this = this;
|
|
1240
1242
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
1241
1243
|
return __generator(this, function (_l) {
|
|
@@ -1266,7 +1268,7 @@ var EntityUtils;
|
|
|
1266
1268
|
return [2 /*return*/, []];
|
|
1267
1269
|
}
|
|
1268
1270
|
evaluateRendered = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1269
|
-
var rego, posses, visual, visualHeightRef, hierarchy, hPosses, hPossesSample, step, i, pPosses, pPossesSample, step, i, pPosses, pPossesSample, step, i, pos3d_1;
|
|
1271
|
+
var rego, posses, visual, visualHeightRef, hierarchy, hPosses, hPossesSample, step, i, pPosses, pPossesSample, step, i, pPosses, pPossesSample, step, i, pos3d_1, modelExt, sphere;
|
|
1270
1272
|
return __generator(this, function (_a) {
|
|
1271
1273
|
switch (_a.label) {
|
|
1272
1274
|
case 0:
|
|
@@ -1359,6 +1361,14 @@ var EntityUtils;
|
|
|
1359
1361
|
case 13:
|
|
1360
1362
|
pos3d_1 = _a.sent();
|
|
1361
1363
|
posses.push(pos3d_1);
|
|
1364
|
+
if (visual.model) {
|
|
1365
|
+
modelExt = visual.model;
|
|
1366
|
+
if (modelExt._radius) {
|
|
1367
|
+
sphere = BoundingSphere.fromPoints([pos3d_1]);
|
|
1368
|
+
sphere.radius = modelExt._radius;
|
|
1369
|
+
spheres.push(sphere);
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1362
1372
|
_a.label = 14;
|
|
1363
1373
|
case 14: return [2 /*return*/, posses];
|
|
1364
1374
|
}
|
|
@@ -1480,7 +1490,7 @@ var EntityUtils;
|
|
|
1480
1490
|
case 12:
|
|
1481
1491
|
tSettings = tileset === null || tileset === void 0 ? void 0 : tileset.settings;
|
|
1482
1492
|
pos3d = null;
|
|
1483
|
-
if (!(((_b = entity === null || entity === void 0 ? void 0 : entity.location) === null || _b === void 0 ? void 0 : _b.longitude) || ((_c = tSettings === null || tSettings === void 0 ? void 0 : tSettings.location) === null || _c === void 0 ? void 0 : _c.longitude))) return [3 /*break*/,
|
|
1493
|
+
if (!(((_b = entity === null || entity === void 0 ? void 0 : entity.location) === null || _b === void 0 ? void 0 : _b.longitude) || ((_c = tSettings === null || tSettings === void 0 ? void 0 : tSettings.location) === null || _c === void 0 ? void 0 : _c.longitude))) return [3 /*break*/, 15];
|
|
1484
1494
|
if ((_d = entity === null || entity === void 0 ? void 0 : entity.location) === null || _d === void 0 ? void 0 : _d.longitude) {
|
|
1485
1495
|
alt = +entity.location.altitude;
|
|
1486
1496
|
if (isNaN(alt)) {
|
|
@@ -1495,7 +1505,7 @@ var EntityUtils;
|
|
|
1495
1505
|
}
|
|
1496
1506
|
pos3d = Cartesian3.fromDegrees(+tSettings.location.longitude, +tSettings.location.latitude, alt);
|
|
1497
1507
|
}
|
|
1498
|
-
if (!(entity === null || entity === void 0 ? void 0 : entity.worldPosition)) return [3 /*break*/,
|
|
1508
|
+
if (!(entity === null || entity === void 0 ? void 0 : entity.worldPosition)) return [3 /*break*/, 15];
|
|
1499
1509
|
heading = 0;
|
|
1500
1510
|
pitch = 0;
|
|
1501
1511
|
roll = 0;
|
|
@@ -1546,6 +1556,13 @@ var EntityUtils;
|
|
|
1546
1556
|
pos3d = _l.sent();
|
|
1547
1557
|
_l.label = 14;
|
|
1548
1558
|
case 14:
|
|
1559
|
+
if ((entity === null || entity === void 0 ? void 0 : entity.geometryRadius) && (pos3d === null || pos3d === void 0 ? void 0 : pos3d.x)) {
|
|
1560
|
+
sphere = BoundingSphere.fromPoints([pos3d]);
|
|
1561
|
+
sphere.radius = entity.geometryRadius;
|
|
1562
|
+
spheres.push(sphere);
|
|
1563
|
+
}
|
|
1564
|
+
_l.label = 15;
|
|
1565
|
+
case 15:
|
|
1549
1566
|
if (pos3d) {
|
|
1550
1567
|
return [2 /*return*/, [pos3d]];
|
|
1551
1568
|
}
|
|
@@ -1620,6 +1637,16 @@ var EntityUtils;
|
|
|
1620
1637
|
else if (allPosses.length == 1) {
|
|
1621
1638
|
data.pos3d = allPosses[0];
|
|
1622
1639
|
}
|
|
1640
|
+
if (spheres.length) {
|
|
1641
|
+
allPointSphere = BoundingSphere.fromPoints(allPosses);
|
|
1642
|
+
spheres.push(allPointSphere);
|
|
1643
|
+
if (data.rectangle) {
|
|
1644
|
+
rectSphere = BoundingSphere.fromRectangle3D(data.rectangle);
|
|
1645
|
+
spheres.push(rectSphere);
|
|
1646
|
+
}
|
|
1647
|
+
combinedSphere = BoundingSphere.fromBoundingSpheres(spheres);
|
|
1648
|
+
data.sphere = combinedSphere;
|
|
1649
|
+
}
|
|
1623
1650
|
return [2 /*return*/, data];
|
|
1624
1651
|
}
|
|
1625
1652
|
});
|
|
@@ -18536,7 +18563,7 @@ var ViewerUtils;
|
|
|
18536
18563
|
ViewerUtils.CreateWidgets = CreateWidgets;
|
|
18537
18564
|
})(ViewerUtils || (ViewerUtils = {}));
|
|
18538
18565
|
|
|
18539
|
-
var VERSION$1 = "3.1.
|
|
18566
|
+
var VERSION$1 = "3.1.1";
|
|
18540
18567
|
|
|
18541
18568
|
export { VERSION$1 as 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, Draw3dPolygon, Draw3dPolyline };
|
|
18542
18569
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|