bruce-cesium 0.7.1 → 0.7.2

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,5 +1,5 @@
1
1
  import { BruceEvent, Cartes, Carto, Geometry, ZoomControl, Style, EntityTag, Calculator, EntityLod, EntityType, ClientFile, DelayQueue, Entity as Entity$1, BatchedDataGetter, ObjectUtils, Tileset, EntityCoords, EntityFilterGetter, EntitySource, MenuItem, ProjectView, ProjectViewBookmark, ProjectViewTile, ProjectViewLegacyTile, TilesetExtMapTiles, ProgramKey, Camera } from 'bruce-models';
2
- import { Cartesian2, Cartographic, Math as Math$1, Cartesian3, Entity, Primitive, Cesium3DTileFeature, Color, EllipsoidGeodesic, createWorldTerrain, EllipsoidTerrainProvider, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, ColorMaterialProperty, Rectangle, Matrix3, Matrix4, EasingFunction, GeometryInstance, JulianDate, HeightReference, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Cesium3DTileset, HeadingPitchRange, OrthographicFrustum, createOsmBuildings, Cesium3DTileStyle, KmlDataSource } from 'cesium';
2
+ import { Cartesian2, Cartographic, Math as Math$1, Color, HeightReference, Cartesian3, Entity, HorizontalOrigin, VerticalOrigin, ClassificationType, ArcType, PolygonHierarchy, ShadowMode, PolylineGraphics, HeadingPitchRoll, Transforms, ColorBlendMode, Primitive, Cesium3DTileFeature, HeadingPitchRange, OrthographicFrustum, JulianDate, createWorldTerrain, EllipsoidTerrainProvider, CesiumTerrainProvider, BingMapsImageryProvider, BingMapsStyle, MapboxImageryProvider, MapboxStyleImageryProvider, ArcGisMapServerImageryProvider, OpenStreetMapImageryProvider, GridImageryProvider, GeographicTilingScheme, ImageryLayer, UrlTemplateImageryProvider, TileMapServiceImageryProvider, IonImageryProvider, Matrix4, Cesium3DTileset, EllipsoidGeodesic, ColorMaterialProperty, Rectangle, Matrix3, EasingFunction, GeometryInstance, createOsmBuildings, Cesium3DTileStyle, KmlDataSource } from 'cesium';
3
3
 
4
4
  var TIME_LAG = 300;
5
5
  var POSITION_CHECK_TIMER = 950;
@@ -1100,9 +1100,22 @@ var EntityRenderEngine;
1100
1100
  var entity = params.entity;
1101
1101
  var style = params.style;
1102
1102
  var type = style.Type;
1103
+ if (type == null) {
1104
+ // Very old backward compatibility.
1105
+ if (style.useIcon == true) {
1106
+ type = Style.EPointType.Icon;
1107
+ }
1108
+ }
1103
1109
  var cEntity = null;
1104
1110
  if (type == Style.EPointType.Icon) {
1105
- var icon = Calculator.GetValue(style.iconUrl, entity, params.tags);
1111
+ // Fixing poor data.
1112
+ var iconUrlRows = style.iconUrl == null ? [] : style.iconUrl;
1113
+ iconUrlRows.forEach(function (row) {
1114
+ if (row.type == Calculator.EValueType.Color) {
1115
+ row.type = Calculator.EValueType.Input;
1116
+ }
1117
+ });
1118
+ var icon = Calculator.GetValue(iconUrlRows, entity, params.tags);
1106
1119
  var iconUrl = null;
1107
1120
  if (typeof icon == "string") {
1108
1121
  iconUrl = icon;
@@ -1938,9 +1951,11 @@ function removeEntity(viewer, visual) {
1938
1951
  }
1939
1952
  }
1940
1953
  else if (visual instanceof Cesium3DTileFeature) {
1941
- // No way to tell if changing show will crash it!
1942
1954
  try {
1943
- visual.show = false;
1955
+ var tileset = visual === null || visual === void 0 ? void 0 : visual.tileset;
1956
+ if (tileset && viewer.scene.primitives.contains(tileset)) {
1957
+ visual.show = false;
1958
+ }
1944
1959
  }
1945
1960
  catch (e) {
1946
1961
  console.error(e);