bruce-cesium 4.6.3 → 4.6.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, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, ProjectViewLegacyTile, Camera, EntityAttribute, EntityAttachment, EntityAttachmentType, 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, EntitySource, MenuItem, EntityRelation, ProgramKey, ProjectView, ProjectViewBookmark, ProjectViewLegacyTile, Camera, AbstractApi, Session, EntityAttribute, EntityAttachment, EntityAttachmentType } 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, ConstantPositionProperty, ClassificationType, ArcType, CornerType, ShadowMode, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, SceneMode, GeoJsonDataSource, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, SceneTransforms, OrthographicFrustum, EasingFunction, NearFarScalar, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, CesiumInspector, ClockRange, PolygonPipeline, 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, ClassificationType, PolygonHierarchy, ShadowMode, ConstantProperty, ConstantPositionProperty, PolylineGraphics, ArcType, CornerType, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, HorizontalOrigin, VerticalOrigin, Primitive, Cesium3DTileFeature, GeoJsonDataSource, SceneMode, Cesium3DTileColorBlendMode, HeadingPitchRange, Cesium3DTileStyle, Ion, KmlDataSource, SceneTransforms, EllipsoidTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, IonImageryProvider, CesiumTerrainProvider, OrthographicFrustum, EasingFunction, NearFarScalar, EllipsoidGeodesic, sampleTerrainMostDetailed, defined, Cesium3DTileset, Matrix4, Matrix3, IonResource, PolygonPipeline, CesiumInspector, ClockRange, BoundingSphere, GeometryInstance, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, Quaternion, ScreenSpaceEventHandler, ScreenSpaceEventType, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
4
4
 
5
5
  /*! *****************************************************************************
6
6
  Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8414,16 +8414,16 @@ var EntityRenderEngine;
8414
8414
  min = 0;
8415
8415
  }
8416
8416
  // Adjusting slightly because I distrust our initial calculation vs Cesium's one.
8417
- max = (+max) * 1.2;
8417
+ max = (+max) * 1.8;
8418
8418
  min = +min;
8419
8419
  if (min > 0) {
8420
8420
  min = (+min) * 0.8;
8421
8421
  }
8422
8422
  meterSize = +meterSize;
8423
8423
  if (!isNaN(meterSize) && meterSize > 0) {
8424
- // A 1m thing at 2000m distance is barely visible, so we can cull it.
8424
+ // A 1m thing at 3000m distance is barely visible, so we can cull it.
8425
8425
  // So we'll multiply this magic distance by the size of the thing and determine when it'll be too small to see.
8426
- var METER_DISTANCE_PER_METER = isPolygon ? 100 : 2000;
8426
+ var METER_DISTANCE_PER_METER = isPolygon ? 200 : 3000;
8427
8427
  var newMax = meterSize * METER_DISTANCE_PER_METER;
8428
8428
  // Enforcing a minimum max distance in case something goes wrong we want stuff to always be visible when close.
8429
8429
  var MIN_MAX = 300;
@@ -16032,10 +16032,10 @@ var EntityGlobe;
16032
16032
  return range;
16033
16033
  }
16034
16034
  // Add minor decimal as API crashes when giving it whole numbers.
16035
- var maxLon = prepareRangeForBounds(this.Boundaries.maxLongitude) + 0.00001;
16036
- var minLon = prepareRangeForBounds(this.Boundaries.minLongitude) - 0.00001;
16037
- var maxLat = prepareRangeForBounds(this.Boundaries.maxLatitude) + 0.00001;
16038
- var minLat = prepareRangeForBounds(this.Boundaries.minLatitude) - 0.00001;
16035
+ var maxLon = prepareRangeForBounds(this.Boundaries.maxLongitude);
16036
+ var minLon = prepareRangeForBounds(this.Boundaries.minLongitude);
16037
+ var maxLat = prepareRangeForBounds(this.Boundaries.maxLatitude);
16038
+ var minLat = prepareRangeForBounds(this.Boundaries.minLatitude);
16039
16039
  return {
16040
16040
  east: maxLon,
16041
16041
  north: maxLat,
@@ -16058,6 +16058,7 @@ var EntityGlobe;
16058
16058
  var maxLon = viewRect.east;
16059
16059
  var MAX_CELLS = 150;
16060
16060
  var cellDegreeSize = getCellSizeFromHeight(viewRect.alt);
16061
+ // console.log("cell size", cellDegreeSize, "height", viewRect.alt);
16061
16062
  var curMinLon = floorValueToCellSize(cellDegreeSize, minLon);
16062
16063
  var curMinLat = floorValueToCellSize(cellDegreeSize, minLat);
16063
16064
  // For larger views we add additional padding because our view-area culling is too strong.
@@ -16114,39 +16115,45 @@ function getCellSizeFromHeight(height) {
16114
16115
  return 0.01;
16115
16116
  }
16116
16117
  if (height < 5000) {
16117
- return 0.025;
16118
+ return 0.05;
16118
16119
  }
16119
16120
  else if (height < 10000) {
16120
16121
  return 0.05;
16121
16122
  }
16122
16123
  else if (height < 30000) {
16123
- return 0.1;
16124
+ return 0.2;
16124
16125
  }
16125
16126
  else if (height < 70000) {
16126
16127
  return 0.2;
16127
16128
  }
16128
16129
  else if (height < 100000) {
16129
- return 0.3;
16130
+ return 0.5;
16130
16131
  }
16131
16132
  else if (height < 150000) {
16132
- return 0.4;
16133
+ return 0.5;
16133
16134
  }
16134
16135
  else if (height < 200000) {
16135
- return 0.5;
16136
+ return 1.5;
16136
16137
  }
16137
16138
  else if (height < 300000) {
16138
- return 0.6;
16139
+ return 1.5;
16139
16140
  }
16140
16141
  else if (height < 500000) {
16141
- return 1;
16142
+ return 3;
16142
16143
  }
16143
16144
  else if (height < 1000000) {
16144
- return 1.3;
16145
+ return 3;
16145
16146
  }
16146
16147
  else if (height < 1200000) {
16147
- return 1.8;
16148
+ return 4;
16149
+ }
16150
+ else if (height < 2000000) {
16151
+ return 6;
16152
+ }
16153
+ else if (height < 3000000) {
16154
+ return 20;
16148
16155
  }
16149
- return 4;
16156
+ return 35;
16150
16157
  }
16151
16158
  function isCellFetched(cell) {
16152
16159
  if (cell.Fetched) {
@@ -16475,14 +16482,14 @@ var EntityFilterGetter;
16475
16482
  return __generator(this, function (_j) {
16476
16483
  switch (_j.label) {
16477
16484
  case 0:
16478
- // Minor delay to stop 50 menu items enabling doing their first request all together.
16479
- // This gives it time to recognize only 1 request is needed.
16480
- // Would be better to not use this delay but we're on a clock.
16481
- return [4 /*yield*/, delay(100)];
16485
+ // Larger initial delay for the first loops because terrain is likely loading in.
16486
+ // We also delay because if we enable 50 Menu Items at the same time, common requests we be made if we wait a bit.
16487
+ // Eg: same entity type will be grouped into the same filter getter instance.
16488
+ return [4 /*yield*/, delay(loopId <= 3 ? 800 : 300)];
16482
16489
  case 1:
16483
- // Minor delay to stop 50 menu items enabling doing their first request all together.
16484
- // This gives it time to recognize only 1 request is needed.
16485
- // Would be better to not use this delay but we're on a clock.
16490
+ // Larger initial delay for the first loops because terrain is likely loading in.
16491
+ // We also delay because if we enable 50 Menu Items at the same time, common requests we be made if we wait a bit.
16492
+ // Eg: same entity type will be grouped into the same filter getter instance.
16486
16493
  _j.sent();
16487
16494
  MIN_HEIGHT = this.minHeight;
16488
16495
  MAX_HEIGHT = this.maxHeight;
@@ -16678,12 +16685,11 @@ var EntityFilterGetter;
16678
16685
  this.historicRefreshAbortController = null;
16679
16686
  }
16680
16687
  (function () { return __awaiter(_this, void 0, void 0, function () {
16681
- var pageIndex, i, batch, controller, entities, e_2;
16688
+ var i, batch, controller, entities, e_2;
16682
16689
  var _a;
16683
16690
  return __generator(this, function (_b) {
16684
16691
  switch (_b.label) {
16685
16692
  case 0:
16686
- pageIndex = 0;
16687
16693
  _b.label = 1;
16688
16694
  case 1:
16689
16695
  _b.trys.push([1, 6, , 7]);
@@ -16702,8 +16708,8 @@ var EntityFilterGetter;
16702
16708
  historicPoint: historicAttrDateTime,
16703
16709
  schemaId: this.schemaId,
16704
16710
  filter: {
16705
- pageSize: SCAN_BATCH_SIZE,
16706
- pageIndex: pageIndex,
16711
+ pageSize: batch.length,
16712
+ pageIndex: 0,
16707
16713
  entityTypeId: this.typeId,
16708
16714
  layerIds: this.tagIds,
16709
16715
  layerIdsOperator: "in",
@@ -16738,7 +16744,6 @@ var EntityFilterGetter;
16738
16744
  return [3 /*break*/, 5];
16739
16745
  }
16740
16746
  (_a = this.onUpdate) === null || _a === void 0 ? void 0 : _a.Trigger(entities);
16741
- pageIndex += 1;
16742
16747
  _b.label = 4;
16743
16748
  case 4:
16744
16749
  i += SCAN_BATCH_SIZE;
@@ -28071,7 +28076,7 @@ var WidgetViewBar = /** @class */ (function (_super) {
28071
28076
  return WidgetViewBar;
28072
28077
  }(Widget.AWidget));
28073
28078
 
28074
- var VERSION = "4.6.3";
28079
+ var VERSION = "4.6.5";
28075
28080
 
28076
28081
  export { VERSION, CesiumViewMonitor, ViewerUtils, ViewerEventTracker, MenuItemManager, EntityRenderEngine, EntityRenderEnginePoint, EntityRenderEnginePolyline, EntityRenderEnginePolygon, EntityRenderEngineModel3d, MenuItemCreator, VisualsRegister, RenderManager, EntitiesIdsRenderManager, EntitiesLoadedRenderManager, EntitiesRenderManager, EntityRenderManager, TilesetCadRenderManager, TilesetArbRenderManager, TilesetEntitiesRenderManager, TilesetOsmRenderManager, TilesetPointcloudRenderManager, TilesetGooglePhotosRenderManager, DataSourceStaticKmlManager, GoogleSearchRenderManager, RelationsRenderManager, SharedGetters, CesiumParabola, EntityLabel, ViewRenderEngine, TileRenderEngine, TilesetRenderEngine, CESIUM_INSPECTOR_KEY, CESIUM_TIMELINE_KEY, ViewUtils, DrawingUtils, MeasureUtils, EntityUtils, CesiumEntityStyler, CesiumAnimatedProperty, CesiumAnimatedInOut, Draw3dPolygon, Draw3dPolyline, MeasureCreator, 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 };
28077
28082
  //# sourceMappingURL=bruce-cesium.es5.js.map