bruce-cesium 2.5.4 → 2.5.6

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.
@@ -1,6 +1,6 @@
1
1
  import { BruceEvent, Cartes, Carto, Entity as Entity$1, Geometry, Tileset, MathUtils, LRUCache, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, ObjectUtils, Bounds, EntityRelationType, DelayQueue, BatchedDataGetter, EntityCoords, EntityFilterGetter, EntitySource, MenuItem, EntityRelation, ENVIRONMENT, ProjectView, ProjectViewBookmark, ProjectViewTile, 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, JulianDate, HeightReference, DistanceDisplayCondition, NearFarScalar, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, HeadingPitchRoll, Transforms, ColorBlendMode, SceneMode, Primitive, Cesium3DTileFeature, Cesium3DTileColorBlendMode, HeadingPitchRange, createOsmBuildings, Cesium3DTileStyle, KmlDataSource, OrthographicFrustum, createWorldTerrain, EllipsoidTerrainProvider, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, Cesium3DTileset, Matrix4, Matrix3, IonResource, CesiumInspector, defined, EllipsoidGeodesic, sampleTerrainMostDetailed, Model, PolygonPipeline, ColorMaterialProperty, EasingFunction, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, Ion, BoundingSphere } from 'cesium';
3
+ import { Cartographic, Entity, Primitive, Cesium3DTileFeature, Color, Cartesian2, CallbackProperty, Cartesian3, Rectangle, Math as Math$1, JulianDate, HeightReference, DistanceDisplayCondition, NearFarScalar, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, HeadingPitchRoll, Transforms, ColorBlendMode, SceneMode, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, KmlDataSource, createOsmBuildings, OrthographicFrustum, EllipsoidTerrainProvider, CesiumInspector, defined, Cesium3DTileset, Matrix4, Matrix3, IonResource, createWorldTerrain, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, EllipsoidGeodesic, sampleTerrainMostDetailed, Model, PolygonPipeline, ColorMaterialProperty, EasingFunction, GeometryInstance, ScreenSpaceEventHandler, ScreenSpaceEventType, Ion, BoundingSphere } from 'cesium';
4
4
 
5
5
  var TIME_LAG = 300;
6
6
  var POSITION_CHECK_TIMER = 950;
@@ -1630,9 +1630,9 @@ function getPolygonExtrusion(entity, tags, ring, posses, heightRef, pStyle) {
1630
1630
  }
1631
1631
  return data;
1632
1632
  }
1633
- function getHeightRef(style) {
1633
+ function getHeightRef(style, defaultStyle) {
1634
1634
  var _a;
1635
- var heightRef = HeightReference.CLAMP_TO_GROUND;
1635
+ var heightRef = defaultStyle == null ? HeightReference.CLAMP_TO_GROUND : defaultStyle;
1636
1636
  var altOptionId = (_a = style === null || style === void 0 ? void 0 : style.altitudeOption) === null || _a === void 0 ? void 0 : _a.id;
1637
1637
  if (altOptionId == 1) {
1638
1638
  heightRef = HeightReference.NONE;
@@ -1693,38 +1693,52 @@ function getName(api, entity) {
1693
1693
  }
1694
1694
  function getStyle(api, entity, styleId) {
1695
1695
  return __awaiter(this, void 0, void 0, function () {
1696
- var style, typeId, type;
1696
+ var style, e_2, typeId, type, e_3;
1697
1697
  return __generator(this, function (_a) {
1698
1698
  switch (_a.label) {
1699
1699
  case 0:
1700
1700
  style = null;
1701
- if (!styleId) return [3 /*break*/, 2];
1701
+ if (!styleId) return [3 /*break*/, 4];
1702
+ _a.label = 1;
1703
+ case 1:
1704
+ _a.trys.push([1, 3, , 4]);
1702
1705
  return [4 /*yield*/, Style.Get({
1703
1706
  api: api,
1704
1707
  styleId: styleId
1705
1708
  })];
1706
- case 1:
1707
- style = (_a.sent()).style;
1708
- _a.label = 2;
1709
1709
  case 2:
1710
- if (!!style) return [3 /*break*/, 5];
1710
+ style = (_a.sent()).style;
1711
+ return [3 /*break*/, 4];
1712
+ case 3:
1713
+ e_2 = _a.sent();
1714
+ console.error(e_2);
1715
+ return [3 /*break*/, 4];
1716
+ case 4:
1717
+ if (!!style) return [3 /*break*/, 9];
1711
1718
  typeId = entity.Bruce["EntityType.ID"];
1712
- if (!typeId) return [3 /*break*/, 5];
1719
+ if (!typeId) return [3 /*break*/, 9];
1713
1720
  return [4 /*yield*/, EntityType.Get({
1714
1721
  api: api,
1715
1722
  entityTypeId: typeId
1716
1723
  })];
1717
- case 3:
1724
+ case 5:
1718
1725
  type = (_a.sent()).entityType;
1719
- if (!type["DisplaySetting.ID"]) return [3 /*break*/, 5];
1726
+ if (!type["DisplaySetting.ID"]) return [3 /*break*/, 9];
1727
+ _a.label = 6;
1728
+ case 6:
1729
+ _a.trys.push([6, 8, , 9]);
1720
1730
  return [4 /*yield*/, Style.Get({
1721
1731
  api: api,
1722
1732
  styleId: type["DisplaySetting.ID"]
1723
1733
  })];
1724
- case 4:
1734
+ case 7:
1725
1735
  style = (_a.sent()).style;
1726
- _a.label = 5;
1727
- case 5: return [2 /*return*/, style];
1736
+ return [3 /*break*/, 9];
1737
+ case 8:
1738
+ e_3 = _a.sent();
1739
+ console.error(e_3);
1740
+ return [3 /*break*/, 9];
1741
+ case 9: return [2 /*return*/, style];
1728
1742
  }
1729
1743
  });
1730
1744
  });
@@ -2100,7 +2114,7 @@ var EntityRenderEngine;
2100
2114
  (function (Point) {
2101
2115
  function Render(params) {
2102
2116
  return __awaiter(this, void 0, void 0, function () {
2103
- var entity, style, type, cEntity, siblings, iconUrlRows, icon, iconUrl, res, e_2, iconScale, heightRef, radius, bFill, cFill, outline, cOutline, outlineWidth, outlineHeight, bOutline, fillHeight, exHeightRef, pos, bColor, cColor, size, heightRef;
2117
+ var entity, style, type, cEntity, siblings, iconUrlRows, icon, iconUrl, res, e_4, iconScale, heightRef, radius, bFill, cFill, outline, cOutline, outlineWidth, outlineHeight, bOutline, fillHeight, exHeightRef, pos, bColor, cColor, size, heightRef;
2104
2118
  return __generator(this, function (_a) {
2105
2119
  switch (_a.label) {
2106
2120
  case 0:
@@ -2153,7 +2167,7 @@ var EntityRenderEngine;
2153
2167
  _a.label = 4;
2154
2168
  case 4: return [3 /*break*/, 6];
2155
2169
  case 5:
2156
- e_2 = _a.sent();
2170
+ e_4 = _a.sent();
2157
2171
  iconUrl = null;
2158
2172
  return [3 /*break*/, 6];
2159
2173
  case 6:
@@ -2254,10 +2268,10 @@ var EntityRenderEngine;
2254
2268
  }
2255
2269
  if (!cEntity) {
2256
2270
  bColor = style.color ? Calculator.GetColor(style.color, entity, params.tags) : null;
2257
- cColor = bColor ? colorToCColor(bColor) : Color.RED;
2271
+ cColor = bColor ? colorToCColor(bColor) : Color.fromCssColorString("rgba(33, 150, 243, 0.8)");
2258
2272
  size = style.size ? Calculator.GetNumber(style.size, entity, params.tags) : null;
2259
2273
  if (size == null) {
2260
- size = 30;
2274
+ size = 20;
2261
2275
  }
2262
2276
  size = EnsureNumber(size);
2263
2277
  if (size <= 0) {
@@ -2406,13 +2420,13 @@ var EntityRenderEngine;
2406
2420
  return null;
2407
2421
  }
2408
2422
  var bColor = style.lineColor ? Calculator.GetColor(style.lineColor, entity, params.tags) : null;
2409
- var cColor = bColor ? colorToCColor(bColor) : Color.RED;
2423
+ var cColor = bColor ? colorToCColor(bColor) : Color.fromCssColorString("rgba(255, 193, 7, 0.8)");
2410
2424
  if (cColor.alpha <= 0) {
2411
2425
  return null;
2412
2426
  }
2413
2427
  var width = style.lineWidth ? Calculator.GetNumber(style.lineWidth, entity, params.tags) : null;
2414
2428
  if (width == null) {
2415
- width = 4;
2429
+ width = 2;
2416
2430
  }
2417
2431
  width = EnsureNumber(width);
2418
2432
  if (width < 0.01) {
@@ -2534,12 +2548,12 @@ var EntityRenderEngine;
2534
2548
  }
2535
2549
  var style = params.style;
2536
2550
  var bFillColor = Calculator.GetColor(style.fillColor, entity, params.tags);
2537
- var cFillColor = bFillColor ? colorToCColor(bFillColor) : Color.RED;
2551
+ var cFillColor = bFillColor ? colorToCColor(bFillColor) : Color.fromCssColorString("rgba(139, 195, 74, 0.8)");
2538
2552
  var bLineColor = Calculator.GetColor(style.lineColor, entity, params.tags);
2539
- var cLineColor = bLineColor ? colorToCColor(bLineColor) : Color.RED;
2553
+ var cLineColor = bLineColor ? colorToCColor(bLineColor) : Color.fromCssColorString("rgba(80, 80, 80, 0.8)");
2540
2554
  var width = style.lineWidth ? Calculator.GetNumber(style.lineWidth, entity, params.tags) : null;
2541
2555
  if (width == null) {
2542
- width = 4;
2556
+ width = 1;
2543
2557
  }
2544
2558
  width = EnsureNumber(width);
2545
2559
  if (width < 0.01) {
@@ -2762,7 +2776,7 @@ var EntityRenderEngine;
2762
2776
  styleScale = 1;
2763
2777
  }
2764
2778
  var hpr = new HeadingPitchRoll(Math$1.toRadians(heading), Math$1.toRadians(pitch), Math$1.toRadians(roll));
2765
- var heightRef = getHeightRef(style);
2779
+ var heightRef = getHeightRef(style, HeightReference.RELATIVE_TO_GROUND);
2766
2780
  var pos = EntityUtils.GetPos({
2767
2781
  viewer: params.viewer,
2768
2782
  entity: entity,
@@ -10026,7 +10040,7 @@ function findKey(apiGetter, keyId, defaultKey) {
10026
10040
  })];
10027
10041
  case 2:
10028
10042
  pKey = (_a.sent()).programKey;
10029
- key = pKey.Key;
10043
+ key = pKey === null || pKey === void 0 ? void 0 : pKey.Key;
10030
10044
  return [3 /*break*/, 4];
10031
10045
  case 3:
10032
10046
  e_1 = _a.sent();
@@ -15002,7 +15016,7 @@ var ViewerUtils;
15002
15016
  ViewerUtils.CreateWidgets = CreateWidgets;
15003
15017
  })(ViewerUtils || (ViewerUtils = {}));
15004
15018
 
15005
- var VERSION$1 = "2.5.4";
15019
+ var VERSION$1 = "2.5.6";
15006
15020
 
15007
15021
  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, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, Draw3dPolygon, Draw3dPolyline };
15008
15022
  //# sourceMappingURL=bruce-cesium.es5.js.map