bruce-cesium 5.3.3 → 5.3.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, HorizontalOrigin, VerticalOrigin, PolygonHierarchy, PolylineGraphics, ColorMaterialProperty, ColorBlendMode, HeadingPitchRoll, Transforms, Model, Primitive, Cesium3DTileFeature, GeoJsonDataSource, SceneMode, Cesium3DTileStyle, Cesium3DTileColorBlendMode, HeadingPitchRange, Ion, KmlDataSource, SceneTransforms, EllipsoidTerrainProvider, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, OrthographicFrustum, EasingFunction, NearFarScalar, CesiumInspector, defined, ClockRange, PolygonPipeline, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidGeodesic, sampleTerrainMostDetailed, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, BoundingSphere, GeometryInstance, 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, Cesium3DTileset, Matrix4, Matrix3, IonResource, EllipsoidTerrainProvider, CesiumInspector, defined, ClockRange, EllipsoidGeodesic, sampleTerrainMostDetailed, PolygonPipeline, IonImageryProvider, createWorldImagery, createWorldImageryAsync, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, UrlTemplateImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, TileMapServiceImageryProvider, CesiumTerrainProvider, ModelGraphics, PolygonGraphics, CorridorGraphics, PointGraphics, BillboardGraphics, EllipseGraphics, PolylineDashMaterialProperty, Quaternion, ScreenSpaceEventHandler, ScreenSpaceEventType, BoundingSphere, GeometryInstance, CzmlDataSource, Intersect, Fullscreen } from 'cesium';
4
4
 
5
5
  const TIME_LAG = 300;
6
6
  const POSITION_CHECK_TIMER = 950;
@@ -1539,12 +1539,12 @@ function getColor$1(viewer, key, graphic) {
1539
1539
  storeColor(key, color, graphic);
1540
1540
  }
1541
1541
  }
1542
- else if (key == "select") {
1543
- color = _selectColor;
1544
- }
1545
1542
  else if (key == "highlight") {
1546
1543
  color = _highlightColor;
1547
1544
  }
1545
+ else if (key == "select") {
1546
+ color = _selectColor;
1547
+ }
1548
1548
  }
1549
1549
  return color;
1550
1550
  }
@@ -1570,19 +1570,19 @@ function refreshColor(viewer, graphic, opacity) {
1570
1570
  var _a, _b;
1571
1571
  // Calculate what color key we should apply.
1572
1572
  let key = "default";
1573
- if (getKeyState(graphic, "select")) {
1574
- key = "select";
1575
- }
1576
- else if (getKeyState(graphic, "highlight")) {
1573
+ if (getKeyState(graphic, "highlight")) {
1577
1574
  key = "highlight";
1578
1575
  }
1576
+ else if (getKeyState(graphic, "select")) {
1577
+ key = "select";
1578
+ }
1579
1579
  // This ensures that the default color is always stored prior to applying a new color.
1580
1580
  if (key != "default") {
1581
1581
  getColor$1(viewer, "default", graphic);
1582
1582
  }
1583
1583
  let color = (_a = getColor$1(viewer, key, graphic)) !== null && _a !== void 0 ? _a : Color.WHITE;
1584
- // If we're highlighting and it's selected, don't change the color.
1585
- if (key != "highlight" || getKeyState(graphic, "select") == false) {
1584
+ // If we're selecting and it's highlighted, don't change the color.
1585
+ if (key != "select" || getKeyState(graphic, "highlight") == false) {
1586
1586
  let animateMs = key == "highlight" ? ANIMATE_COLOR_HIGHLIGHT_MS : ANIMATE_COLOR_MS;
1587
1587
  color = color.clone();
1588
1588
  // Multiply opacity if one is set.
@@ -1738,12 +1738,12 @@ function getKeyState(graphic, key) {
1738
1738
  var CesiumEntityStyler;
1739
1739
  (function (CesiumEntityStyler) {
1740
1740
  function UpdateColorSetting(key, color) {
1741
- if (key == "select") {
1742
- _selectColor = color.clone();
1743
- }
1744
- else if (key == "highlight") {
1741
+ if (key == "highlight") {
1745
1742
  _highlightColor = color.clone();
1746
1743
  }
1744
+ else if (key == "select") {
1745
+ _selectColor = color.clone();
1746
+ }
1747
1747
  }
1748
1748
  CesiumEntityStyler.UpdateColorSetting = UpdateColorSetting;
1749
1749
  function Refresh(params) {
@@ -22885,37 +22885,52 @@ var TileRenderEngine;
22885
22885
  let maxLevel = settings === null || settings === void 0 ? void 0 : settings.levelMax;
22886
22886
  const hasLevels = !isNaN(minLevel) && !isNaN(maxLevel);
22887
22887
  if (tileset.type === Tileset.EType.GeoMap) {
22888
- if (TileMapServiceImageryProvider.hasOwnProperty("fromUrl")) {
22889
- const url = Tileset.GetPublicFileUrl({
22888
+ let url = null;
22889
+ if (tileset.loadUrl) {
22890
+ url = tileset.loadUrl;
22891
+ }
22892
+ // To be removed.
22893
+ else {
22894
+ url = Tileset.GetPublicFileUrl({
22890
22895
  api,
22891
22896
  tilesetId: meta.tilesetId,
22892
22897
  file: "",
22893
22898
  viaCdn: true,
22894
22899
  viaCdnCacheToken: tileset.generateVersion
22895
22900
  });
22896
- provider = await CESIUM.TileMapServiceImageryProvider.fromUrl(url, {
22897
- fileExtension: "png",
22898
- // Tested to not cause increased lag.
22899
- rectangle: boundaries,
22901
+ }
22902
+ // Nextspace imagery with a custom suffix.
22903
+ // This usually means it was generated through another service.
22904
+ if ((settings === null || settings === void 0 ? void 0 : settings.loadUrlSuffix) || url.endsWith(".png")) {
22905
+ provider = new UrlTemplateImageryProvider({
22906
+ url: url,
22907
+ tileHeight: 256,
22908
+ tileWidth: 256,
22900
22909
  maximumLevel: hasLevels ? maxLevel : undefined,
22901
22910
  minimumLevel: hasLevels ? minLevel : undefined,
22902
22911
  });
22903
22912
  }
22913
+ // Typical Nextspace imagery.
22904
22914
  else {
22905
- provider = new CESIUM.TileMapServiceImageryProvider({
22906
- url: Tileset.GetPublicFileUrl({
22907
- api,
22908
- tilesetId: meta.tilesetId,
22909
- file: "",
22910
- viaCdn: true,
22911
- viaCdnCacheToken: tileset.generateVersion
22912
- }),
22913
- fileExtension: "png",
22914
- // Tested to not cause increased lag.
22915
- rectangle: boundaries,
22916
- maximumLevel: hasLevels ? maxLevel : undefined,
22917
- minimumLevel: hasLevels ? minLevel : undefined,
22918
- });
22915
+ if (TileMapServiceImageryProvider.hasOwnProperty("fromUrl")) {
22916
+ provider = await CESIUM.TileMapServiceImageryProvider.fromUrl(url, {
22917
+ fileExtension: "png",
22918
+ // Tested to not cause increased lag.
22919
+ rectangle: boundaries,
22920
+ maximumLevel: hasLevels ? maxLevel : undefined,
22921
+ minimumLevel: hasLevels ? minLevel : undefined,
22922
+ });
22923
+ }
22924
+ else {
22925
+ provider = new CESIUM.TileMapServiceImageryProvider({
22926
+ url: url,
22927
+ fileExtension: "png",
22928
+ // Tested to not cause increased lag.
22929
+ rectangle: boundaries,
22930
+ maximumLevel: hasLevels ? maxLevel : undefined,
22931
+ minimumLevel: hasLevels ? minLevel : undefined,
22932
+ });
22933
+ }
22919
22934
  }
22920
22935
  }
22921
22936
  else if (tileset.type === Tileset.EType.ExternalGeoMap) {
@@ -30090,7 +30105,7 @@ class WidgetViewBar extends Widget.AWidget {
30090
30105
  }
30091
30106
  }
30092
30107
 
30093
- const VERSION = "5.3.3";
30108
+ const VERSION = "5.3.5";
30094
30109
 
30095
30110
  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, 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 };
30096
30111
  //# sourceMappingURL=bruce-cesium.es5.js.map