xy-cesium3 0.0.167 → 0.0.168

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xy-cesium3",
3
- "version": "0.0.167",
3
+ "version": "0.0.168",
4
4
  "description": "雄越cesium3",
5
5
  "main": "xy-cesium3.umd.js",
6
6
  "scripts": {
package/xy-cesium3.mjs CHANGED
@@ -14194,7 +14194,7 @@ const defaultOptions$d = {
14194
14194
  enableHeightCheck: false
14195
14195
  },
14196
14196
  style: {
14197
- font: "12px Microsoft YaHei",
14197
+ font: "11px Microsoft YaHei",
14198
14198
  fillColor: "#FFFFFF",
14199
14199
  outlineColor: "#000000",
14200
14200
  outlineWidth: 2,
@@ -19681,7 +19681,7 @@ const addArrowLine = (viewer2, option) => {
19681
19681
  minRepeat,
19682
19682
  maxRepeat
19683
19683
  }) => {
19684
- if (!primitive.show || primitive.isDestroyed())
19684
+ if (primitive.isDestroyed())
19685
19685
  return;
19686
19686
  const newRepeat = Math.max(minRepeat, Math.min(
19687
19687
  Math.round(lineLength / dynamicDistance),
@@ -19699,8 +19699,23 @@ const addArrowLine = (viewer2, option) => {
19699
19699
  viewer2.camera.percentageChanged = 0.01;
19700
19700
  viewer2.camera.changed.addEventListener(updateEvent);
19701
19701
  primitiveCollection._updateEvent = updateEvent;
19702
+ let lastShow = primitiveCollection.show;
19703
+ const onPreRender = () => {
19704
+ if (primitiveCollection.isDestroyed()) {
19705
+ viewer2.scene.preRender.removeEventListener(onPreRender);
19706
+ return;
19707
+ }
19708
+ const currentShow = primitiveCollection.show;
19709
+ if (currentShow && !lastShow) {
19710
+ lastViewDistance = 0;
19711
+ updateEvent();
19712
+ }
19713
+ lastShow = currentShow;
19714
+ };
19715
+ viewer2.scene.preRender.addEventListener(onPreRender);
19702
19716
  primitiveCollection.destroy = function() {
19703
19717
  removeListeners2();
19718
+ viewer2.scene.preRender.removeEventListener(onPreRender);
19704
19719
  if (!this.isDestroyed()) {
19705
19720
  Cesium.PrimitiveCollection.prototype.destroy.call(this);
19706
19721
  }