@kq_npm/client3d_webgl_vue 0.0.1-beta

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 (103) hide show
  1. package/adddata/index.js +1503 -0
  2. package/adddata/style/adddata.css +1 -0
  3. package/adddata/style/css.js +3 -0
  4. package/adddata/style/index.js +3 -0
  5. package/baseterraingallery/index.js +394 -0
  6. package/baseterraingallery/style/baseterraingallery.css +1 -0
  7. package/baseterraingallery/style/css.js +3 -0
  8. package/baseterraingallery/style/index.js +3 -0
  9. package/boxclip/index.js +1076 -0
  10. package/boxclip/style/boxclip.css +1 -0
  11. package/boxclip/style/css.js +3 -0
  12. package/boxclip/style/index.js +3 -0
  13. package/comparemap/index.js +466 -0
  14. package/comparemap/style/comparemap.css +1 -0
  15. package/comparemap/style/css.js +3 -0
  16. package/comparemap/style/index.js +3 -0
  17. package/css.js +3 -0
  18. package/excavatefillanalysis/index.js +599 -0
  19. package/excavatefillanalysis/style/css.js +3 -0
  20. package/excavatefillanalysis/style/excavatefillanalysis.css +1 -0
  21. package/excavatefillanalysis/style/index.js +3 -0
  22. package/flight/index.js +963 -0
  23. package/flight/style/css.js +3 -0
  24. package/flight/style/flight.css +1 -0
  25. package/flight/style/index.js +3 -0
  26. package/floodanalysis/index.js +824 -0
  27. package/floodanalysis/style/css.js +3 -0
  28. package/floodanalysis/style/floodanalysis.css +1 -0
  29. package/floodanalysis/style/index.js +3 -0
  30. package/gpuspatialquery/index.js +906 -0
  31. package/gpuspatialquery/style/css.js +3 -0
  32. package/gpuspatialquery/style/gpuspatialquery.css +1 -0
  33. package/gpuspatialquery/style/index.js +3 -0
  34. package/hawkeye/index.js +239 -0
  35. package/index.js +19807 -0
  36. package/isolineanalysis/index.js +2476 -0
  37. package/isolineanalysis/style/css.js +3 -0
  38. package/isolineanalysis/style/index.js +3 -0
  39. package/isolineanalysis/style/isolineanalysis.css +1 -0
  40. package/measure/index.js +560 -0
  41. package/measure/style/css.js +3 -0
  42. package/measure/style/index.js +3 -0
  43. package/measure/style/measure.css +1 -0
  44. package/modelselect/index.js +375 -0
  45. package/modelselect/style/css.js +3 -0
  46. package/modelselect/style/index.js +3 -0
  47. package/modelselect/style/modelselect.css +1 -0
  48. package/package.json +1 -0
  49. package/particleeffect/index.js +1079 -0
  50. package/particleeffect/style/css.js +3 -0
  51. package/particleeffect/style/index.js +3 -0
  52. package/particleeffect/style/particleeffect.css +1 -0
  53. package/planeclip/index.js +738 -0
  54. package/planeclip/style/css.js +3 -0
  55. package/planeclip/style/index.js +3 -0
  56. package/planeclip/style/planeclip.css +1 -0
  57. package/profileanalysis/index.js +781 -0
  58. package/profileanalysis/style/css.js +3 -0
  59. package/profileanalysis/style/index.js +3 -0
  60. package/profileanalysis/style/profileanalysis.css +1 -0
  61. package/roller/index.js +537 -0
  62. package/roller/style/css.js +3 -0
  63. package/roller/style/index.js +3 -0
  64. package/roller/style/roller.css +1 -0
  65. package/scenceview/index.js +1775 -0
  66. package/scenceview/style/css.js +3 -0
  67. package/scenceview/style/index.js +3 -0
  68. package/scenceview/style/scenceview.css +1 -0
  69. package/screenshot/index.js +551 -0
  70. package/screenshot/style/css.js +3 -0
  71. package/screenshot/style/index.js +3 -0
  72. package/screenshot/style/screenshot.css +1 -0
  73. package/shadowanalysis/index.js +1042 -0
  74. package/shadowanalysis/style/css.js +3 -0
  75. package/shadowanalysis/style/index.js +3 -0
  76. package/shadowanalysis/style/shadowanalysis.css +1 -0
  77. package/sightlineanalysis/index.js +1100 -0
  78. package/sightlineanalysis/style/css.js +3 -0
  79. package/sightlineanalysis/style/divpoint.css +1 -0
  80. package/sightlineanalysis/style/index.js +3 -0
  81. package/sightlineanalysis/style/sightlineanalysis.css +1 -0
  82. package/skylineanalysis/index.js +771 -0
  83. package/skylineanalysis/style/css.js +3 -0
  84. package/skylineanalysis/style/index.js +3 -0
  85. package/skylineanalysis/style/skylineanalysis.css +1 -0
  86. package/slopeanalysis/index.js +1028 -0
  87. package/slopeanalysis/style/css.js +3 -0
  88. package/slopeanalysis/style/index.js +3 -0
  89. package/slopeanalysis/style/slopeanalysis.css +1 -0
  90. package/style.css +1 -0
  91. package/style.js +3 -0
  92. package/terrainoperation/index.js +508 -0
  93. package/terrainoperation/style/css.js +3 -0
  94. package/terrainoperation/style/index.js +3 -0
  95. package/terrainoperation/style/terrainoperation.css +1 -0
  96. package/viewshedanalysis/index.js +582 -0
  97. package/viewshedanalysis/style/css.js +3 -0
  98. package/viewshedanalysis/style/index.js +3 -0
  99. package/viewshedanalysis/style/viewshedanalysis.css +1 -0
  100. package/weathereffect/index.js +835 -0
  101. package/weathereffect/style/css.js +3 -0
  102. package/weathereffect/style/index.js +3 -0
  103. package/weathereffect/style/weathereffect.css +1 -0
@@ -0,0 +1,1775 @@
1
+ /******/ (function() { // webpackBootstrap
2
+ /******/ "use strict";
3
+ /******/ var __webpack_modules__ = ({
4
+
5
+ /***/ 159:
6
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7
+
8
+ __webpack_require__.r(__webpack_exports__);
9
+ /* harmony default export */ __webpack_exports__["default"] = ("data:image/png;base64,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");
10
+
11
+ /***/ })
12
+
13
+ /******/ });
14
+ /************************************************************************/
15
+ /******/ // The module cache
16
+ /******/ var __webpack_module_cache__ = {};
17
+ /******/
18
+ /******/ // The require function
19
+ /******/ function __webpack_require__(moduleId) {
20
+ /******/ // Check if module is in cache
21
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
22
+ /******/ if (cachedModule !== undefined) {
23
+ /******/ return cachedModule.exports;
24
+ /******/ }
25
+ /******/ // Create a new module (and put it into the cache)
26
+ /******/ var module = __webpack_module_cache__[moduleId] = {
27
+ /******/ // no module.id needed
28
+ /******/ // no module.loaded needed
29
+ /******/ exports: {}
30
+ /******/ };
31
+ /******/
32
+ /******/ // Execute the module function
33
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
34
+ /******/
35
+ /******/ // Return the exports of the module
36
+ /******/ return module.exports;
37
+ /******/ }
38
+ /******/
39
+ /************************************************************************/
40
+ /******/ /* webpack/runtime/compat get default export */
41
+ /******/ !function() {
42
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
43
+ /******/ __webpack_require__.n = function(module) {
44
+ /******/ var getter = module && module.__esModule ?
45
+ /******/ function() { return module['default']; } :
46
+ /******/ function() { return module; };
47
+ /******/ __webpack_require__.d(getter, { a: getter });
48
+ /******/ return getter;
49
+ /******/ };
50
+ /******/ }();
51
+ /******/
52
+ /******/ /* webpack/runtime/define property getters */
53
+ /******/ !function() {
54
+ /******/ // define getter functions for harmony exports
55
+ /******/ __webpack_require__.d = function(exports, definition) {
56
+ /******/ for(var key in definition) {
57
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
58
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
59
+ /******/ }
60
+ /******/ }
61
+ /******/ };
62
+ /******/ }();
63
+ /******/
64
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
65
+ /******/ !function() {
66
+ /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
67
+ /******/ }();
68
+ /******/
69
+ /******/ /* webpack/runtime/make namespace object */
70
+ /******/ !function() {
71
+ /******/ // define __esModule on exports
72
+ /******/ __webpack_require__.r = function(exports) {
73
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
74
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
75
+ /******/ }
76
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
77
+ /******/ };
78
+ /******/ }();
79
+ /******/
80
+ /************************************************************************/
81
+ var __webpack_exports__ = {};
82
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
83
+ !function() {
84
+ // ESM COMPAT FLAG
85
+ __webpack_require__.r(__webpack_exports__);
86
+
87
+ // EXPORTS
88
+ __webpack_require__.d(__webpack_exports__, {
89
+ "ScenceViewViewModel": function() { return /* reexport */ ScenceViewViewModel; },
90
+ "default": function() { return /* reexport */ ScenceView; }
91
+ });
92
+
93
+ ;// CONCATENATED MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
94
+ var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject = require("vue");
95
+ ;// CONCATENATED MODULE: external "@zpc_npm/vue-iclient-icons"
96
+ var vue_iclient_icons_namespaceObject = require("@zpc_npm/vue-iclient-icons");
97
+ ;// CONCATENATED MODULE: external "@element-plus/icons-vue"
98
+ var icons_vue_namespaceObject = require("@element-plus/icons-vue");
99
+ ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
100
+ function _defineProperty(obj, key, value) {
101
+ if (key in obj) {
102
+ Object.defineProperty(obj, key, {
103
+ value: value,
104
+ enumerable: true,
105
+ configurable: true,
106
+ writable: true
107
+ });
108
+ } else {
109
+ obj[key] = value;
110
+ }
111
+
112
+ return obj;
113
+ }
114
+ ;// CONCATENATED MODULE: external "@zpc_npm/vue-iclient-common/_utils/mitt"
115
+ var mitt_namespaceObject = require("@zpc_npm/vue-iclient-common/_utils/mitt");
116
+ var mitt_default = /*#__PURE__*/__webpack_require__.n(mitt_namespaceObject);
117
+ ;// CONCATENATED MODULE: external "core-js/modules/es.array.includes.js"
118
+ var es_array_includes_js_namespaceObject = require("core-js/modules/es.array.includes.js");
119
+ ;// CONCATENATED MODULE: external "@turf/turf"
120
+ var turf_namespaceObject = require("@turf/turf");
121
+ ;// CONCATENATED MODULE: ./src/webgl/scenceview/DrawManager.js
122
+
123
+
124
+ //绘制操作类
125
+
126
+ class DrawManager {
127
+ //图层分组
128
+ // 默认绘制样式提供给绘图组件绑定
129
+ // 默认绘制样式
130
+ constructor(viewer) {
131
+ _defineProperty(this, "_viewer", null);
132
+
133
+ _defineProperty(this, "_drawHandler", null);
134
+
135
+ _defineProperty(this, "_drawLayer", null);
136
+
137
+ _defineProperty(this, "_layerGroup", []);
138
+
139
+ _defineProperty(this, "_defaultStyle", {
140
+ color: "#ff0000",
141
+ fillColor: "#1E90FF",
142
+ weight: 2,
143
+ fillOpacity: 0.3,
144
+ dashArray: "0"
145
+ });
146
+
147
+ _defineProperty(this, "drawFinishedEvent", null);
148
+
149
+ _defineProperty(this, "editSelectedEvent", null);
150
+
151
+ _defineProperty(this, "_drawStyle", {
152
+ //文本样式
153
+ text: {
154
+ text: "文字标注",
155
+ //文字内容
156
+ fontSize: 30,
157
+ //文字大小
158
+ color: "#ff0000",
159
+ //文字颜色
160
+ opacity: 0.5,
161
+ //文字颜色透明度
162
+ clampToGround: false //是否贴地
163
+
164
+ },
165
+ //点-图标样式
166
+ marker: {
167
+ image: __webpack_require__(159),
168
+ //图标路径
169
+ width: 32,
170
+ //图标宽度
171
+ height: 32,
172
+ //图标高度
173
+ clampToGround: false //是否贴地
174
+
175
+ },
176
+ //折线样式
177
+ polyline: {
178
+ width: 2,
179
+ //线宽
180
+ color: "#ff0000",
181
+ //线颜色
182
+ opacity: 0.5,
183
+ //线颜色透明度
184
+ arcType: 1,
185
+ clampToGround: true //是否贴地
186
+
187
+ },
188
+ //多边形样式
189
+ polygon: {
190
+ fill: true,
191
+ //是否填充颜色
192
+ fillColor: "#1E90FF",
193
+ //填充颜色
194
+ fillOpacity: 0.3,
195
+ //填充颜色透明度
196
+ width: 2,
197
+ //边框宽度
198
+ color: "#ff0000",
199
+ //边框颜色
200
+ opacity: 0.5,
201
+ //边框颜色透明度
202
+ clampToGround: true //是否贴地
203
+
204
+ }
205
+ });
206
+
207
+ _defineProperty(this, "_geojsonStyle", {
208
+ label: {
209
+ style: Cesium.LabelStyle.FILL_AND_OUTLINE,
210
+ outlineWidth: 2,
211
+ fillColor: "#ff0000",
212
+ opacity: 1,
213
+ pixelOffset: [0, -16],
214
+ express: "name",
215
+ font: "25px 微软雅黑"
216
+ },
217
+ billboard: {
218
+ image: __webpack_require__(159),
219
+ width: 32,
220
+ height: 32
221
+ },
222
+ polyline: {
223
+ color: "#ff0000",
224
+ opacity: 1.0,
225
+ width: 2
226
+ },
227
+ polygon: {
228
+ color: "#0000ff",
229
+ opacity: 0.3,
230
+ outline: true,
231
+ outlineColor: "#ff0000",
232
+ perPositionHeight: true
233
+ }
234
+ });
235
+
236
+ this._viewer = viewer;
237
+ this._drawHandler = Cesium.Kq3dPlotHandler; // 创建绘制图形图层
238
+
239
+ this._drawLayer = this._drawHandler.createShapeLayer({
240
+ name: "Drawing"
241
+ }); // 添加绘制图形图层到场景
242
+
243
+ this._viewer.scene.primitives.add(this._drawLayer); // 初始化绘制函数集对象
244
+
245
+
246
+ this._drawHandler.initialize(this._viewer.scene, this._drawLayer); // 默认禁用编辑操作
247
+
248
+
249
+ this.enableEdit(false); // 绘制结束事件
250
+
251
+ this.drawFinishedEvent = this._drawHandler.drawHandler.drawFinished; // 编辑拾取事件
252
+
253
+ this.editSelectedEvent = this._drawHandler.editHandler.editSelected; // 关闭双击旋转交互
254
+
255
+ if (this._viewer.roadingHandler) {
256
+ this._viewer.roadingHandler.cameraRotatePointer.enableMouseAutoStart = false;
257
+ } //复制样式
258
+
259
+
260
+ this._drawStyle.freehandline = this._drawStyle.polyline; //手绘线
261
+
262
+ this._drawStyle.concentricCircle = this._drawStyle.polyline; //同心圆
263
+
264
+ this._drawStyle.circle = this._drawStyle.polygon; //圆
265
+
266
+ this._drawStyle.ellipse = this._drawStyle.polygon; //椭圆
267
+
268
+ this._drawStyle.freehandpolygon = this._drawStyle.polygon; //手绘面
269
+
270
+ this._drawStyle.rectangle = this._drawStyle.polygon; //矩形
271
+ } //开始绘制
272
+
273
+
274
+ startDraw(type, options, callback) {
275
+ this._viewer.scene.globe.depthTestAgainstTerrain = true;
276
+
277
+ if (type === "point") {
278
+ type = "marker";
279
+ this._viewer.scene.globe.depthTestAgainstTerrain = false;
280
+ }
281
+
282
+ if (!options) options = {};
283
+ var unionOptions = JSON.parse(JSON.stringify(this._drawStyle[type]));
284
+
285
+ for (var key in options) {
286
+ unionOptions[key] = options[key];
287
+ }
288
+
289
+ if (unionOptions.hasOwnProperty("color")) {
290
+ unionOptions.color = Cesium.Color.fromCssColorString(unionOptions.color).withAlpha(unionOptions.opacity);
291
+ }
292
+
293
+ if (unionOptions.hasOwnProperty("fillColor")) {
294
+ unionOptions.fillColor = Cesium.Color.fromCssColorString(unionOptions.fillColor).withAlpha(unionOptions.fillOpacity);
295
+ }
296
+
297
+ this._drawHandler.startDraw(type, type, unionOptions);
298
+
299
+ if (callback) {
300
+ var that = this;
301
+ var removeEventListener = this.drawFinishedEvent.addEventListener(shape => {
302
+ var feature = that.shapeToGeoFeature(shape);
303
+ callback(feature.geometry);
304
+ removeEventListener();
305
+ });
306
+ }
307
+ }
308
+
309
+ stopDraw() {
310
+ this._drawHandler.stopDraw();
311
+ } //是否启用连续绘制
312
+
313
+
314
+ enableMultiDraw(isEnable) {
315
+ this._drawHandler.drawHandler.enableMultiDraw = isEnable;
316
+ } //是否启用编辑
317
+
318
+
319
+ enableEdit(isEnable) {
320
+ if (isEnable) {
321
+ this._drawHandler.editHandler.activate();
322
+ } else {
323
+ this._drawHandler.editHandler.deactivate();
324
+ }
325
+ } //清除全部手动绘图
326
+
327
+
328
+ clear() {
329
+ this._drawLayer && this._drawLayer.removeAll();
330
+ } //销毁
331
+
332
+
333
+ destroy() {
334
+ this._viewer = null;
335
+ this._drawHandler = null;
336
+ this.clear();
337
+ } //笛卡尔坐标转经纬度
338
+
339
+
340
+ transformPosition(position) {
341
+ // 转坐标
342
+ if (position) {
343
+ let ellipsoid = this._viewer.scene.globe.ellipsoid;
344
+ let cartographic = ellipsoid.cartesianToCartographic(position);
345
+ let lon = Cesium.Math.toDegrees(cartographic.longitude);
346
+ let lat = Cesium.Math.toDegrees(cartographic.latitude);
347
+ let lonLat = [lon, lat];
348
+ return lonLat;
349
+ }
350
+ } //绘制返回结果转换为GeoFeature
351
+
352
+
353
+ shapeToGeoFeature(shape) {
354
+ var geoFeature = null;
355
+ var that = this;
356
+
357
+ if (shape) {
358
+ if (shape.type === that._drawHandler.ShapeTypes.MARKER.type) {
359
+ let position = that.transformPosition(shape._position);
360
+ geoFeature = turf_namespaceObject.point(position);
361
+ } else if (shape.type === that._drawHandler.ShapeTypes.CIRCLE.type) {
362
+ let center = that.transformPosition(shape.center);
363
+ geoFeature = turf_namespaceObject.circle(center, shape.radius, {
364
+ steps: 64,
365
+ units: "meters"
366
+ });
367
+ } else if (shape.type === that._drawHandler.ShapeTypes.POLYLINE.type) {
368
+ let position = [[]];
369
+ shape.controlPoints.forEach(function (val) {
370
+ position[0].push(that.transformPosition(val));
371
+ });
372
+ geoFeature = turf_namespaceObject.lineStrings(position).features[0];
373
+ } else if (shape.type === that._drawHandler.ShapeTypes.RECTANGLE.type) {
374
+ let minX = shape.rectangle.west / Math.PI * 180;
375
+ let maxX = shape.rectangle.east / Math.PI * 180;
376
+ let minY = shape.rectangle.south / Math.PI * 180;
377
+ let maxY = shape.rectangle.north / Math.PI * 180;
378
+ let positions1 = [[[minX, minY], [minX, maxY], [maxX, maxY], [maxX, minY], [minX, minY]]];
379
+ geoFeature = turf_namespaceObject.polygon(positions1);
380
+ } else if (shape.type === that._drawHandler.ShapeTypes.POLYGON.type) {
381
+ let positions = [[]];
382
+ let posi;
383
+ shape.controlPoints.forEach(function (val, dex) {
384
+ // 存坐标
385
+ positions[0].push(that.transformPosition(val)); // 闭合坐标
386
+
387
+ if (dex === 0) {
388
+ posi = that.transformPosition(val);
389
+ }
390
+
391
+ if (dex === shape.controlPoints.length - 1) {
392
+ positions[0].push(posi);
393
+ }
394
+ });
395
+ geoFeature = turf_namespaceObject.polygon(positions);
396
+ }
397
+ }
398
+
399
+ return geoFeature || shape;
400
+ } //通过geojson进行绘制,支持定位
401
+
402
+
403
+ drawFromGeojson(geojsonData, idCustom = "result", callFun, geojsonStyle, isLocation) {
404
+ if (!geojsonStyle) geojsonStyle = {};
405
+ let style = JSON.parse(JSON.stringify(this._geojsonStyle));
406
+
407
+ for (var type in geojsonStyle) {
408
+ if (style.hasOwnProperty(type)) {
409
+ for (var key in geojsonStyle[type]) {
410
+ style[type][key] = geojsonStyle[type][key];
411
+ }
412
+ } else {
413
+ style[type] = geojsonStyle[type];
414
+ }
415
+ }
416
+
417
+ for (var type in style) {
418
+ if (style[type].hasOwnProperty("color")) {
419
+ style[type].material = Cesium.Color.fromCssColorString(style[type].color).withAlpha(style[type].opacity);
420
+ }
421
+
422
+ if (style[type].hasOwnProperty("fillColor")) {
423
+ style[type].fillColor = Cesium.Color.fromCssColorString(style[type].fillColor).withAlpha(style[type].opacity);
424
+ }
425
+
426
+ if (style[type].hasOwnProperty("outlineColor")) {
427
+ style[type].outlineColor = Cesium.Color.fromCssColorString(style[type].outlineColor);
428
+ }
429
+
430
+ if (style[type].hasOwnProperty("pixelOffset")) {
431
+ style[type].pixelOffset = new Cesium.Cartesian2(style[type].pixelOffset[0], style[type].pixelOffset[1]);
432
+ }
433
+ }
434
+
435
+ this._viewer.scene.globe.depthTestAgainstTerrain = false;
436
+ let geojsonDs = new Cesium.Kq3dGeoJsonDataSource(idCustom);
437
+ let that = this;
438
+ geojsonDs.load(geojsonData, style).then(ds => {
439
+ that._viewer.dataSources.add(ds);
440
+
441
+ if (!that._layerGroup.includes(idCustom)) {
442
+ that._layerGroup.push(idCustom);
443
+ }
444
+
445
+ if (isLocation) {
446
+ that._viewer.flyTo(ds, {
447
+ duration: 1.5
448
+ });
449
+ }
450
+
451
+ callFun && callFun();
452
+ });
453
+ } //删除指定绘图分组的所有图形
454
+
455
+
456
+ removeGeojsonByIdCustom(idCustom) {
457
+ let dsList = this._viewer.dataSources.getByName(idCustom);
458
+
459
+ for (let i = 0; i < dsList.length; i++) {
460
+ this._viewer.dataSources.remove(dsList[i], true);
461
+ }
462
+
463
+ let index = this._layerGroup.indexOf(idCustom);
464
+
465
+ if (index > -1) {
466
+ this._layerGroup.splice(index, 1);
467
+ }
468
+ } //删除所有geojson绘图
469
+
470
+
471
+ removeAll() {
472
+ let that = this;
473
+
474
+ this._layerGroup.forEach(group => {
475
+ let dsList = that._viewer.dataSources.getByName(group);
476
+
477
+ for (let i = 0; i < dsList.length; i++) {
478
+ that._viewer.dataSources.remove(dsList[i], true);
479
+ }
480
+ });
481
+
482
+ this._layerGroup = [];
483
+ } //清除所有,包含手动绘图和geojson绘图
484
+
485
+
486
+ clearAll() {
487
+ this.clear();
488
+ this.removeAll();
489
+ }
490
+
491
+ }
492
+ ;// CONCATENATED MODULE: external "@zpc_npm/vue-iclient-common/_utils/webmapservice"
493
+ var webmapservice_namespaceObject = require("@zpc_npm/vue-iclient-common/_utils/webmapservice");
494
+ var webmapservice_default = /*#__PURE__*/__webpack_require__.n(webmapservice_namespaceObject);
495
+ ;// CONCATENATED MODULE: external "@zpc_npm/vue-iclient-common/_utils/util"
496
+ var util_namespaceObject = require("@zpc_npm/vue-iclient-common/_utils/util");
497
+ ;// CONCATENATED MODULE: ./src/webgl/scenceview/LayerManager.js
498
+
499
+
500
+ //图层管理类
501
+
502
+ class LayerManager {
503
+ //图层树数据
504
+ //图层列表数据(不包含文件夹节点,不包含融合子图层),特殊图层数据(BaseLayer、OnLineLayer)除外
505
+ //图层原数据列表(包含文件夹节点,融合子图层)
506
+ //影像图层guid集合
507
+ //置顶图层guid
508
+ //地形集合
509
+ constructor(scenceView) {
510
+ _defineProperty(this, "_scenceView", null);
511
+
512
+ _defineProperty(this, "_viewer", null);
513
+
514
+ _defineProperty(this, "_layerTreeData", []);
515
+
516
+ _defineProperty(this, "_layerListData", []);
517
+
518
+ _defineProperty(this, "_layerListData_old", []);
519
+
520
+ _defineProperty(this, "_imageryLayerGuids", []);
521
+
522
+ _defineProperty(this, "_frontLayerGuid", null);
523
+
524
+ _defineProperty(this, "_emptyTerrainProvider", new Cesium.EllipsoidTerrainProvider({}));
525
+
526
+ _defineProperty(this, "_terrainProviders", []);
527
+
528
+ this._scenceView = scenceView;
529
+ this._viewer = scenceView._viewer;
530
+ } //添加服务数据
531
+
532
+
533
+ addServiceData(service) {
534
+ if (service && service.name && service.url && service.type) {
535
+ var that = this;
536
+
537
+ if (service.type === "kqmapserver") {
538
+ //KQGIS地图服务
539
+ service.serviceUrl = service.url;
540
+ let webMapService = new (webmapservice_default())(service.name, service);
541
+ let serviceUrl = webMapService.handleServerUrl(service.url);
542
+ webMapService.getMapInfo().then(mapInfo => {
543
+ mapInfo = mapInfo.result || mapInfo; // 存储地图的名称以及描述等信息,返回给用户
544
+
545
+ let mapServerInfo = (0,util_namespaceObject.formatKQMapInfo)(mapInfo, serviceUrl, service.name, service.token, service.defaultShowLayerNames, service.isShowAllLayers === undefined ? true : service.isShowAllLayers);
546
+ mapServerInfo.layerTreeData.forEach(node => {
547
+ that._layerTreeData.push(node);
548
+ });
549
+ mapServerInfo.layers_old.forEach(layer => {
550
+ that._layerListData_old.push(layer);
551
+ });
552
+ let showLayers = [];
553
+ showLayers = showLayers.concat(mapServerInfo.layers_show);
554
+ showLayers.reverse();
555
+ that._layerListData = that._layerListData.concat(showLayers); // console.log(that._layerTreeData);
556
+ // console.log(that._layerListData);
557
+
558
+ that.addMapServerLayers(showLayers, mapInfo.rect84);
559
+ }, error => {
560
+ throw error;
561
+ }).catch(error => {
562
+ console.error(error);
563
+ });
564
+ } else if (service.type === "kq3dserver") {//KQGIS三维服务
565
+ } else if (service.type === "3dtiles") {
566
+ //3dtiles
567
+ that.add3DTilesData(service.name, service.url);
568
+ }
569
+ }
570
+ } //添加KQGIS服务图层
571
+
572
+
573
+ addMapServerLayers(layers, rect) {
574
+ var that = this;
575
+ layers.forEach(layer => {
576
+ //不显示的图层不加载
577
+ if (layer.visible) {
578
+ var imageryProvider = new Cesium.Kq3dKQGISMapServerImageryProviderExt({
579
+ url: layer.url,
580
+ ua_token: layer.accessToken,
581
+ layers: layer.id + ""
582
+ });
583
+ var imageryLayer = new Cesium.ImageryLayer(imageryProvider);
584
+ imageryLayer.name = layer.guid;
585
+
586
+ that._viewer.imageryLayers.add(imageryLayer);
587
+ }
588
+
589
+ that._imageryLayerGuids.push(layer.guid);
590
+ });
591
+
592
+ if (rect) {
593
+ that._viewer.camera.flyTo({
594
+ destination: Cesium.Rectangle.fromDegrees(rect.minx, rect.miny, rect.maxx, rect.maxy)
595
+ });
596
+ }
597
+
598
+ that._scenceView.fire("resetLayerDatas");
599
+ } //添加3dtiles数据
600
+
601
+
602
+ add3DTilesData(name, url) {
603
+ let that = this;
604
+
605
+ let tileset = that._viewer.scene.primitives.add(new Cesium.Cesium3DTileset({
606
+ name: name,
607
+ url: url
608
+ }));
609
+
610
+ tileset.readyPromise.then(function (tileset) {
611
+ that._viewer.zoomTo(tileset); //that._viewer.zoomTo(tileset, new Cesium.HeadingPitchRange(0.5, -0.6, tileset.boundingSphere.radius));
612
+
613
+ });
614
+
615
+ this._layerTreeData.push({
616
+ guid: tileset.guid,
617
+ name: name,
618
+ visible: true,
619
+ serverType: "3dtiles",
620
+ shapeType: "model"
621
+ });
622
+
623
+ this._layerListData.push({
624
+ guid: tileset.guid,
625
+ name: name,
626
+ visible: true,
627
+ serverType: "3dtiles"
628
+ });
629
+ }
630
+ /**
631
+ * 设置多个图层的显示与隐藏 且控制树的勾选
632
+ * @param ids 图层的GUID数组
633
+ * @param visible true, false
634
+ * @param eventTarget 触发方法的对象。该方法有执行其他监听事件,为防止方法死循环,该参数会传给监听事件
635
+ */
636
+
637
+
638
+ setLayerVisibleStateByIds(ids, visible, eventTarget) {
639
+ if (!(ids && ids.length > 0)) return;
640
+ let layer;
641
+
642
+ for (let z = 0; z < ids.length; z++) {
643
+ for (let i = 0; i < this._layerListData.length; i++) {
644
+ if (this._layerListData[i].guid === ids[z]) {
645
+ this._layerListData[i].visible = visible;
646
+ layer = this.getLayerByGuid(ids[z], this._layerListData[i].serverType);
647
+
648
+ if (layer) {
649
+ if (this._layerListData[i].serverType === "terrainprovider") {
650
+ if (visible) {
651
+ this.setTerrain(layer);
652
+ } else {
653
+ this._viewer.terrainProvider = this._emptyTerrainProvider;
654
+ }
655
+ } else {
656
+ layer.show = visible;
657
+ }
658
+ } else if (visible) {
659
+ //如果不存在该图层则添加
660
+ if (this._layerListData[i].serverType === "kqserver") {
661
+ var imageryProvider = new Cesium.Kq3dKQGISMapServerImageryProviderExt({
662
+ url: this._layerListData[i].url,
663
+ ua_token: this._layerListData[i].accessToken,
664
+ layers: this._layerListData[i].id + ""
665
+ });
666
+ var imageryLayer = new Cesium.ImageryLayer(imageryProvider);
667
+ imageryLayer.name = this._layerListData[i].guid;
668
+
669
+ this._viewer.imageryLayers.add(imageryLayer);
670
+ }
671
+ }
672
+ }
673
+ }
674
+ }
675
+ } //通过guid获取ImageryLayer图层添加的index
676
+
677
+
678
+ getImageryLayerAddIndex(guid) {
679
+ let layers = [];
680
+ let layerListIndex = -1;
681
+ let data = this._layerListData; //从_layerListData中找出所有ImageryLayer图层
682
+
683
+ data.forEach((layer, index) => {
684
+ if (layer.serverType === "kqserver" || layer.serverType === "imagerylayer") {
685
+ layers.push(layer);
686
+
687
+ if (layer.guid === guid) {
688
+ layerListIndex = index;
689
+ }
690
+ }
691
+ });
692
+
693
+ if (layerListIndex > -1) {
694
+ //搜索左边相邻显示的图层
695
+ let isLeftLayerShow = false;
696
+
697
+ for (var i = layerListIndex - 1; i >= 0; i--) {
698
+ if (data[i].visible) {}
699
+ }
700
+ }
701
+ } //通过guid获取图层对象
702
+
703
+
704
+ getLayerByGuid(guid, type) {
705
+ if (!type) {
706
+ type = this.getLayerTypeByGuid(guid);
707
+ }
708
+
709
+ if (type === "kqserver") {
710
+ let imageryLayers = this._viewer.imageryLayers._layers;
711
+ let layer = imageryLayers.find(item => {
712
+ return item.name === guid;
713
+ });
714
+ return layer;
715
+ } else if (type === "imagerylayer") {
716
+ let imageryLayers = this._viewer.imageryLayers._layers;
717
+ let layer = imageryLayers.find(item => {
718
+ return item.guid === guid;
719
+ });
720
+ return layer;
721
+ } else if (type === "terrainprovider") {
722
+ let layer = this._terrainProviders.find(item => {
723
+ return item.guid === guid;
724
+ });
725
+
726
+ return layer;
727
+ } else if (type === "3dtiles") {
728
+ let primitives = this._viewer.scene.primitives._primitives;
729
+ let layer = primitives.find(item => {
730
+ return item.guid === guid && item instanceof Cesium.Cesium3DTileset;
731
+ });
732
+ return layer;
733
+ } else if (type === "datasource") {
734
+ let dataSources = this._viewer.dataSources._dataSources;
735
+ let layer = dataSources.find(item => {
736
+ return item.guid === guid;
737
+ });
738
+ return layer;
739
+ }
740
+ } //通过guid获取图层类型
741
+
742
+
743
+ getLayerTypeByGuid(guid) {
744
+ let listLayer = this._layerListData.find(item => {
745
+ return item.guid === guid;
746
+ });
747
+
748
+ if (listLayer) {
749
+ return listLayer.serverType;
750
+ }
751
+ } // 获取所有图层原数据(包括adddata组件的临时图层数据,不包括底图baselayer)
752
+
753
+
754
+ getLayerData() {
755
+ return JSON.parse(JSON.stringify(this._layerListData));
756
+ } // 获取所有图层的key(包括adddata组件的临时图层数据,不包括底图baselayer)
757
+
758
+
759
+ getLayerDataKey() {
760
+ let keys = [];
761
+
762
+ this._layerListData.forEach(item => {
763
+ keys.push(item.guid);
764
+ });
765
+
766
+ return keys;
767
+ } //获取所有图层的树形结构数据
768
+
769
+
770
+ getLayerTreeData() {
771
+ return JSON.parse(JSON.stringify(this._layerTreeData));
772
+ } //获取选中图层集合
773
+
774
+
775
+ getLayerCheckedList() {
776
+ let checkedLayers = [];
777
+
778
+ this._layerListData.forEach(layer => {
779
+ if (layer.visible) {
780
+ checkedLayers.push(layer);
781
+ }
782
+ });
783
+
784
+ return checkedLayers;
785
+ } //获取选中图层key集合
786
+
787
+
788
+ getLayerCheckedListKey() {
789
+ let checkedKeys = [];
790
+
791
+ this._layerListData.forEach(layer => {
792
+ if (layer.visible) {
793
+ checkedKeys.push(layer.guid);
794
+ }
795
+ });
796
+
797
+ return checkedKeys;
798
+ }
799
+ /**
800
+ * 获取勾选图层的图层数据,如果是有融合图层,则只返回融合图层的子图层
801
+ */
802
+
803
+
804
+ getLayerDataByLayerChecked() {
805
+ let layerData = [];
806
+ const layers_checked = this.getLayerCheckedList();
807
+ const layers_old = this._layerListData_old;
808
+
809
+ for (let i = 0; i < layers_checked.length; i++) {
810
+ if (layers_checked[i].combined) {
811
+ getChildren(layers_checked[i].id);
812
+ } else {
813
+ layerData.push(layers_checked[i]);
814
+ }
815
+ }
816
+
817
+ return layerData;
818
+
819
+ function getChildren(parentId) {
820
+ for (let z = 0; z < layers_old.length; z++) {
821
+ if (layers_old[z].parentLayerId === parentId) {
822
+ // 分组节点
823
+ if (layers_old[z].groupLayer) {
824
+ getChildren(layers_old[z].id);
825
+ } else {
826
+ layerData.push(layers_old[z]);
827
+ }
828
+ }
829
+ }
830
+ }
831
+ } //缩放至图层
832
+
833
+
834
+ flyToBounds(guid) {
835
+ let viewer = this._viewer;
836
+ let layer = this.getLayerByGuid(guid);
837
+
838
+ if (layer instanceof Cesium.ImageryLayer) {
839
+ layer.getViewableRectangle().then(function (rectangle) {
840
+ viewer.camera.flyTo({
841
+ destination: rectangle
842
+ });
843
+ });
844
+ } else if (layer instanceof Cesium.Cesium3DTileset) {
845
+ viewer.zoomTo(layer);
846
+ } else if (layer instanceof Cesium.GeoJsonDataSource || layer instanceof Cesium.Kq3dGeoJsonDataSource || layer instanceof Cesium.KmlDataSource || layer instanceof Cesium.CzmlDataSource) {
847
+ viewer.flyTo(layer);
848
+ } else if (layer instanceof Cesium.Kq3dKQGISServerTerrainProvider || layer instanceof Cesium.Kq3dFileTerrainProvider || layer instanceof Cesium.CesiumTerrainProvider) {
849
+ layer.getViewableRectangle().then(function (rectangle) {
850
+ if (layer.ExtentSource) {
851
+ var rectangle = Cesium.Rectangle.fromDegrees(layer.ExtentSource.left, layer.ExtentSource.bottom, layer.ExtentSource.right, layer.ExtentSource.top);
852
+ viewer.scene.camera.flyTo({
853
+ destination: rectangle
854
+ });
855
+ } else if (rectangle) {
856
+ viewer.camera.flyTo({
857
+ destination: rectangle
858
+ });
859
+ }
860
+ });
861
+ }
862
+ } //获取基础图层Index
863
+
864
+
865
+ getBaseLayerIndex() {
866
+ // let baseIndex = 0;
867
+ // this._viewer.imageryLayers._layers.forEach(layer => {
868
+ // if (layer._isBaseLayer) {
869
+ // baseIndex++;
870
+ // }
871
+ // });
872
+ // return baseIndex;
873
+ return 1;
874
+ } //获取图层原始Index
875
+
876
+
877
+ getLayerOldIndex(guid) {
878
+ let baseIndex = this.getBaseLayerIndex();
879
+
880
+ let layerIndex = this._imageryLayerGuids.indexOf(guid);
881
+
882
+ return baseIndex + layerIndex;
883
+ } //设置图层置顶或取消置顶
884
+
885
+
886
+ setLayerBringToFrontById(guid, isFront) {
887
+ let layer = this.getLayerByGuid(guid);
888
+
889
+ if (layer) {
890
+ if (isFront) {
891
+ //置顶
892
+ if (this._frontLayerGuid === guid) return;
893
+
894
+ if (this._frontLayerGuid) {
895
+ // 如果已经有置顶图层 先把已经置顶的图层还原 再继续操作
896
+ let frontLayer = this.getLayerByGuid(this._frontLayerGuid);
897
+ let frontOldIndex = this.getLayerOldIndex(this._frontLayerGuid);
898
+ var length = frontLayer._layerIndex - frontOldIndex;
899
+
900
+ for (let i = 0; i < length; i++) {
901
+ if (frontLayer instanceof Cesium.ImageryLayer) {
902
+ this._viewer.imageryLayers.lower(frontLayer);
903
+ }
904
+ }
905
+ }
906
+
907
+ if (layer instanceof Cesium.ImageryLayer) {
908
+ this._viewer.imageryLayers.raiseToTop(layer);
909
+ }
910
+
911
+ this._frontLayerGuid = guid;
912
+ } else {
913
+ //取消置顶
914
+ if (this._frontLayerGuid !== guid) return;
915
+ let oldIndex = this.getLayerOldIndex(guid);
916
+ let length = layer._layerIndex - oldIndex;
917
+
918
+ for (let j = 0; j < length; j++) {
919
+ if (layer instanceof Cesium.ImageryLayer) {
920
+ this._viewer.imageryLayers.lower(layer);
921
+ }
922
+ }
923
+
924
+ this._frontLayerGuid = null;
925
+ }
926
+ }
927
+ } //图层上移
928
+
929
+
930
+ raiseLayerById(guid) {
931
+ let layer = this.getLayerByGuid(guid);
932
+
933
+ if (layer instanceof Cesium.ImageryLayer) {
934
+ this._viewer.imageryLayers.raise(layer);
935
+ }
936
+ } //图层下移
937
+
938
+
939
+ lowerLayerById(guid) {
940
+ let layer = this.getLayerByGuid(guid);
941
+
942
+ if (layer instanceof Cesium.ImageryLayer) {
943
+ let baseIndex = this.getBaseLayerIndex(); //防止图层下移到底图下面
944
+
945
+ if (layer._layerIndex > baseIndex) {
946
+ this._viewer.imageryLayers.lower(layer);
947
+ }
948
+ }
949
+ } //重置图层顺序
950
+
951
+
952
+ resetLayerIndex() {
953
+ let that = this;
954
+ let oldIndex, layer; //重置影像图层顺序
955
+
956
+ that._imageryLayerGuids.forEach(guid => {
957
+ oldIndex = that.getLayerOldIndex(guid);
958
+ layer = that.getLayerByGuid(guid);
959
+ let length = layer._layerIndex - oldIndex;
960
+
961
+ for (let j = 0; j < length; j++) {
962
+ that._viewer.imageryLayers.lower(layer);
963
+ }
964
+ });
965
+ } //设置图层透明度
966
+
967
+
968
+ setLayerOpacityById(guid, opacity) {
969
+ let layer = this.getLayerByGuid(guid);
970
+
971
+ if (layer instanceof Cesium.ImageryLayer) {
972
+ layer.alpha = opacity;
973
+ } else if (layer instanceof Cesium.Cesium3DTileset) {
974
+ layer.style = new Cesium.Cesium3DTileStyle({
975
+ color: "color('rgba(255,255,255," + opacity + ")')"
976
+ });
977
+ }
978
+ } //添加临时图层树节点
979
+
980
+
981
+ addTempLayerNode(layer, type = 0) {
982
+ let tempLayer = null;
983
+
984
+ for (let i = 0; i < this._layerTreeData.length; i++) {
985
+ if (this._layerTreeData[i].guid === "134f6h768tha23_3d") {
986
+ tempLayer = this._layerTreeData[i];
987
+ break;
988
+ }
989
+ }
990
+
991
+ if (!tempLayer) {
992
+ tempLayer = {
993
+ guid: "134f6h768tha23_3d",
994
+ name: "临时图层",
995
+ children: []
996
+ };
997
+
998
+ this._layerTreeData.push(tempLayer);
999
+ }
1000
+
1001
+ tempLayer.children.push(layer);
1002
+
1003
+ if (type === 0) {
1004
+ if (layer.children) {
1005
+ layer.children.forEach(child => {
1006
+ this._layerListData.push(child);
1007
+ }, this);
1008
+ } else {
1009
+ this._layerListData.push(layer);
1010
+ }
1011
+ }
1012
+
1013
+ this._scenceView.fire("resetLayerDatas");
1014
+ } //设置地形
1015
+
1016
+
1017
+ setTerrain(terrainProvider) {
1018
+ if (this._viewer.terrainProvider) {
1019
+ let guid = this._viewer.terrainProvider.guid;
1020
+
1021
+ if (guid) {
1022
+ //取消树节点勾选
1023
+ function uncheckNode(node, id) {
1024
+ if (node.children) {
1025
+ node.children.forEach(child => {
1026
+ uncheckNode(child, id);
1027
+ });
1028
+ } else {
1029
+ if (node.guid === id) {
1030
+ node.visible = false;
1031
+ }
1032
+ }
1033
+ }
1034
+
1035
+ this._layerTreeData.forEach(item => {
1036
+ uncheckNode(item, guid);
1037
+ });
1038
+
1039
+ this._scenceView.fire("resetLayerDatas");
1040
+ }
1041
+ }
1042
+
1043
+ this._viewer.terrainProvider = terrainProvider;
1044
+ }
1045
+ /**
1046
+ * 删除临时添加数据
1047
+ * 移除渲染图层
1048
+ * 删除 _layerTreeData的临时图层数据
1049
+ * 删除 _layerListData的临时图层数据
1050
+ * @param guid
1051
+ */
1052
+
1053
+
1054
+ delTempData(guid) {
1055
+ if (guid) {
1056
+ let guids = []; //获取需要删除的图层guid集合
1057
+
1058
+ getChildrenByGuid(this._layerTreeData, guid, guids); //删除_layerTreeData数据
1059
+
1060
+ delTreeDataByGuid(this._layerTreeData, guid);
1061
+ guids.forEach(id => {
1062
+ //移除渲染图层
1063
+ this.removeLayerByGuid(id); //删除_layerListData数据
1064
+
1065
+ for (var i = 0; i < this._layerListData.length; i++) {
1066
+ if (id === this._layerListData[i].guid) {
1067
+ this._layerListData.splice(i, 1);
1068
+
1069
+ break;
1070
+ }
1071
+ }
1072
+ }, this);
1073
+ }
1074
+ } //通过guid移除图层
1075
+
1076
+
1077
+ removeLayerByGuid(guid) {
1078
+ let type = this.getLayerTypeByGuid(guid);
1079
+ let layer = this.getLayerByGuid(guid, type);
1080
+
1081
+ if (layer) {
1082
+ switch (type) {
1083
+ case "kqserver":
1084
+ case "imagerylayer":
1085
+ this._viewer.imageryLayers.remove(layer);
1086
+
1087
+ break;
1088
+
1089
+ case "terrainprovider":
1090
+ //删除地形集合数据
1091
+ for (let i = 0; i < this._terrainProviders.length; i++) {
1092
+ if (this._terrainProviders[i].guid === guid) {
1093
+ this._terrainProviders.splice(i, 1);
1094
+
1095
+ break;
1096
+ }
1097
+ }
1098
+
1099
+ this._viewer.terrainProvider = this._emptyTerrainProvider;
1100
+ break;
1101
+
1102
+ case "3dtiles":
1103
+ this._viewer.scene.primitives.remove(layer);
1104
+
1105
+ break;
1106
+
1107
+ case "datasource":
1108
+ this._viewer.dataSources.remove(layer);
1109
+
1110
+ break;
1111
+
1112
+ default:
1113
+ break;
1114
+ }
1115
+ }
1116
+ } //通过guid刷新图层
1117
+
1118
+
1119
+ refreshLayerByGuid(guid) {
1120
+ let layer = this.getLayerByGuid(guid);
1121
+
1122
+ if (layer) {
1123
+ if (layer.imageryProvider && layer.imageryProvider._reload) {
1124
+ layer.imageryProvider._reload();
1125
+ }
1126
+ }
1127
+ } //销毁
1128
+
1129
+
1130
+ destroy() {
1131
+ this._viewer = null;
1132
+ this._scenceView = null;
1133
+ }
1134
+
1135
+ }
1136
+ /**
1137
+ * 根据guid获取子节点guid集合
1138
+ * @param data
1139
+ * @param guid
1140
+ */
1141
+
1142
+ function getChildrenByGuid(data, guid, guids, addChildren = false) {
1143
+ for (let i = 0; i < data.length; i++) {
1144
+ if (data[i].children) {
1145
+ if (data[i].guid === guid || addChildren) {
1146
+ getChildrenByGuid(data[i].children, guid, guids, true);
1147
+ } else {
1148
+ getChildrenByGuid(data[i].children, guid, guids);
1149
+ }
1150
+ } else {
1151
+ if (data[i].guid === guid || addChildren) {
1152
+ guids.push(data[i].guid);
1153
+ }
1154
+ }
1155
+ }
1156
+ }
1157
+ /**
1158
+ * 根据guid删除树节点数据,包含子节点也删除
1159
+ * @param data
1160
+ * @param guid
1161
+ */
1162
+
1163
+
1164
+ function delTreeDataByGuid(data, guid) {
1165
+ var hasGuid = false;
1166
+
1167
+ for (var i = 0; i < data.length; i++) {
1168
+ if (data[i].guid === guid) {
1169
+ data.splice(i, 1);
1170
+ hasGuid = true;
1171
+ break;
1172
+ }
1173
+ }
1174
+
1175
+ if (!hasGuid) {
1176
+ for (var i = 0; i < data.length; i++) {
1177
+ if (data[i].children) {
1178
+ delTreeDataByGuid(data[i].children, guid);
1179
+ }
1180
+ }
1181
+ }
1182
+ }
1183
+ ;// CONCATENATED MODULE: external "@zpc_npm/vue-iclient-common/_types/global-event"
1184
+ var global_event_namespaceObject = require("@zpc_npm/vue-iclient-common/_types/global-event");
1185
+ var global_event_default = /*#__PURE__*/__webpack_require__.n(global_event_namespaceObject);
1186
+ ;// CONCATENATED MODULE: ./src/webgl/scenceview/ScenceViewViewModel.js
1187
+
1188
+ //ScenceView逻辑类
1189
+
1190
+
1191
+
1192
+
1193
+ class ScenceViewViewModel extends (mitt_default()) {
1194
+ // 三维球div id
1195
+ // 三维viewer对象
1196
+ // 语言
1197
+ //绘制管理对象
1198
+ //图层管理对象
1199
+ //底图集合
1200
+ constructor(props, _language) {
1201
+ super();
1202
+
1203
+ _defineProperty(this, "_viewerId", "");
1204
+
1205
+ _defineProperty(this, "_viewer", null);
1206
+
1207
+ _defineProperty(this, "_language", null);
1208
+
1209
+ _defineProperty(this, "_drawManager", null);
1210
+
1211
+ _defineProperty(this, "_layerManager", null);
1212
+
1213
+ _defineProperty(this, "_props", null);
1214
+
1215
+ _defineProperty(this, "_removeEventListener", null);
1216
+
1217
+ _defineProperty(this, "_baseLayers", {});
1218
+
1219
+ this._viewerId = props.target;
1220
+ this._props = props;
1221
+ this._language = _language;
1222
+ } //初始化三维球
1223
+
1224
+
1225
+ initViewer() {
1226
+ var defaultOptions = {
1227
+ imageryProvider: new Cesium.SingleTileImageryProvider({
1228
+ url: Cesium.buildModuleUrl("Assets/Textures/earth_color_low_4096.jpg")
1229
+ }),
1230
+ animation: false,
1231
+ timeline: false,
1232
+ baseLayerPicker: false,
1233
+ geocoder: false,
1234
+ homeButton: false,
1235
+ fullscreenButton: false,
1236
+ selectionIndicator: false,
1237
+ navigation: false,
1238
+ sceneModePicker: false,
1239
+ infoBox: false,
1240
+ //languageStyle: _LANG_, 'zh-cn/en'
1241
+ navigationHelpButton: false
1242
+ };
1243
+
1244
+ for (var key in this._props.options) {
1245
+ if (this._props.options.hasOwnProperty(key)) {
1246
+ defaultOptions[key] = this._props.options[key];
1247
+ }
1248
+ }
1249
+
1250
+ this._viewer = new Cesium.Viewer(this._viewerId, defaultOptions); // this._viewer.scene.globe.depthTestAgainstTerrain = true;
1251
+
1252
+ this.initManagerClass();
1253
+ global_event_default().setWebMap(this._viewerId, "cesium", this);
1254
+ global_event_default().fire("load-viewer", {
1255
+ eventMapTarget: this._viewerId
1256
+ });
1257
+ global_event_default().off("load-viewer");
1258
+ this._layerManager && this._layerManager.addServiceData(this._props.service);
1259
+ this.fire("mounted", {
1260
+ eventMapTarget: this
1261
+ });
1262
+ } //初始化操作类
1263
+
1264
+
1265
+ initManagerClass() {
1266
+ if (this._viewer) {
1267
+ this._drawManager = new DrawManager(this._viewer);
1268
+ this._layerManager = new LayerManager(this);
1269
+ }
1270
+ } //销毁
1271
+
1272
+
1273
+ destroy() {
1274
+ if (this._removeEventListener) {
1275
+ this._removeEventListener();
1276
+
1277
+ this._removeEventListener = null;
1278
+ }
1279
+
1280
+ this._viewer = null;
1281
+ this._drawManager = null;
1282
+ this._layerManager = null;
1283
+ } //获取相机焦点
1284
+
1285
+
1286
+ getCameraFocus() {
1287
+ var scene = this._viewer.scene;
1288
+ var camera = scene.camera;
1289
+ var rayScratch = new Cesium.Ray();
1290
+ rayScratch.origin = camera.positionWC;
1291
+ rayScratch.direction = camera.directionWC;
1292
+ var result = new Cesium.Cartesian3();
1293
+ result = scene.globe.pick(rayScratch, scene, result);
1294
+
1295
+ if (result) {
1296
+ result = camera.worldToCameraCoordinatesPoint(result, result);
1297
+ }
1298
+
1299
+ return result;
1300
+ } //地图缩放
1301
+
1302
+
1303
+ zoom(scale) {
1304
+ var scene = this._viewer.scene;
1305
+ var camera = scene.camera;
1306
+ var focus = this.getCameraFocus();
1307
+ var orientation;
1308
+
1309
+ if (!focus) {
1310
+ // Camera direction is not pointing at the globe, so use the ellipsoid horizon point as
1311
+ // the focal point.
1312
+ var ray = new Cesium.Ray(camera.worldToCameraCoordinatesPoint(scene.globe.ellipsoid.cartographicToCartesian(camera.positionCartographic)), camera.directionWC);
1313
+ focus = Cesium.IntersectionTests.grazingAltitudeLocation(ray, scene.globe.ellipsoid);
1314
+ orientation = {
1315
+ heading: camera.heading,
1316
+ pitch: camera.pitch,
1317
+ roll: camera.roll
1318
+ };
1319
+ } else {
1320
+ orientation = {
1321
+ direction: camera.direction,
1322
+ up: camera.up
1323
+ };
1324
+ }
1325
+
1326
+ var cartesian3Scratch = new Cesium.Cartesian3();
1327
+ var direction = Cesium.Cartesian3.subtract(camera.position, focus, cartesian3Scratch);
1328
+ var movementVector = Cesium.Cartesian3.multiplyByScalar(direction, scale, direction);
1329
+ var endPosition = Cesium.Cartesian3.add(focus, movementVector, focus);
1330
+ camera.flyTo({
1331
+ destination: endPosition,
1332
+ orientation: orientation,
1333
+ duration: 0.5,
1334
+ convert: false
1335
+ });
1336
+ } //地图放大
1337
+
1338
+
1339
+ zoomIn() {
1340
+ this.zoom(0.5);
1341
+ } //地图缩小
1342
+
1343
+
1344
+ zoomOut() {
1345
+ this.zoom(2);
1346
+ } //重置视角
1347
+
1348
+
1349
+ resetView() {//this._viewer.camera.flyHome(1);
1350
+ } //重置方向
1351
+
1352
+
1353
+ resetOrientation() {
1354
+ var camera = this._viewer.camera;
1355
+ var scene = this._viewer.scene;
1356
+ var depthTestAgainstTerrain = scene.globe.depthTestAgainstTerrain;
1357
+
1358
+ if (!depthTestAgainstTerrain) {
1359
+ scene.globe.depthTestAgainstTerrain = true;
1360
+ }
1361
+
1362
+ var canvas = scene.canvas;
1363
+ var windowCenter = new Cesium.Cartesian2(canvas.clientWidth / 2, canvas.clientHeight / 2);
1364
+ setTimeout(() => {
1365
+ var center = scene.pickPosition(windowCenter);
1366
+
1367
+ if (!center) {
1368
+ center = scene.camera.pickEllipsoid(windowCenter, scene.globe.ellipsoid);
1369
+ }
1370
+
1371
+ scene.globe.depthTestAgainstTerrain = depthTestAgainstTerrain;
1372
+ var distance = Cesium.Cartesian3.distance(center, camera.positionWC);
1373
+ var heading = 6.28319;
1374
+ var pitch = camera.pitch;
1375
+ var hpr = new Cesium.HeadingPitchRange(heading, pitch, distance);
1376
+ camera.lookAt(center, hpr);
1377
+ camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
1378
+ }, 300);
1379
+ } //绑定指南针
1380
+
1381
+
1382
+ bindCompassEvent(heading) {
1383
+ var camera = this._viewer.camera;
1384
+ this._removeEventListener = camera.changed.addEventListener(function () {
1385
+ heading.value = camera.heading;
1386
+ });
1387
+ } //获取三维视角
1388
+
1389
+
1390
+ getViewPosition() {
1391
+ var camera = this._viewer.camera;
1392
+ var position = {
1393
+ x: camera.position.x,
1394
+ y: camera.position.y,
1395
+ z: camera.position.z
1396
+ };
1397
+ return {
1398
+ position: position,
1399
+ heading: camera.heading,
1400
+ pitch: camera.pitch,
1401
+ roll: camera.roll
1402
+ };
1403
+ } //设置三维视角
1404
+
1405
+
1406
+ setViewPosition(view) {
1407
+ this._viewer.camera.flyTo({
1408
+ destination: view.position,
1409
+ orientation: {
1410
+ heading: view.heading,
1411
+ pitch: view.pitch,
1412
+ roll: view.roll
1413
+ }
1414
+ });
1415
+ } //创建底图
1416
+
1417
+
1418
+ _createBaseLayer(layerConfig) {
1419
+ let layer = null;
1420
+ let index = 1;
1421
+ let layerType = layerConfig.serverType.toLowerCase();
1422
+
1423
+ switch (layerType) {
1424
+ case "kqserver":
1425
+ layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dKQGISMapServerImageryProviderExt({
1426
+ url: layerConfig.url,
1427
+ ua_token: layerConfig.accessToken
1428
+ }), index);
1429
+ break;
1430
+
1431
+ case "wmts":
1432
+ let options = {
1433
+ url: layerConfig.url,
1434
+ layer: layerConfig.id,
1435
+ tileMatrixSetID: layerConfig.tilematrixSet || "default028mm",
1436
+ tileMatrixLabels: layerConfig.tileMatrixLabels,
1437
+ style: layerConfig.style || "default",
1438
+ format: layerConfig.format || "image/png",
1439
+ minimumLevel: layerConfig.minZoom,
1440
+ maximumLevel: layerConfig.maxZoom,
1441
+ subdomains: layerConfig.subdomains,
1442
+ tilingScheme: layerConfig.epsg === "4326" ? new Cesium.GeographicTilingScheme() : new Cesium.WebMercatorTilingScheme()
1443
+ };
1444
+ layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.WebMapTileServiceImageryProvider(options), index);
1445
+ break;
1446
+
1447
+ case "wms":
1448
+ layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.WebMapServiceImageryProvider({
1449
+ url: layerConfig.url,
1450
+ layers: layerConfig.id,
1451
+ parameters: {
1452
+ transparent: "true",
1453
+ format: "image/png"
1454
+ }
1455
+ }), index);
1456
+ break;
1457
+
1458
+ case "tianditu":
1459
+ layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dTiandituImageryProvider({
1460
+ mapStyle: layerConfig.layerType + "_c"
1461
+ }), index);
1462
+ break;
1463
+
1464
+ case "baidu":
1465
+ layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dBaiduMapsImageryProvider({
1466
+ mapStyle: layerConfig.layerType
1467
+ }), index);
1468
+ break;
1469
+
1470
+ case "gaode":
1471
+ layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dAMapsImageryProvider({
1472
+ mapStyle: layerConfig.layerType
1473
+ }), index);
1474
+ break;
1475
+
1476
+ case "tencent":
1477
+ layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dQQMapsImageryProvider({
1478
+ mapStyle: layerConfig.layerType
1479
+ }), index);
1480
+ break;
1481
+
1482
+ case "bing":
1483
+ layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.BingMapsImageryProvider({
1484
+ url: layerConfig.url || "https://dev.virtualearth.net",
1485
+ key: layerConfig.key || "AmXdbd8UeUJtaRSn7yVwyXgQlBBUqliLbHpgn2c76DfuHwAXfRrgS5qwfHU6Rhm8",
1486
+ mapStyle: layerConfig.layerType
1487
+ }), index);
1488
+ break;
1489
+
1490
+ case "arcgisonline":
1491
+ layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.Kq3dArcGISMapServerImageryProvider({
1492
+ url: layerConfig.url
1493
+ }), index);
1494
+ break;
1495
+
1496
+ case "mapbox":
1497
+ layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.MapboxImageryProvider({
1498
+ mapId: "mapbox." + layerConfig.layerType,
1499
+ accessToken: layerConfig.key || "pk.eyJ1IjoiZXhhbXBsZXMiLCJhIjoiY2p1dHRybDR5MGJuZjQzcGhrZ2doeGgwNyJ9.a-vxW4UaxOoUMWUTGnEArw"
1500
+ }), index);
1501
+ break;
1502
+
1503
+ case "osm":
1504
+ layer = this._viewer.imageryLayers.addImageryProvider(new Cesium.createOpenStreetMapImageryProvider({
1505
+ url: layerConfig.url
1506
+ }), index);
1507
+ break;
1508
+ }
1509
+
1510
+ return layer;
1511
+ }
1512
+ /**
1513
+ * 操作底图显隐的方法
1514
+ * @param layerKey 存储图层信息的key
1515
+ * @param layerInfo 创建图层的参数信息对象
1516
+ * @param visible 显隐
1517
+ */
1518
+
1519
+
1520
+ showBaseLayer(layerKey, layerInfo, visible) {
1521
+ let layers = this._baseLayers[layerKey];
1522
+
1523
+ if (!layers) {
1524
+ layers = [];
1525
+
1526
+ for (let i = 0; i < layerInfo.layers.length; i++) {
1527
+ let layer = this._createBaseLayer(layerInfo.layers[i]);
1528
+
1529
+ if (layer) {
1530
+ layer.show = visible;
1531
+ layer.layerkey = layerInfo.layers[i].layerkey;
1532
+ layers.push(layer);
1533
+ }
1534
+ }
1535
+
1536
+ this._baseLayers[layerKey] = layers;
1537
+ } else {
1538
+ for (let i = 0; i < layerInfo.layers.length; i++) {
1539
+ layers.forEach(layer => {
1540
+ if (layerInfo.layers[i].layerkey === layer.layerkey) {
1541
+ layer.show = visible;
1542
+ }
1543
+ });
1544
+ }
1545
+ }
1546
+ }
1547
+
1548
+ }
1549
+ ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/webgl/scenceview/ScenceView.vue?vue&type=script&setup=true&lang=js
1550
+
1551
+ const _hoisted_1 = {
1552
+ class: "kq-scence-view",
1553
+ ondragstart: "return false;",
1554
+ oncontextmenu: "return false;"
1555
+ };
1556
+ const _hoisted_2 = ["id"];
1557
+ const _hoisted_3 = {
1558
+ class: "view-left-tools"
1559
+ };
1560
+
1561
+
1562
+
1563
+
1564
+ const __default__ = {
1565
+ name: "KqScenceView"
1566
+ };
1567
+ /* harmony default export */ var ScenceViewvue_type_script_setup_true_lang_js = (/*#__PURE__*/Object.assign(__default__, {
1568
+ props: {
1569
+ target: {
1570
+ type: String,
1571
+ default: "cesiumContainer"
1572
+ },
1573
+ options: {
1574
+ type: Object,
1575
+
1576
+ default() {
1577
+ return {};
1578
+ }
1579
+
1580
+ },
1581
+ service: {
1582
+ type: Object,
1583
+ default: {
1584
+ name: null,
1585
+ //服务名称
1586
+ url: null,
1587
+ //服务地址
1588
+ token: null,
1589
+ //服务token
1590
+ type: "kqmapserver",
1591
+ //服务类型 kqmapserver或者kq3dserver
1592
+ isShowAllLayers: true,
1593
+ defaultShowLayerNames: []
1594
+ }
1595
+ },
1596
+ showToolButtons: {
1597
+ type: Boolean,
1598
+ default: true
1599
+ }
1600
+ },
1601
+
1602
+ setup(__props) {
1603
+ const props = __props;
1604
+ const {
1605
+ proxy
1606
+ } = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.getCurrentInstance)();
1607
+ /**
1608
+ * 支持传入属性:
1609
+ * target - viewer对象渲染的div的id
1610
+ * options - 三维球初始化属性设置
1611
+ * scenceUrl - 场景地址
1612
+ * showToolButtons - 是否显示左侧工具栏按钮
1613
+ */
1614
+
1615
+ let language = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)({});
1616
+ let viewModel = null;
1617
+ let heading = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)(0);
1618
+ let removeEventListener = null;
1619
+ (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.onMounted)(() => {
1620
+ //设置语言
1621
+ let _lang = proxy.$i18n.locale;
1622
+ let _language = proxy.$i18n.messages[_lang]['webgl'];
1623
+ language.value = _language; //初始化逻辑类
1624
+
1625
+ viewModel = new ScenceViewViewModel(props, _language);
1626
+ viewModel.initViewer();
1627
+
1628
+ if (props.showToolButtons) {
1629
+ //绑定指南针事件
1630
+ viewModel.bindCompassEvent(heading);
1631
+ }
1632
+ }); // 销毁
1633
+
1634
+ (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.onBeforeUnmount)(() => {
1635
+ viewModel && viewModel.destroy();
1636
+ }); //地图放大
1637
+
1638
+ function zoomIn() {
1639
+ viewModel && viewModel.zoomIn();
1640
+ } //地图缩小
1641
+
1642
+
1643
+ function zoomOut() {
1644
+ viewModel && viewModel.zoomOut();
1645
+ } //重置视角
1646
+
1647
+
1648
+ function resetView() {
1649
+ viewModel && viewModel.resetView();
1650
+ } //重置方向
1651
+
1652
+
1653
+ function resetOrientation() {
1654
+ viewModel && viewModel.resetOrientation();
1655
+ }
1656
+
1657
+ return (_ctx, _cache) => {
1658
+ const _component_kq_icon = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.resolveComponent)("kq-icon");
1659
+
1660
+ const _component_kq_button = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.resolveComponent)("kq-button");
1661
+
1662
+ return (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.openBlock)(), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createElementBlock)("div", _hoisted_1, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.renderSlot)(_ctx.$slots, "default"), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createElementVNode)("div", {
1663
+ id: props.target,
1664
+ class: "view-container"
1665
+ }, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.withDirectives)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createElementVNode)("div", _hoisted_3, [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)(_component_kq_button, {
1666
+ onClick: zoomIn,
1667
+ title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(language).zoomIn
1668
+ }, {
1669
+ default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)(_component_kq_icon, {
1670
+ size: 16
1671
+ }, {
1672
+ default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(icons_vue_namespaceObject.Plus))]),
1673
+ _: 1
1674
+ /* STABLE */
1675
+
1676
+ })]),
1677
+ _: 1
1678
+ /* STABLE */
1679
+
1680
+ }, 8
1681
+ /* PROPS */
1682
+ , ["title"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)(_component_kq_button, {
1683
+ onClick: zoomOut,
1684
+ title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(language).zoomOut,
1685
+ style: {
1686
+ "margin-top": "0px"
1687
+ }
1688
+ }, {
1689
+ default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)(_component_kq_icon, {
1690
+ size: 16
1691
+ }, {
1692
+ default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(icons_vue_namespaceObject.Minus))]),
1693
+ _: 1
1694
+ /* STABLE */
1695
+
1696
+ })]),
1697
+ _: 1
1698
+ /* STABLE */
1699
+
1700
+ }, 8
1701
+ /* PROPS */
1702
+ , ["title"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)(_component_kq_button, {
1703
+ onClick: resetView,
1704
+ title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(language).resetView
1705
+ }, {
1706
+ default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)(_component_kq_icon, {
1707
+ size: 20
1708
+ }, {
1709
+ default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(icons_vue_namespaceObject.RefreshLeft))]),
1710
+ _: 1
1711
+ /* STABLE */
1712
+
1713
+ })]),
1714
+ _: 1
1715
+ /* STABLE */
1716
+
1717
+ }, 8
1718
+ /* PROPS */
1719
+ , ["title"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)(_component_kq_button, {
1720
+ onClick: resetOrientation,
1721
+ title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(language).resetOrientation,
1722
+ class: "compass"
1723
+ }, {
1724
+ default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)(_component_kq_icon, {
1725
+ size: 20,
1726
+ style: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.normalizeStyle)('transform: rotate(-' + (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(heading) + 'rad);-webkit-transform: rotate(-' + (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(heading) + 'rad)')
1727
+ }, {
1728
+ default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.withCtx)(() => [(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(vue_iclient_icons_namespaceObject.IconCompass3D))]),
1729
+ _: 1
1730
+ /* STABLE */
1731
+
1732
+ }, 8
1733
+ /* PROPS */
1734
+ , ["style"])]),
1735
+ _: 1
1736
+ /* STABLE */
1737
+
1738
+ }, 8
1739
+ /* PROPS */
1740
+ , ["title"])], 512
1741
+ /* NEED_PATCH */
1742
+ ), [[external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.vShow, __props.showToolButtons]])], 8
1743
+ /* PROPS */
1744
+ , _hoisted_2)]);
1745
+ };
1746
+ }
1747
+
1748
+ }));
1749
+ ;// CONCATENATED MODULE: ./src/webgl/scenceview/ScenceView.vue?vue&type=script&setup=true&lang=js
1750
+
1751
+ ;// CONCATENATED MODULE: ./src/webgl/scenceview/ScenceView.vue
1752
+
1753
+
1754
+
1755
+ const __exports__ = ScenceViewvue_type_script_setup_true_lang_js;
1756
+
1757
+ /* harmony default export */ var ScenceView = (__exports__);
1758
+ ;// CONCATENATED MODULE: external "@zpc_npm/vue-iclient-common/init.js"
1759
+ var init_js_namespaceObject = require("@zpc_npm/vue-iclient-common/init.js");
1760
+ var init_js_default = /*#__PURE__*/__webpack_require__.n(init_js_namespaceObject);
1761
+ ;// CONCATENATED MODULE: ./src/webgl/scenceview/index.js
1762
+
1763
+
1764
+
1765
+
1766
+ ScenceView.install = (Vue, opts) => {
1767
+ init_js_default()(Vue, opts);
1768
+ Vue.component(ScenceView.name, ScenceView);
1769
+ };
1770
+
1771
+
1772
+ }();
1773
+ module.exports = __webpack_exports__;
1774
+ /******/ })()
1775
+ ;