bruce-cesium 5.4.3 → 5.4.5

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, ClassificationType, ArcType, CornerType, ShadowMode, ConstantProperty, ConstantPositionProperty, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, HorizontalOrigin, VerticalOrigin, ColorBlendMode, HeadingPitchRoll, Transforms, Model, SceneMode, Primitive, Cesium3DTileFeature, GeoJsonDataSource, Cesium3DTileStyle, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, KmlDataSource, SceneTransforms, EllipsoidTerrainProvider, CesiumInspector, OrthographicFrustum, defined, ClockRange, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, EasingFunction, NearFarScalar, PolygonPipeline, EllipsoidGeodesic, sampleTerrainMostDetailed, Cesium3DTileset, Matrix4, Matrix3, IonResource, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, BoundingSphere, GeometryInstance, Quaternion, ScreenSpaceEventHandler, ScreenSpaceEventType, 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, HeadingPitchRange, Cesium3DTileColorBlendMode, Ion, KmlDataSource, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, CesiumInspector, defined, ClockRange, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, ScreenSpaceEventHandler, ScreenSpaceEventType, Quaternion, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
4
4
 
5
5
  const TIME_LAG = 300;
6
6
  const POSITION_CHECK_TIMER = 950;
@@ -2809,8 +2809,8 @@ var EntityUtils;
2809
2809
  if (location) {
2810
2810
  const latitude = EnsureNumber(location.latitude);
2811
2811
  const longitude = EnsureNumber(location.longitude);
2812
- // Disallowing exact 0.
2813
- if (latitude || longitude) {
2812
+ // Disallowing 0.
2813
+ if (latitude && longitude) {
2814
2814
  const pos3d = Cartesian3.fromDegrees(longitude, latitude, EnsureNumber(location.altitude));
2815
2815
  const toAdjust = [pos3d];
2816
2816
  await ensureHeightRefs(toAdjust, sample);
@@ -2982,8 +2982,8 @@ var EntityUtils;
2982
2982
  if (location && typeof location == "object" && Carto.ValidateCarto(location)) {
2983
2983
  const latitude = EnsureNumber(location.latitude);
2984
2984
  const longitude = EnsureNumber(location.longitude);
2985
- // Disallowing exact 0.
2986
- if (latitude || longitude) {
2985
+ // Disallowing 0.
2986
+ if (latitude && longitude) {
2987
2987
  const pos3d = Cartesian3.fromDegrees(longitude, latitude, EnsureNumber(location.altitude));
2988
2988
  posses.push(pos3d);
2989
2989
  }
@@ -3034,8 +3034,8 @@ var EntityUtils;
3034
3034
  longitude: (EnsureNumber(boundaries.minLongitude) + EnsureNumber(boundaries.maxLongitude)) / 2,
3035
3035
  altitude: 0
3036
3036
  };
3037
- // Disallowing exact 0.
3038
- if (point.latitude || point.longitude) {
3037
+ // Disallowing 0.
3038
+ if (point.latitude && point.longitude) {
3039
3039
  const bPosses = [
3040
3040
  Cartesian3.fromDegrees(EnsureNumber(boundaries.minLongitude), EnsureNumber(boundaries.minLatitude), EnsureNumber(boundaries.minAltitude)),
3041
3041
  Cartesian3.fromDegrees(EnsureNumber(boundaries.maxLongitude), EnsureNumber(boundaries.maxLatitude), EnsureNumber(boundaries.maxAltitude))
@@ -3297,8 +3297,8 @@ var EntityUtils;
3297
3297
  if (location && typeof location == "object" && Carto.ValidateCarto(location)) {
3298
3298
  const latitude = EnsureNumber(location.latitude);
3299
3299
  const longitude = EnsureNumber(location.longitude);
3300
- // Disallowing exact 0.
3301
- if (latitude || longitude) {
3300
+ // Disallowing 0.
3301
+ if (latitude && longitude) {
3302
3302
  return Cartesian3.fromDegrees(longitude, latitude, EnsureNumber(location.altitude));
3303
3303
  }
3304
3304
  }
@@ -3360,8 +3360,8 @@ var EntityUtils;
3360
3360
  longitude: (EnsureNumber(boundaries.minLongitude) + EnsureNumber(boundaries.maxLongitude)) / 2,
3361
3361
  altitude: 0
3362
3362
  };
3363
- // Disallowing exact 0.
3364
- if (point.latitude || point.longitude) {
3363
+ // Disallowing 0.
3364
+ if (point.latitude && point.longitude) {
3365
3365
  if (Carto.ValidateCarto(point)) {
3366
3366
  return Cartesian3.fromDegrees(point.longitude, point.latitude, point.altitude);
3367
3367
  }
@@ -3417,7 +3417,7 @@ var EntityUtils;
3417
3417
  catch (e) {
3418
3418
  console.error(e);
3419
3419
  }
3420
- if (entity && (isNaN(lat) || isNaN(lon) || (lat == 0 && lon == 0))) {
3420
+ if (entity && (isNaN(lat) || isNaN(lon) || (lat == 0 || lon == 0))) {
3421
3421
  try {
3422
3422
  entity = (await Entity$1.Get({
3423
3423
  api,
@@ -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;
@@ -14310,8 +14314,11 @@ var EntitiesIdsRenderManager;
14310
14314
  return;
14311
14315
  }
14312
14316
  let entitiesHistoric = {};
14317
+ let changed = false;
14313
14318
  if ((this.item.BruceEntity.historic || this.item.BruceEntity.historicAttrKey) && entities.length) {
14314
- entitiesHistoric = await this.getHistoricInfo(entities);
14319
+ const res = await this.getHistoricInfo(entities);
14320
+ changed = res[0];
14321
+ entitiesHistoric = res[1];
14315
14322
  }
14316
14323
  const { updated, entities: cEntities } = await EntityRenderEngine.Render({
14317
14324
  viewer: this.viewer,
@@ -14322,7 +14329,7 @@ var EntitiesIdsRenderManager;
14322
14329
  entitiesHistoric: entitiesHistoric,
14323
14330
  entityHistoricDrawTrack: this.item.historicDrawTrack,
14324
14331
  zoomControl: this.item.CameraZoomSettings,
14325
- force
14332
+ force: force || changed
14326
14333
  });
14327
14334
  for (let i = 0; i < entities.length; i++) {
14328
14335
  if (this.disposed) {
@@ -14402,7 +14409,7 @@ var EntitiesIdsRenderManager;
14402
14409
  const newStop = stopTmp.getTime();
14403
14410
  // Complete overlap - we already have all the data.
14404
14411
  if (newStart >= cachedStart && newStop <= cachedStop) {
14405
- return this.entitiesHistoric;
14412
+ return [false, this.entitiesHistoric];
14406
14413
  }
14407
14414
  // Calculate missing ranges.
14408
14415
  rangesToRequest = [];
@@ -14477,7 +14484,7 @@ var EntitiesIdsRenderManager;
14477
14484
  this.lastHistoricMax = stopTmp.toISOString();
14478
14485
  this.entitiesHistoric = combined;
14479
14486
  }
14480
- return combined;
14487
+ return [rangesToRequest.length > 0, combined];
14481
14488
  }
14482
14489
  viewerDateTimeSub() {
14483
14490
  var _a, _b;
@@ -30637,7 +30644,7 @@ class WidgetViewBar extends Widget.AWidget {
30637
30644
  }
30638
30645
  }
30639
30646
 
30640
- const VERSION = "5.4.3";
30647
+ const VERSION = "5.4.5";
30641
30648
 
30642
30649
  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
30650
  //# sourceMappingURL=bruce-cesium.es5.js.map