bruce-cesium 5.4.2 → 5.4.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.
@@ -1,6 +1,6 @@
1
- import { BruceEvent, Cartes, Entity as Entity$1, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, ProjectViewTile, DelayQueue, EntityLod, Bounds, ZoomControl, EntityRelationType, ENVIRONMENT, EntityHistoricData, Tileset, EntityCoords, DataLab, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, ProjectViewLegacyTile, Camera, EntityAttachment, EntityAttachmentType, EntityAttribute, AbstractApi, Session } from 'bruce-models';
1
+ import { BruceEvent, Cartes, Entity as Entity$1, Carto, Geometry, MathUtils, LRUCache, Api, Calculator, ClientFile, EntityTag, EntityType, ObjectUtils, Style, ProjectViewTile, DelayQueue, EntityLod, Bounds, ZoomControl, EntityRelationType, ENVIRONMENT, EntityHistoricData, Tileset, EntityCoords, DataLab, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, Camera, ProjectViewLegacyTile, EntityAttachment, EntityAttachmentType, EntityAttribute, AbstractApi, Session } 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, DistanceDisplayCondition, HorizontalOrigin, VerticalOrigin, ConstantProperty, ClassificationType, ConstantPositionProperty, ArcType, CornerType, ShadowMode, ColorBlendMode, HeadingPitchRoll, Transforms, Model, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileStyle, HeadingPitchRange, Cesium3DTileColorBlendMode, Ion, KmlDataSource, SceneTransforms, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, CesiumInspector, OrthographicFrustum, defined, ClockRange, EasingFunction, NearFarScalar, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, ScreenSpaceEventHandler, ScreenSpaceEventType, Quaternion, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
3
+ import { Cartographic, Cartesian2, Math as Math$1, Cartesian3, CallbackProperty, Color, HeightReference, Rectangle, JulianDate, Entity, DistanceDisplayCondition, HorizontalOrigin, VerticalOrigin, ConstantProperty, ClassificationType, ConstantPositionProperty, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, SceneMode, Primitive, Cesium3DTileFeature, GeoJsonDataSource, Cesium3DTileStyle, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, CesiumInspector, defined, ClockRange, Cesium3DTileset, Matrix4, Matrix3, IonResource, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, Quaternion, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
4
4
 
5
5
  const TIME_LAG = 300;
6
6
  const POSITION_CHECK_TIMER = 950;
@@ -1367,7 +1367,7 @@ var CesiumAnimatedProperty;
1367
1367
  }
1368
1368
  }
1369
1369
  CesiumAnimatedProperty.AnimatePositionSeries = AnimatePositionSeries;
1370
- function GetSeriesPossesForHistoricEntity(viewer, heightRef, historic) {
1370
+ function GetSeriesPossesForHistoricEntity(viewer, dataHeightRef, heightRef, historic) {
1371
1371
  if (!historic || !historic.length) {
1372
1372
  return [];
1373
1373
  }
@@ -1390,7 +1390,7 @@ var CesiumAnimatedProperty;
1390
1390
  const pos3d = EntityUtils.GetPos({
1391
1391
  entity: data,
1392
1392
  viewer: viewer,
1393
- recordHeightRef: heightRef,
1393
+ recordHeightRef: dataHeightRef,
1394
1394
  returnHeightRef: heightRef,
1395
1395
  allowRendered: false
1396
1396
  });
@@ -4410,7 +4410,7 @@ var EntityRenderEnginePoint;
4410
4410
  const bColor = lStyle.lineColor ? Calculator.GetColor(lStyle.lineColor, entity, params.tags) : null;
4411
4411
  const cColor = bColor ? ColorToCColor(bColor) : Color.fromCssColorString("rgba(255, 193, 7, 0.8)");
4412
4412
  if (cColor.alpha > 0) {
4413
- const seriesTrackPosses = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
4413
+ const seriesTrackPosses = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(params.viewer, heightRef, heightRef, params.entityHistoric);
4414
4414
  seriesTrackPosses.reverse();
4415
4415
  let posses = seriesTrackPosses.map(x => x.pos3d);
4416
4416
  posses = CullDuplicateCPosses(posses);
@@ -4491,7 +4491,7 @@ var EntityRenderEnginePoint;
4491
4491
  });
4492
4492
  let position = null;
4493
4493
  // If we have a series of time-based positions then we'll animate as time changes.
4494
- const series = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
4494
+ const series = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(params.viewer, heightRef, heightRef, params.entityHistoric);
4495
4495
  if (series.length > 1) {
4496
4496
  animatePosition = new CesiumAnimatedProperty.AnimatePositionSeries({
4497
4497
  posses: series,
@@ -4555,7 +4555,7 @@ var EntityRenderEnginePoint;
4555
4555
  cEntity.billboard.width = undefined;
4556
4556
  cEntity.billboard.height = undefined;
4557
4557
  // If we have a series of time-based positions then we'll animate as time changes.
4558
- const series = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
4558
+ const series = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(params.viewer, heightRef, heightRef, params.entityHistoric);
4559
4559
  if (series.length > 1) {
4560
4560
  animatePosition = new CesiumAnimatedProperty.AnimatePositionSeries({
4561
4561
  posses: series,
@@ -4809,7 +4809,7 @@ var EntityRenderEnginePoint;
4809
4809
  });
4810
4810
  let position = null;
4811
4811
  // If we have a series of time-based positions then we'll animate as time changes.
4812
- const series = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
4812
+ const series = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(params.viewer, heightRef, heightRef, params.entityHistoric);
4813
4813
  if (series.length > 1) {
4814
4814
  animatePosition = new CesiumAnimatedProperty.AnimatePositionSeries({
4815
4815
  posses: series,
@@ -4878,7 +4878,7 @@ var EntityRenderEnginePoint;
4878
4878
  cEntity.billboard.distanceDisplayCondition = new ConstantProperty(EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance));
4879
4879
  cEntity.billboard.disableDepthTestDistance = new ConstantProperty(disableDepthTest ? Number.POSITIVE_INFINITY : undefined);
4880
4880
  // If we have a series of time-based positions then we'll animate as time changes.
4881
- const series = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
4881
+ const series = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(params.viewer, heightRef, heightRef, params.entityHistoric);
4882
4882
  if (series.length > 1) {
4883
4883
  animatePosition = new CesiumAnimatedProperty.AnimatePositionSeries({
4884
4884
  posses: series,
@@ -6376,7 +6376,7 @@ var EntityRenderEngineModel3d;
6376
6376
  const bColor = lStyle.lineColor ? Calculator.GetColor(lStyle.lineColor, entity, params.tags) : null;
6377
6377
  const cColor = bColor ? ColorToCColor(bColor) : Color.fromCssColorString("rgba(255, 193, 7, 0.8)");
6378
6378
  if (cColor.alpha > 0) {
6379
- const seriesTrackPosses = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
6379
+ const seriesTrackPosses = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(params.viewer, heightRef, heightRef, params.entityHistoric);
6380
6380
  seriesTrackPosses.reverse();
6381
6381
  let posses = seriesTrackPosses.map(x => x.pos3d);
6382
6382
  posses = CullDuplicateCPosses(posses);
@@ -6399,7 +6399,7 @@ var EntityRenderEngineModel3d;
6399
6399
  });
6400
6400
  let position = null;
6401
6401
  // If we have a series of time-based positions then we'll animate as time changes.
6402
- const series = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
6402
+ const series = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(params.viewer, heightRef, heightRef, params.entityHistoric);
6403
6403
  if (series.length > 1) {
6404
6404
  animatePosition = new CesiumAnimatedProperty.AnimatePositionSeries({
6405
6405
  posses: series,
@@ -6475,7 +6475,7 @@ var EntityRenderEngineModel3d;
6475
6475
  cEntity.model.colorBlendMode = new ConstantProperty(blendMode);
6476
6476
  cEntity.model.distanceDisplayCondition = new ConstantProperty(EntityRenderEngine.GetDisplayCondition(params.minDistance, params.maxDistance));
6477
6477
  // If we have a series of time-based positions then we'll animate as time changes.
6478
- const series = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(params.viewer, heightRef, params.entityHistoric);
6478
+ const series = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(params.viewer, heightRef, heightRef, params.entityHistoric);
6479
6479
  if (series.length > 1) {
6480
6480
  animatePosition = new CesiumAnimatedProperty.AnimatePositionSeries({
6481
6481
  posses: series,
@@ -9227,7 +9227,7 @@ var EntityLabel;
9227
9227
  const height = visual.billboard._billboardSize;
9228
9228
  if (height) {
9229
9229
  const scale = EnsureNumber(getValue$1(this.viewer, visual.billboard.scale), 1);
9230
- pixelOffset.y = -(height * scale);
9230
+ pixelOffset.y = -((height * scale) / 2);
9231
9231
  pixelOffset.y -= 5;
9232
9232
  }
9233
9233
  }
@@ -9517,6 +9517,9 @@ var EntityLabel;
9517
9517
  lineEle.style.display = "none";
9518
9518
  return;
9519
9519
  }
9520
+ // Offset start by the pixel offset.
9521
+ lineStartPos2d.x += pixelOffset.x;
9522
+ lineStartPos2d.y += pixelOffset.y;
9520
9523
  ele.style.display = "block";
9521
9524
  lineEle.style.display = "block";
9522
9525
  // Calculate opacity to apply based on distance between camera and pos3d.
@@ -9568,6 +9571,9 @@ var EntityLabel;
9568
9571
  lineEle.style.display = "none";
9569
9572
  return;
9570
9573
  }
9574
+ // Offset end by the pixel offset.
9575
+ lineEndPos2d.x += pixelOffset.x;
9576
+ lineEndPos2d.y += pixelOffset.y;
9571
9577
  // If out of the screen then we can hide it.
9572
9578
  const startOutOfScreen = (lineStartPos2d.x < 0 || lineStartPos2d.x > this.viewer.canvas.clientWidth ||
9573
9579
  lineStartPos2d.y < 0 || lineStartPos2d.y > this.viewer.canvas.clientHeight);
@@ -9580,10 +9586,8 @@ var EntityLabel;
9580
9586
  return;
9581
9587
  }
9582
9588
  // Position the label above the line end point.
9583
- const labelLeft = lineEndPos2d.x + pixelOffset.x;
9584
- const labelTop = lineEndPos2d.y + pixelOffset.y;
9585
- this.label.style.left = `${labelLeft}px`;
9586
- this.label.style.top = `${labelTop}px`;
9589
+ this.label.style.left = `${lineEndPos2d.x}px`;
9590
+ this.label.style.top = `${lineEndPos2d.y}px`;
9587
9591
  // Update line position and size.
9588
9592
  const dx = lineEndPos2d.x - lineStartPos2d.x;
9589
9593
  const dy = lineEndPos2d.y - lineStartPos2d.y;
@@ -17652,7 +17656,7 @@ var TilesetCadRenderManager;
17652
17656
  entityIds: [this.rootId],
17653
17657
  api: api
17654
17658
  });
17655
- const posses = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(this.viewer, HeightReference.NONE, historicData.recordsByIds[this.rootId]);
17659
+ const posses = CesiumAnimatedProperty.GetSeriesPossesForHistoricEntity(this.viewer, HeightReference.NONE, HeightReference.CLAMP_TO_GROUND, historicData.recordsByIds[this.rootId]);
17656
17660
  res(posses);
17657
17661
  }
17658
17662
  catch (e) {
@@ -30637,7 +30641,7 @@ class WidgetViewBar extends Widget.AWidget {
30637
30641
  }
30638
30642
  }
30639
30643
 
30640
- const VERSION = "5.4.2";
30644
+ const VERSION = "5.4.4";
30641
30645
 
30642
30646
  export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, isHistoricMetadataChanged, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, DataLabRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, CESIUM_TIMELINE_LIVE_KEY, CESIUM_TIMELINE_LIVE_PADDING_FORWARD_KEY, CESIUM_TIMELINE_LIVE_PADDING_BACKWARD_KEY, CESIUM_TIMELINE_INTERVAL_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline, MeasureCreator, Walkthrough, Widget, VIEWER_BOOKMARKS_WIDGET_KEY, WidgetBookmarks, WidgetBranding, WidgetCursorBar, WidgetEmbeddedInfoView, WidgetInfoView, WidgetNavCompass$$1 as WidgetNavCompass, VIEWER_VIEW_BAR_WIDGET_KEY, WidgetViewBar, WidgetControlViewBar, WidgetControlViewBarSearch, VIEWER_LEFT_PANEL_WIDGET_KEY, VIEWER_LEFT_PANEL_CSS_VAR_LEFT, WidgetLeftPanel, WidgetLeftPanelTab, WidgetLeftPanelTabBookmarks };
30643
30647
  //# sourceMappingURL=bruce-cesium.es5.js.map