bruce-cesium 2.7.6 → 2.7.7

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.
@@ -2644,6 +2644,10 @@
2644
2644
  if (width < 0.01) {
2645
2645
  width = 0;
2646
2646
  }
2647
+ var units = style.lineWidthUnits;
2648
+ if (units != "px" && units != "m") {
2649
+ units = "m";
2650
+ }
2647
2651
  // If both outline and fill is not available then don't render anything.
2648
2652
  if ((width <= 0 || cLineColor.alpha <= 0) &&
2649
2653
  cFillColor.alpha <= 0) {
@@ -2683,7 +2687,7 @@
2683
2687
  classificationType: classification,
2684
2688
  perPositionHeight: heightRef == Cesium.HeightReference.CLAMP_TO_GROUND ? false : true,
2685
2689
  zIndex: zIndex,
2686
- distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance, size, true)
2690
+ distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance, width <= 0 || !cLineColor || units == "m" ? size : null, true)
2687
2691
  },
2688
2692
  position: exports.EntityUtils.GetPos({
2689
2693
  viewer: params.viewer,
@@ -2719,17 +2723,17 @@
2719
2723
  borderPosses = posses.map(function (x) { return x.clone ? x.clone() : __assign({}, x); });
2720
2724
  }
2721
2725
  var cEntityBorder = new Cesium.Entity({
2722
- // polyline: new Cesium.PolylineGraphics({
2723
- // positions: borderPosses,
2724
- // material: <Cesium.MaterialProperty><any>cLineColor,
2725
- // width: width,
2726
- // clampToGround: heightRef == Cesium.HeightReference.CLAMP_TO_GROUND,
2727
- // classificationType: Cesium.ClassificationType.TERRAIN,
2728
- // arcType: Cesium.ArcType.GEODESIC,
2729
- // zIndex: zIndex,
2730
- // distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance)
2731
- // }),
2732
- corridor: {
2726
+ polyline: units == "px" ? new Cesium.PolylineGraphics({
2727
+ positions: borderPosses,
2728
+ material: cLineColor,
2729
+ width: width,
2730
+ clampToGround: heightRef == Cesium.HeightReference.CLAMP_TO_GROUND,
2731
+ classificationType: Cesium.ClassificationType.TERRAIN,
2732
+ arcType: Cesium.ArcType.GEODESIC,
2733
+ zIndex: zIndex,
2734
+ distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance)
2735
+ }) : null,
2736
+ corridor: units == "m" ? {
2733
2737
  positions: borderPosses,
2734
2738
  material: cLineColor,
2735
2739
  heightReference: heightRef,
@@ -2741,7 +2745,7 @@
2741
2745
  classificationType: classification,
2742
2746
  distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance, width),
2743
2747
  shadows: Cesium.ShadowMode.ENABLED
2744
- },
2748
+ } : null,
2745
2749
  show: true
2746
2750
  });
2747
2751
  cEntityBorder._parentEntity = cEntity;
@@ -2750,17 +2754,17 @@
2750
2754
  var posses_1 = holePosses[i];
2751
2755
  bruceModels.Cartes.CloseRing3(posses_1);
2752
2756
  var cEntityHole = new Cesium.Entity({
2753
- // polyline: new Cesium.PolylineGraphics({
2754
- // positions: posses,
2755
- // material: <Cesium.MaterialProperty><any>cLineColor,
2756
- // width: width,
2757
- // clampToGround: heightRef == Cesium.HeightReference.CLAMP_TO_GROUND,
2758
- // classificationType: Cesium.ClassificationType.TERRAIN,
2759
- // arcType: Cesium.ArcType.GEODESIC,
2760
- // zIndex: zIndex,
2761
- // distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance)
2762
- // }),
2763
- corridor: {
2757
+ polyline: units == "px" ? new Cesium.PolylineGraphics({
2758
+ positions: posses_1,
2759
+ material: cLineColor,
2760
+ width: width,
2761
+ clampToGround: heightRef == Cesium.HeightReference.CLAMP_TO_GROUND,
2762
+ classificationType: Cesium.ClassificationType.TERRAIN,
2763
+ arcType: Cesium.ArcType.GEODESIC,
2764
+ zIndex: zIndex,
2765
+ distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance)
2766
+ }) : null,
2767
+ corridor: units == "m" ? {
2764
2768
  positions: borderPosses,
2765
2769
  material: cLineColor,
2766
2770
  heightReference: heightRef,
@@ -2772,7 +2776,7 @@
2772
2776
  classificationType: classification,
2773
2777
  distanceDisplayCondition: getDisplayCondition(params.minDistance, params.maxDistance, width),
2774
2778
  shadows: Cesium.ShadowMode.ENABLED,
2775
- },
2779
+ } : null,
2776
2780
  show: true
2777
2781
  });
2778
2782
  cEntity._siblingGraphics.push(cEntityHole);
@@ -15235,7 +15239,7 @@
15235
15239
  ViewerUtils.CreateWidgets = CreateWidgets;
15236
15240
  })(exports.ViewerUtils || (exports.ViewerUtils = {}));
15237
15241
 
15238
- var VERSION$1 = "2.7.6";
15242
+ var VERSION$1 = "2.7.7";
15239
15243
 
15240
15244
  exports.VERSION = VERSION$1;
15241
15245
  exports.CesiumViewMonitor = CesiumViewMonitor;