@kq_npm/client3d_webgl_vue 4.5.56 → 4.5.57
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/adddata/index.js +189 -21
- package/airspacegridoccupancyquery/index.js +108 -7
- package/airspaceprofileanalysis/index.js +99 -7
- package/aspectanalysis/index.js +25 -7
- package/baseterraingallery/index.js +16 -4
- package/boxclip/index.js +58 -16
- package/buildpointmodel/index.js +3441 -544
- package/buildpointmodel/style/buildpointmodel.css +1 -1
- package/buildpolygonmodel/index.js +205 -81
- package/buildpolylinemodel/index.js +346 -70
- package/clientPrint/index.js +10524 -3041
- package/comparemap/index.js +132 -60
- package/compass/index.js +16 -6
- package/excavatefillanalysis/index.js +51 -7
- package/fixedzoomin/index.js +24 -7
- package/fixedzoomout/index.js +25 -7
- package/flight/index.js +113 -26
- package/floodanalysis/index.js +79 -14
- package/geologicalbodyanalysis/index.js +41 -5
- package/gpuspatialquery/index.js +59 -11
- package/gridoccupancyquery/index.js +78 -12
- package/hawkeye/index.js +20 -2
- package/headertemp/index.js +7 -2
- package/heatmap3d/index.js +282 -158
- package/index.js +10524 -3041
- package/isolineanalysis/index.js +113 -38
- package/light/index.js +80 -22
- package/limitheightanalysis/index.js +30 -10
- package/lowaltitudefeature/index.js +292 -119
- package/measure/index.js +60 -19
- package/modelFlat/index.js +48 -8
- package/modeledit/index.js +38 -4
- package/modelexcavate/index.js +48 -7
- package/modelfilter/index.js +51 -8
- package/modelmaterialedit/index.js +127 -25
- package/modelprofileanalysis/index.js +50 -14
- package/modelselect/index.js +33 -3
- package/modelstyleedit/index.js +39 -3
- package/modeltransform/index.js +79 -14
- package/package.json +1 -1
- package/particleeffect/index.js +83 -17
- package/planeclip/index.js +66 -17
- package/pointcloudrender/index.js +134 -15
- package/radarscananalysis/index.js +35 -3
- package/resetview/index.js +14 -6
- package/roller/index.js +55 -18
- package/scaneffect/index.js +98 -29
- package/sceneadvancedtoimage/index.js +32 -6
- package/sceneapp/index.js +10524 -3041
- package/sceneset/index.js +141 -71
- package/scenetohdimage/index.js +23 -3
- package/sceneview/index.js +10524 -3041
- package/screenshot/index.js +44 -11
- package/shadowanalysis/index.js +79 -19
- package/sightlineanalysis/index.js +66 -15
- package/skylineanalysis/index.js +20 -4
- package/slopeanalysis/index.js +75 -16
- package/slopeaspectanalysis/index.js +128 -26
- package/statusbar/index.js +80 -67
- package/style.css +1 -1
- package/terrainoperation/index.js +39 -7
- package/terrainprofileanalysis/index.js +43 -5
- package/toolbarapp/index.js +10524 -3041
- package/toolboxapp/index.js +10524 -3041
- package/typhoontrac/index.js +134 -16
- package/underground/index.js +8 -2
- package/videofusion/index.js +86 -30
- package/videoproject/index.js +77 -23
- package/viewshedanalysis/index.js +58 -13
- package/weathereffect/index.js +73 -18
- package/webgl.es.js +263 -264
- package/windyslicing/index.js +233 -45
- package/wireframesketch/index.js +25 -8
|
@@ -529,6 +529,8 @@ const _hoisted_5 = {
|
|
|
529
529
|
const _hoisted_6 = {
|
|
530
530
|
class: "title"
|
|
531
531
|
};
|
|
532
|
+
// 是否显示分析结果面板
|
|
533
|
+
|
|
532
534
|
const __default__ = {
|
|
533
535
|
name: "Kq3dExcavateFillAnalysis"
|
|
534
536
|
};
|
|
@@ -583,6 +585,7 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
583
585
|
locale
|
|
584
586
|
} = (0, _useGlobalConfig.useLocale)();
|
|
585
587
|
let showResult = (0, _vue.ref)(false);
|
|
588
|
+
// 分析结果数据(挖方/填方体积)
|
|
586
589
|
let result = (0, _vue.reactive)({
|
|
587
590
|
cutVolumn: "NaN",
|
|
588
591
|
fillVolumn: "NaN"
|
|
@@ -609,6 +612,8 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
609
612
|
// 填方颜色
|
|
610
613
|
restrictedArea: settingParams.restrictedArea ?? null // 限制绘制面积
|
|
611
614
|
});
|
|
615
|
+
|
|
616
|
+
// 填挖方分析视图模型实例
|
|
612
617
|
let viewModel = null;
|
|
613
618
|
|
|
614
619
|
// 组件容器Ref
|
|
@@ -616,6 +621,7 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
616
621
|
|
|
617
622
|
// 生成组件默认header
|
|
618
623
|
let headerTemp = (0, _vue.ref)();
|
|
624
|
+
// header组件引用Ref
|
|
619
625
|
let headerTempRef = (0, _vue.ref)();
|
|
620
626
|
(0, _vue.onMounted)(() => {
|
|
621
627
|
(0, _util.updatePosition)(boxRef.value, props);
|
|
@@ -634,12 +640,14 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
634
640
|
setTimeout(() => {
|
|
635
641
|
showResult.value = true;
|
|
636
642
|
const cutVolumn = viewModel._excavateFillAnalysis.cutVolumn;
|
|
643
|
+
// 挖方体积超过10亿则换算为立方千米显示
|
|
637
644
|
if (cutVolumn > 1000000000) {
|
|
638
645
|
result.cutVolumn = (cutVolumn / 1000000000).toFixed(2) + " km³";
|
|
639
646
|
} else {
|
|
640
647
|
result.cutVolumn = cutVolumn.toFixed(2) + " m³";
|
|
641
648
|
}
|
|
642
649
|
const fillVolumn = viewModel._excavateFillAnalysis.fillVolumn;
|
|
650
|
+
// 填方体积超过10亿则换算为立方千米显示
|
|
643
651
|
if (fillVolumn > 1000000000) {
|
|
644
652
|
result.fillVolumn = (fillVolumn / 1000000000).toFixed(2) + " km³";
|
|
645
653
|
} else {
|
|
@@ -674,18 +682,25 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
674
682
|
showResult.value = false;
|
|
675
683
|
viewModel && viewModel.clear();
|
|
676
684
|
}
|
|
685
|
+
|
|
686
|
+
/** @description 参数变化处理,根据变化的参数类型更新分析状态与结果展示
|
|
687
|
+
* @param {string} key 变化的参数类型(height/cutColor/fillColor)
|
|
688
|
+
*/
|
|
677
689
|
function paramsChanged(key) {
|
|
678
690
|
switch (key) {
|
|
691
|
+
// 高度变化:更新基准高度并刷新结果
|
|
679
692
|
case "height":
|
|
680
693
|
viewModel.setReferenceHeight(formItem.altitudeHeight);
|
|
681
694
|
if (showResult.value) {
|
|
682
695
|
const cutVolumn = viewModel._excavateFillAnalysis.cutVolumn;
|
|
696
|
+
// 挖方体积超过10亿则换算为立方千米显示
|
|
683
697
|
if (cutVolumn > 1000000000) {
|
|
684
698
|
result.cutVolumn = (cutVolumn / 1000000000).toFixed(2) + " km³";
|
|
685
699
|
} else {
|
|
686
700
|
result.cutVolumn = cutVolumn.toFixed(2) + " m³";
|
|
687
701
|
}
|
|
688
702
|
const fillVolumn = viewModel._excavateFillAnalysis.fillVolumn;
|
|
703
|
+
// 填方体积超过10亿则换算为立方千米显示
|
|
689
704
|
if (fillVolumn > 1000000000) {
|
|
690
705
|
result.fillVolumn = (fillVolumn / 1000000000).toFixed(2) + " km³";
|
|
691
706
|
} else {
|
|
@@ -693,9 +708,11 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
693
708
|
}
|
|
694
709
|
}
|
|
695
710
|
break;
|
|
711
|
+
// 挖方颜色变化
|
|
696
712
|
case "cutColor":
|
|
697
713
|
viewModel.setCutColor(formItem.excavateColor);
|
|
698
714
|
break;
|
|
715
|
+
// 填方颜色变化
|
|
699
716
|
case "fillColor":
|
|
700
717
|
viewModel.setFillColor(formItem.fillColor);
|
|
701
718
|
break;
|
|
@@ -703,6 +720,8 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
703
720
|
break;
|
|
704
721
|
}
|
|
705
722
|
}
|
|
723
|
+
|
|
724
|
+
// 关闭结果面板
|
|
706
725
|
function closeBtn() {
|
|
707
726
|
showResult.value = false;
|
|
708
727
|
}
|
|
@@ -1259,6 +1278,12 @@ var _useGlobalConfig = __webpack_require__(22686);
|
|
|
1259
1278
|
//填挖方分析逻辑类
|
|
1260
1279
|
|
|
1261
1280
|
class ExcavateFillAnalysisViewModel {
|
|
1281
|
+
//限制绘制面积阈值
|
|
1282
|
+
/** @description 构造函数,初始化填挖方分析视图模型
|
|
1283
|
+
* @param {Object} scenceView 三维场景视图对象
|
|
1284
|
+
* @param {Object} options 填挖方分析配置参数
|
|
1285
|
+
* @param {Function} callback 分析完成回调函数
|
|
1286
|
+
*/
|
|
1262
1287
|
constructor(scenceView, options, callback) {
|
|
1263
1288
|
this._excavateFillAnalysis = null;
|
|
1264
1289
|
//填挖方分析三维对象
|
|
@@ -1267,7 +1292,9 @@ class ExcavateFillAnalysisViewModel {
|
|
|
1267
1292
|
this._options = null;
|
|
1268
1293
|
//填挖方分析存储参数对象
|
|
1269
1294
|
this._language = {};
|
|
1295
|
+
// 多语言资源对象
|
|
1270
1296
|
this._scenceView = null;
|
|
1297
|
+
//三维场景视图对象
|
|
1271
1298
|
this._restrictedArea = null;
|
|
1272
1299
|
const {
|
|
1273
1300
|
locale
|
|
@@ -1286,10 +1313,14 @@ class ExcavateFillAnalysisViewModel {
|
|
|
1286
1313
|
this.callback = callback;
|
|
1287
1314
|
}
|
|
1288
1315
|
|
|
1289
|
-
|
|
1316
|
+
/** @description 处理绘制坐标,将三维笛卡尔坐标转换为经纬度二维坐标
|
|
1317
|
+
* @param {Array} points 三维笛卡尔坐标点集合
|
|
1318
|
+
* @returns {Array} 转换后的经纬度坐标点集合
|
|
1319
|
+
*/
|
|
1290
1320
|
coordinateTransform(points) {
|
|
1291
1321
|
let cutPoints = points.map(function (point) {
|
|
1292
1322
|
let cartesPh = Cesium.Cartographic.fromCartesian(point);
|
|
1323
|
+
// 弧度转换为角度
|
|
1293
1324
|
cartesPh.longitude = cartesPh.longitude / Math.PI * 180;
|
|
1294
1325
|
cartesPh.latitude = cartesPh.latitude / Math.PI * 180;
|
|
1295
1326
|
let map = {
|
|
@@ -1307,6 +1338,7 @@ class ExcavateFillAnalysisViewModel {
|
|
|
1307
1338
|
var that = this;
|
|
1308
1339
|
// 判断是否添加了地形
|
|
1309
1340
|
if (this._options.viewer.terrainProvider.availability) {
|
|
1341
|
+
// 判断地形是否为非 heightmap 结构(即量化地形)
|
|
1310
1342
|
if (this._options.viewer.terrainProvider && !this._options.viewer.terrainProvider._heightmapStructure) {
|
|
1311
1343
|
if (this._drawManager) {
|
|
1312
1344
|
this._drawManager.startDraw("polygon", {
|
|
@@ -1314,11 +1346,14 @@ class ExcavateFillAnalysisViewModel {
|
|
|
1314
1346
|
}, (feature, {
|
|
1315
1347
|
shape
|
|
1316
1348
|
}) => {
|
|
1349
|
+
// 过滤非当前分析组绘制的要素
|
|
1317
1350
|
if (!shape.groupName || shape.groupName !== "ExcavateFillAnalysisDraw") return;
|
|
1318
1351
|
that._drawManager.clearDrawGroup("ExcavateFillAnalysisDraw");
|
|
1319
1352
|
if (shape) {
|
|
1353
|
+
// 限制绘制面积检查
|
|
1320
1354
|
if (typeof that._restrictedArea === 'number' && !isNaN(that._restrictedArea) && isFinite(that._restrictedArea)) {
|
|
1321
1355
|
const area = that._scenceView.computePolygonArea(shape._controlPoints);
|
|
1356
|
+
// 绘制面积超过限制范围则提示并终止
|
|
1322
1357
|
if (area / 1000000 > Number(that._restrictedArea)) {
|
|
1323
1358
|
(0, _message.default)({
|
|
1324
1359
|
message: this._language.value.webgl["restrictedAreaTips"],
|
|
@@ -1327,6 +1362,7 @@ class ExcavateFillAnalysisViewModel {
|
|
|
1327
1362
|
return;
|
|
1328
1363
|
}
|
|
1329
1364
|
}
|
|
1365
|
+
// 坐标转换并创建填挖方分析对象
|
|
1330
1366
|
that._options.positions = that.coordinateTransform(shape._controlPoints);
|
|
1331
1367
|
that._excavateFillAnalysis = new Cesium.Kq3dCutFill(that._options);
|
|
1332
1368
|
that.callback && that.callback();
|
|
@@ -1334,12 +1370,14 @@ class ExcavateFillAnalysisViewModel {
|
|
|
1334
1370
|
}, "ExcavateFillAnalysisDraw");
|
|
1335
1371
|
}
|
|
1336
1372
|
} else {
|
|
1373
|
+
// heightmap 地形不支持该分析
|
|
1337
1374
|
(0, _message.default)({
|
|
1338
1375
|
message: this._language.value.webgl["stkTerrainAnalysisTips"],
|
|
1339
1376
|
type: "warning"
|
|
1340
1377
|
});
|
|
1341
1378
|
}
|
|
1342
1379
|
} else {
|
|
1380
|
+
// 未加载地形则提示
|
|
1343
1381
|
(0, _message.default)({
|
|
1344
1382
|
message: this._language.value.webgl["terrainAnalysisTips"],
|
|
1345
1383
|
type: "warning"
|
|
@@ -1361,21 +1399,27 @@ class ExcavateFillAnalysisViewModel {
|
|
|
1361
1399
|
this._excavateFillAnalysis = null;
|
|
1362
1400
|
}
|
|
1363
1401
|
|
|
1364
|
-
|
|
1402
|
+
/** @description 设置基准高度
|
|
1403
|
+
* @param {number} height 基准高度值
|
|
1404
|
+
*/
|
|
1365
1405
|
setReferenceHeight(height) {
|
|
1366
1406
|
this._options.referenceHeight = Number(height);
|
|
1367
1407
|
if (this._excavateFillAnalysis) {
|
|
1368
1408
|
this._excavateFillAnalysis.referenceHeight = Number(height);
|
|
1369
1409
|
}
|
|
1370
1410
|
}
|
|
1371
|
-
|
|
1411
|
+
/** @description 设置挖方颜色
|
|
1412
|
+
* @param {string} cutColor 挖方颜色(CSS颜色字符串)
|
|
1413
|
+
*/
|
|
1372
1414
|
setCutColor(cutColor) {
|
|
1373
1415
|
this._options.cutColor = Cesium.Color.fromCssColorString(cutColor).withAlpha(0.7);
|
|
1374
1416
|
if (this._excavateFillAnalysis) {
|
|
1375
1417
|
this._excavateFillAnalysis.cutColor = this._options.cutColor;
|
|
1376
1418
|
}
|
|
1377
1419
|
}
|
|
1378
|
-
|
|
1420
|
+
/** @description 设置填方颜色
|
|
1421
|
+
* @param {string} fillColor 填方颜色(CSS颜色字符串)
|
|
1422
|
+
*/
|
|
1379
1423
|
setFillColor(fillColor) {
|
|
1380
1424
|
this._options.fillColor = Cesium.Color.fromCssColorString(fillColor).withAlpha(0.7);
|
|
1381
1425
|
if (this._excavateFillAnalysis) {
|
|
@@ -2361,11 +2405,11 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
2361
2405
|
value: true
|
|
2362
2406
|
}));
|
|
2363
2407
|
exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
|
|
2364
|
-
|
|
2408
|
+
const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
|
|
2365
2409
|
__webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
|
|
2366
|
-
|
|
2410
|
+
const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
|
|
2367
2411
|
__webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
|
|
2368
|
-
|
|
2412
|
+
const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
|
|
2369
2413
|
__webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
|
|
2370
2414
|
|
|
2371
2415
|
/***/ })
|
package/fixedzoomin/index.js
CHANGED
|
@@ -175,6 +175,9 @@ exports["default"] = void 0;
|
|
|
175
175
|
// 三维固定缩放逻辑
|
|
176
176
|
class FixedZoomin3dViewModel {
|
|
177
177
|
//三维viewer对象
|
|
178
|
+
/** @description 构造函数,初始化三维viewer对象
|
|
179
|
+
* @param {Object} viewer 三维viewer对象
|
|
180
|
+
*/
|
|
178
181
|
constructor(viewer) {
|
|
179
182
|
this._viewer = null;
|
|
180
183
|
this._viewer = viewer;
|
|
@@ -195,16 +198,22 @@ class FixedZoomin3dViewModel {
|
|
|
195
198
|
return result;
|
|
196
199
|
}
|
|
197
200
|
|
|
198
|
-
|
|
201
|
+
/** @description 地图缩小,根据场景模式分发到对应处理方法
|
|
202
|
+
* @param {number} scale 缩放比例
|
|
203
|
+
*/
|
|
199
204
|
zoom(scale) {
|
|
205
|
+
// 三维模式缩放
|
|
200
206
|
if (this._viewer.scene.mode == Cesium.SceneMode.SCENE3D) {
|
|
201
207
|
this.zoom3D(scale);
|
|
202
208
|
} else if (this._viewer.scene.mode == Cesium.SceneMode.SCENE2D) {
|
|
209
|
+
// 二维模式缩放
|
|
203
210
|
this.zoom2D(scale);
|
|
204
211
|
}
|
|
205
212
|
}
|
|
206
213
|
|
|
207
|
-
|
|
214
|
+
/** @description 三维模式缩小,基于相机焦点计算飞行终点
|
|
215
|
+
* @param {number} scale 缩放比例
|
|
216
|
+
*/
|
|
208
217
|
zoom3D(scale) {
|
|
209
218
|
if (!this._viewer) return;
|
|
210
219
|
var scene = this._viewer.scene;
|
|
@@ -223,14 +232,18 @@ class FixedZoomin3dViewModel {
|
|
|
223
232
|
roll: camera.roll
|
|
224
233
|
};
|
|
225
234
|
} else {
|
|
235
|
+
// 相机指向地球时使用相机方向与向上向量
|
|
226
236
|
orientation = {
|
|
227
237
|
direction: camera.direction,
|
|
228
238
|
up: camera.up
|
|
229
239
|
};
|
|
230
240
|
}
|
|
231
241
|
var cartesian3Scratch = new Cesium.Cartesian3();
|
|
242
|
+
// 计算相机到焦点的方向向量
|
|
232
243
|
var direction = Cesium.Cartesian3.subtract(camera.position, focus, cartesian3Scratch);
|
|
244
|
+
// 按缩放比例计算移动向量
|
|
233
245
|
var movementVector = Cesium.Cartesian3.multiplyByScalar(direction, scale, direction);
|
|
246
|
+
// 计算飞行终点位置
|
|
234
247
|
var endPosition = Cesium.Cartesian3.add(focus, movementVector, focus);
|
|
235
248
|
camera.flyTo({
|
|
236
249
|
destination: endPosition,
|
|
@@ -240,12 +253,14 @@ class FixedZoomin3dViewModel {
|
|
|
240
253
|
});
|
|
241
254
|
}
|
|
242
255
|
|
|
243
|
-
|
|
256
|
+
/** @description 二维模式缩小,基于相机高度按比例缩小
|
|
257
|
+
* @param {number} scale 缩放比例
|
|
258
|
+
*/
|
|
244
259
|
zoom2D(scale) {
|
|
245
260
|
if (!this._viewer) return;
|
|
246
261
|
var scene = this._viewer.scene;
|
|
247
262
|
var camera = scene.camera;
|
|
248
|
-
|
|
263
|
+
const height = camera.positionCartographic.height;
|
|
249
264
|
camera.zoomOut(scale * height / 2);
|
|
250
265
|
}
|
|
251
266
|
}
|
|
@@ -371,7 +386,9 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
371
386
|
},
|
|
372
387
|
setup(__props) {
|
|
373
388
|
const props = __props;
|
|
389
|
+
// 固定缩小视图模型实例
|
|
374
390
|
let viewModel = null;
|
|
391
|
+
// 按钮组件Ref
|
|
375
392
|
let btn = (0, _vue.ref)(null);
|
|
376
393
|
|
|
377
394
|
// 国际化
|
|
@@ -507,11 +524,11 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
507
524
|
value: true
|
|
508
525
|
}));
|
|
509
526
|
exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
|
|
510
|
-
|
|
527
|
+
const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
|
|
511
528
|
__webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
|
|
512
|
-
|
|
529
|
+
const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
|
|
513
530
|
__webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
|
|
514
|
-
|
|
531
|
+
const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
|
|
515
532
|
__webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
|
|
516
533
|
|
|
517
534
|
/***/ })
|
package/fixedzoomout/index.js
CHANGED
|
@@ -50,7 +50,10 @@ var _default = exports.A = /*@__PURE__*/Object.assign(__default__, {
|
|
|
50
50
|
},
|
|
51
51
|
setup(__props) {
|
|
52
52
|
const props = __props;
|
|
53
|
+
|
|
54
|
+
// 固定放大视图模型实例
|
|
53
55
|
let viewModel = null;
|
|
56
|
+
// 按钮组件Ref
|
|
54
57
|
let btn = (0, _vue.ref)(null);
|
|
55
58
|
|
|
56
59
|
// 国际化
|
|
@@ -420,6 +423,9 @@ exports["default"] = void 0;
|
|
|
420
423
|
// 三维固定缩放逻辑
|
|
421
424
|
class FixedZoomout3dViewModel {
|
|
422
425
|
//三维viewer对象
|
|
426
|
+
/** @description 构造函数,初始化三维viewer对象
|
|
427
|
+
* @param {Object} viewer 三维viewer对象
|
|
428
|
+
*/
|
|
423
429
|
constructor(viewer) {
|
|
424
430
|
this._viewer = null;
|
|
425
431
|
this._viewer = viewer;
|
|
@@ -439,16 +445,22 @@ class FixedZoomout3dViewModel {
|
|
|
439
445
|
}
|
|
440
446
|
return result;
|
|
441
447
|
}
|
|
442
|
-
|
|
448
|
+
/** @description 地图放大,根据场景模式分发到对应处理方法
|
|
449
|
+
* @param {number} scale 缩放比例
|
|
450
|
+
*/
|
|
443
451
|
zoom(scale) {
|
|
452
|
+
// 三维模式缩放
|
|
444
453
|
if (this._viewer.scene.mode == Cesium.SceneMode.SCENE3D) {
|
|
445
454
|
this.zoom3D(scale);
|
|
446
455
|
} else if (this._viewer.scene.mode == Cesium.SceneMode.SCENE2D) {
|
|
456
|
+
// 二维模式缩放
|
|
447
457
|
this.zoom2D(scale);
|
|
448
458
|
}
|
|
449
459
|
}
|
|
450
460
|
|
|
451
|
-
|
|
461
|
+
/** @description 三维模式放大,基于相机焦点计算飞行终点
|
|
462
|
+
* @param {number} scale 缩放比例
|
|
463
|
+
*/
|
|
452
464
|
zoom3D(scale) {
|
|
453
465
|
if (!this._viewer) return;
|
|
454
466
|
var scene = this._viewer.scene;
|
|
@@ -466,14 +478,18 @@ class FixedZoomout3dViewModel {
|
|
|
466
478
|
roll: camera.roll
|
|
467
479
|
};
|
|
468
480
|
} else {
|
|
481
|
+
// 相机指向地球时使用相机方向与向上向量
|
|
469
482
|
orientation = {
|
|
470
483
|
direction: camera.direction,
|
|
471
484
|
up: camera.up
|
|
472
485
|
};
|
|
473
486
|
}
|
|
474
487
|
var cartesian3Scratch = new Cesium.Cartesian3();
|
|
488
|
+
// 计算相机到焦点的方向向量
|
|
475
489
|
var direction = Cesium.Cartesian3.subtract(camera.position, focus, cartesian3Scratch);
|
|
490
|
+
// 按缩放比例计算移动向量
|
|
476
491
|
var movementVector = Cesium.Cartesian3.multiplyByScalar(direction, scale, direction);
|
|
492
|
+
// 计算飞行终点位置
|
|
477
493
|
var endPosition = Cesium.Cartesian3.add(focus, movementVector, focus);
|
|
478
494
|
camera.flyTo({
|
|
479
495
|
destination: endPosition,
|
|
@@ -483,12 +499,14 @@ class FixedZoomout3dViewModel {
|
|
|
483
499
|
});
|
|
484
500
|
}
|
|
485
501
|
|
|
486
|
-
|
|
502
|
+
/** @description 二维模式放大,基于相机高度按比例放大
|
|
503
|
+
* @param {number} scale 缩放比例
|
|
504
|
+
*/
|
|
487
505
|
zoom2D(scale) {
|
|
488
506
|
if (!this._viewer) return;
|
|
489
507
|
var scene = this._viewer.scene;
|
|
490
508
|
var camera = scene.camera;
|
|
491
|
-
|
|
509
|
+
const height = camera.positionCartographic.height;
|
|
492
510
|
camera.zoomIn(height * scale);
|
|
493
511
|
}
|
|
494
512
|
}
|
|
@@ -505,11 +523,11 @@ Object.defineProperty(exports, "__esModule", ({
|
|
|
505
523
|
value: true
|
|
506
524
|
}));
|
|
507
525
|
exports.kq_npm_client_leaflet_vue = exports.kq_npm_client_common_vue = exports.kq_npm_client3d_webgl_vue = void 0;
|
|
508
|
-
|
|
526
|
+
const kq_npm_client_common_vue = exports.kq_npm_client_common_vue = window.kq_npm_client_common_vue = window.kq_npm_client_common_vue || {};
|
|
509
527
|
__webpack_require__.g.kq_npm_client_common_vue = kq_npm_client_common_vue;
|
|
510
|
-
|
|
528
|
+
const kq_npm_client_leaflet_vue = exports.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue = window.kq_npm_client_leaflet_vue || {};
|
|
511
529
|
__webpack_require__.g.kq_npm_client_leaflet_vue = kq_npm_client_leaflet_vue;
|
|
512
|
-
|
|
530
|
+
const kq_npm_client3d_webgl_vue = exports.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue = window.kq_npm_client3d_webgl_vue || {};
|
|
513
531
|
__webpack_require__.g.kq_npm_client3d_webgl_vue = kq_npm_client3d_webgl_vue;
|
|
514
532
|
|
|
515
533
|
/***/ })
|