bruce-cesium 3.2.9 → 3.3.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 +58 -28
- package/dist/bruce-cesium.es5.js.map +1 -1
- package/dist/bruce-cesium.umd.js +57 -27
- 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 +5 -2
- package/dist/lib/rendering/entity-render-engine.js.map +1 -1
- package/dist/lib/utils/entity-utils.js +51 -24
- package/dist/lib/utils/entity-utils.js.map +1 -1
- package/dist/types/bruce-cesium.d.ts +1 -1
- package/package.json +2 -2
package/dist/bruce-cesium.es5.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Cartes, Carto, Entity as Entity$1, Geometry, Tileset, MathUtils, LRUCache, ProjectViewTile, DelayQueue, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, EntityRelationType, BruceEvent, EntityCoords, Api, EntitySource, MenuItem, EntityRelation, ProgramKey, ENVIRONMENT, AbstractApi, ProjectViewBookmark, EntityAttachment, EntityAttachmentType, EntityAttribute, ProjectView, ProjectViewLegacyTile, Camera } from 'bruce-models';
|
|
2
2
|
import * as Cesium from 'cesium';
|
|
3
|
-
import { Cartographic,
|
|
3
|
+
import { Cartographic, Color, HeightReference, Cartesian3, DistanceDisplayCondition, NearFarScalar, Model, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, HeadingPitchRoll, Math as Math$1, Transforms, ColorBlendMode, Cartesian2, CallbackProperty, Rectangle, SceneMode, JulianDate, HeadingPitchRange, Ion, Cesium3DTileStyle, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, KmlDataSource, EllipsoidTerrainProvider, CesiumInspector, OrthographicFrustum, defined, EllipsoidGeodesic, sampleTerrainMostDetailed, Cesium3DTileset, Matrix4, Matrix3, IonResource, EasingFunction, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, PolygonPipeline, SceneTransforms, ScreenSpaceEventHandler, ScreenSpaceEventType, BoundingSphere, GeometryInstance, Intersect, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, ColorMaterialProperty } from 'cesium';
|
|
4
4
|
|
|
5
5
|
/*! *****************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1302,7 +1302,7 @@ var EntityUtils;
|
|
|
1302
1302
|
case 0:
|
|
1303
1303
|
entityId = sample.entityId, entity = sample.entity, tileset = sample.tileset, tilesetId = sample.tilesetId;
|
|
1304
1304
|
evaluateRendered = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
1305
|
-
var rego, posses, parts, i, part, visualHeightRef, hierarchy, hPosses, hPossesSample, step, i_1, pPosses, pPossesSample, step, i_2, pPosses, pPossesSample, step, i_3, pos3d_1, toAdjust, modelExt, sphere, data_1, pos3d_2, toAdjust, sphere;
|
|
1305
|
+
var rego, posses, parts, i, part, visualHeightRef, hierarchy, hPosses, hPossesSample, step, i_1, pPosses, pPossesSample, step, i_2, pPosses, pPossesSample, step, i_3, pos3d_1, toAdjust, modelExt, sphere, semiMajorAxis, semiMinorAxis, height, radius, sphere, data_1, pos3d_2, toAdjust, sphere;
|
|
1306
1306
|
return __generator(this, function (_a) {
|
|
1307
1307
|
switch (_a.label) {
|
|
1308
1308
|
case 0:
|
|
@@ -1407,6 +1407,25 @@ var EntityUtils;
|
|
|
1407
1407
|
spheres.push(sphere);
|
|
1408
1408
|
}
|
|
1409
1409
|
}
|
|
1410
|
+
else if (part.ellipse) {
|
|
1411
|
+
semiMajorAxis = GetValue(viewer, part.ellipse.semiMajorAxis);
|
|
1412
|
+
if (!semiMajorAxis || isNaN(semiMajorAxis)) {
|
|
1413
|
+
semiMajorAxis = 0;
|
|
1414
|
+
}
|
|
1415
|
+
semiMinorAxis = GetValue(viewer, part.ellipse.semiMinorAxis);
|
|
1416
|
+
if (!semiMinorAxis || isNaN(semiMinorAxis)) {
|
|
1417
|
+
semiMinorAxis = 0;
|
|
1418
|
+
}
|
|
1419
|
+
height = GetValue(viewer, part.ellipse.extrudedHeight);
|
|
1420
|
+
if (!height || isNaN(height)) {
|
|
1421
|
+
height = 0;
|
|
1422
|
+
}
|
|
1423
|
+
radius = Math.max(semiMajorAxis, semiMinorAxis, height);
|
|
1424
|
+
if (radius && radius > 0) {
|
|
1425
|
+
sphere = new BoundingSphere(pos3d_1, radius);
|
|
1426
|
+
spheres.push(sphere);
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1410
1429
|
_a.label = 15;
|
|
1411
1430
|
case 15: return [3 /*break*/, 18];
|
|
1412
1431
|
case 16:
|
|
@@ -1686,31 +1705,36 @@ var EntityUtils;
|
|
|
1686
1705
|
case 4:
|
|
1687
1706
|
if (allPosses.length > 1) {
|
|
1688
1707
|
rect = allPosses.length == 1 ? null : Rectangle.fromCartesianArray(allPosses);
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
carto.height
|
|
1708
|
+
if (rect.width > 0 && rect.height > 0) {
|
|
1709
|
+
factor = 0.1;
|
|
1710
|
+
marginX = rect.width * factor / 2;
|
|
1711
|
+
marginY = rect.height * factor / 2;
|
|
1712
|
+
rect.east += marginX;
|
|
1713
|
+
rect.west -= marginX;
|
|
1714
|
+
rect.north += marginY;
|
|
1715
|
+
rect.south -= marginY;
|
|
1716
|
+
data.rectangle = rect;
|
|
1717
|
+
carto = Rectangle.center(rect);
|
|
1718
|
+
carto.height = 0;
|
|
1719
|
+
for (i = 0; i < allPosses.length; i++) {
|
|
1720
|
+
pos = allPosses[i];
|
|
1721
|
+
carto.height += Cartographic.fromCartesian(pos).height;
|
|
1722
|
+
}
|
|
1723
|
+
if (carto.height != 0) {
|
|
1724
|
+
carto.height /= allPosses.length;
|
|
1725
|
+
}
|
|
1726
|
+
data.pos3d = Cartesian3.fromRadians(carto.longitude, carto.latitude, carto.height);
|
|
1727
|
+
radius = Cartesian3.distance(Cartesian3.fromRadians(rect.west, rect.north), Cartesian3.fromRadians(rect.east, rect.south));
|
|
1728
|
+
if (radius != 0) {
|
|
1729
|
+
radius /= 2;
|
|
1730
|
+
}
|
|
1731
|
+
sphere = new BoundingSphere(data.pos3d, radius);
|
|
1732
|
+
spheres.push(sphere);
|
|
1733
|
+
data.sphere = sphere;
|
|
1705
1734
|
}
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
if (radius != 0) {
|
|
1709
|
-
radius /= 2;
|
|
1735
|
+
else {
|
|
1736
|
+
data.pos3d = allPosses[0];
|
|
1710
1737
|
}
|
|
1711
|
-
sphere = new BoundingSphere(data.pos3d, radius);
|
|
1712
|
-
spheres.push(sphere);
|
|
1713
|
-
data.sphere = sphere;
|
|
1714
1738
|
}
|
|
1715
1739
|
else if (allPosses.length == 1) {
|
|
1716
1740
|
data.pos3d = allPosses[0];
|
|
@@ -1725,6 +1749,9 @@ var EntityUtils;
|
|
|
1725
1749
|
combinedSphere = BoundingSphere.fromBoundingSpheres(spheres);
|
|
1726
1750
|
data.sphere = combinedSphere;
|
|
1727
1751
|
}
|
|
1752
|
+
if (data.sphere && data.sphere.radius <= 0) {
|
|
1753
|
+
data.sphere = null;
|
|
1754
|
+
}
|
|
1728
1755
|
return [2 /*return*/, data];
|
|
1729
1756
|
}
|
|
1730
1757
|
});
|
|
@@ -3874,7 +3901,7 @@ var EntityRenderEngine;
|
|
|
3874
3901
|
Point.CreateCircleBillboard = CreateCircleBillboard;
|
|
3875
3902
|
function Render(params) {
|
|
3876
3903
|
return __awaiter(this, void 0, void 0, function () {
|
|
3877
|
-
var entity, style, type, cEntity, siblings, iconUrlRows, icon, iconUrl_1, res, blob_1, e_4, e_5, iconScale, disableDepthTest, heightRef, radius, bFill, cFill, outline, cOutline, outlineWidth, bOutline, heightRef, pos3d, extrusion, outlineExtrusion, bColor, cColor, size, heightRef, circleBillboard;
|
|
3904
|
+
var entity, style, type, cEntity, siblings, iconUrlRows, icon, iconUrl_1, res, blob_1, e_4, e_5, iconScale, disableDepthTest, bColor, cColor, heightRef, radius, bFill, cFill, outline, cOutline, outlineWidth, bOutline, heightRef, pos3d, extrusion, outlineExtrusion, bColor, cColor, size, heightRef, circleBillboard;
|
|
3878
3905
|
return __generator(this, function (_a) {
|
|
3879
3906
|
switch (_a.label) {
|
|
3880
3907
|
case 0:
|
|
@@ -3964,6 +3991,8 @@ var EntityRenderEngine;
|
|
|
3964
3991
|
}
|
|
3965
3992
|
disableDepthTest = Boolean(style.renderOnTop);
|
|
3966
3993
|
if (iconScale > 0) {
|
|
3994
|
+
bColor = style.iconTintColor ? Calculator.GetColor(style.iconTintColor, entity, params.tags) : null;
|
|
3995
|
+
cColor = bColor ? colorToCColor(bColor) : undefined;
|
|
3967
3996
|
heightRef = getHeightRef(style);
|
|
3968
3997
|
cEntity = new Entity({
|
|
3969
3998
|
id: ObjectUtils.UId(10),
|
|
@@ -3974,7 +4003,8 @@ var EntityRenderEngine;
|
|
|
3974
4003
|
heightReference: getHeightRef(style),
|
|
3975
4004
|
scale: iconScale,
|
|
3976
4005
|
disableDepthTestDistance: disableDepthTest ? Number.POSITIVE_INFINITY : undefined,
|
|
3977
|
-
distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance)
|
|
4006
|
+
distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance),
|
|
4007
|
+
color: cColor
|
|
3978
4008
|
// Would be great once we have a setting for this.
|
|
3979
4009
|
// translucencyByDistance: getTranslucencyByDistance(params.minDistance, params.maxDistance),
|
|
3980
4010
|
},
|
|
@@ -20003,7 +20033,7 @@ var CesiumViewMonitor;
|
|
|
20003
20033
|
CesiumViewMonitor$$1.Monitor = Monitor;
|
|
20004
20034
|
})(CesiumViewMonitor || (CesiumViewMonitor = {}));
|
|
20005
20035
|
|
|
20006
|
-
var VERSION$1 = "3.
|
|
20036
|
+
var VERSION$1 = "3.3.1";
|
|
20007
20037
|
|
|
20008
20038
|
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 };
|
|
20009
20039
|
//# sourceMappingURL=bruce-cesium.es5.js.map
|