mars3d-supermap 3.8.10 → 3.8.12

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.
Files changed (2) hide show
  1. package/mars3d-supermap.js +17 -5
  2. package/package.json +2 -2
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Mars3D平台插件,结合supermap超图库使用的功能插件 mars3d-supermap
3
3
  *
4
- * 版本信息:v3.8.10
5
- * 编译日期:2024-12-11 20:29
4
+ * 版本信息:v3.8.12
5
+ * 编译日期:2025-01-06 18:51
6
6
  * 版权所有:Copyright by 火星科技 http://mars3d.cn
7
- * 使用单位:免费公开版 ,2024-08-01
7
+ * 使用单位:火星科技免费公开版 ,2024-08-01
8
8
  */
9
9
  (function (global, factory) {
10
10
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, (window.mars3d || require('mars3d'))) :
@@ -140,6 +140,10 @@
140
140
  } else {
141
141
  this._layerArr = [smLayer];
142
142
  }
143
+ if (!this.isAdded) {
144
+ this._removedHook();
145
+ return;
146
+ }
143
147
  for (let i = 0; i < this._layerArr.length; i++) {
144
148
  const layer = this._layerArr[i];
145
149
  if (!layer) {
@@ -214,7 +218,9 @@
214
218
  * @private
215
219
  */
216
220
  _addedHook() {
217
- this._showHook(this.show);
221
+ this.eachLayer(layer => {
222
+ this._map.scene.layers.add(layer);
223
+ });
218
224
  }
219
225
 
220
226
  /**
@@ -224,7 +230,13 @@
224
230
  * @private
225
231
  */
226
232
  _removedHook() {
227
- this._showHook(false);
233
+ try {
234
+ this.eachLayer(layer => {
235
+ this._map.scene.layers.remove(layer.name, true);
236
+ });
237
+ } catch (e) {
238
+ mars3d__namespace.Log.logWarn(`s3m移除中空值异常(插件本身问题,需改超图插件)`, e);
239
+ }
228
240
  }
229
241
 
230
242
  /**
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "mars3d-supermap",
3
- "version": "3.8.10",
3
+ "version": "3.8.12",
4
4
  "description": "Mars3D平台插件,结合supermap超图库使用的功能插件",
5
5
  "main": "./mars3d-supermap.js",
6
6
  "peerDependencies": {},
7
7
  "devDependencies": {
8
- "mars3d": "~3.8.10"
8
+ "mars3d": "~3.8.12"
9
9
  },
10
10
  "scripts": {
11
11
  "lint": "eslint ./src/**/*.{js,ts} --fix"