@kq_npm/client3d_webgl_vue 0.4.1-beta → 0.4.3-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.
package/index.js CHANGED
@@ -453,8 +453,12 @@ __webpack_require__.d(__webpack_exports__, {
453
453
  "Kq3dBoxClipViewModel": function() { return /* reexport */ BoxClipViewModel; },
454
454
  "Kq3dCompareMap": function() { return /* reexport */ CompareMap; },
455
455
  "Kq3dCompareMapViewModel": function() { return /* reexport */ CompareMapViewModel; },
456
+ "Kq3dCompass": function() { return /* reexport */ Compass; },
457
+ "Kq3dCompassViewModel": function() { return /* reexport */ CompassViewModel; },
456
458
  "Kq3dExcavateFillAnalysis": function() { return /* reexport */ ExcavateFillAnalysis; },
457
459
  "Kq3dExcavateFillAnalysisViewModel": function() { return /* reexport */ ExcavateFillAnalysisViewModel; },
460
+ "Kq3dFixedZoom": function() { return /* reexport */ FixedZoom; },
461
+ "Kq3dFixedZoomViewModel": function() { return /* reexport */ FixedZoomViewModel; },
458
462
  "Kq3dFlight": function() { return /* reexport */ Flight; },
459
463
  "Kq3dFlightViewModel": function() { return /* reexport */ FlightViewModel; },
460
464
  "Kq3dFloodAnalysis": function() { return /* reexport */ FloodAnalysis; },
@@ -475,6 +479,8 @@ __webpack_require__.d(__webpack_exports__, {
475
479
  "Kq3dPlaneClipViewModel": function() { return /* reexport */ PlaneClipViewModel; },
476
480
  "Kq3dProfileAnalysis": function() { return /* reexport */ ProfileAnalysis; },
477
481
  "Kq3dProfileAnalysisViewModel": function() { return /* reexport */ ProfileAnalysisViewModel; },
482
+ "Kq3dResetView": function() { return /* reexport */ ResetView; },
483
+ "Kq3dResetViewViewModel": function() { return /* reexport */ ResetViewViewModel; },
478
484
  "Kq3dRoller": function() { return /* reexport */ Roller; },
479
485
  "Kq3dRollerViewModel": function() { return /* reexport */ RollerViewModel; },
480
486
  "Kq3dScreenShot": function() { return /* reexport */ Screenshot; },
@@ -504,10 +510,6 @@ __webpack_require__.d(__webpack_exports__, {
504
510
 
505
511
  ;// CONCATENATED MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
506
512
  var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject = require("vue");
507
- ;// CONCATENATED MODULE: external "@kq_npm/client_icons_vue"
508
- var client_icons_vue_namespaceObject = require("@kq_npm/client_icons_vue");
509
- ;// CONCATENATED MODULE: external "@element-plus/icons-vue"
510
- var icons_vue_namespaceObject = require("@element-plus/icons-vue");
511
513
  ;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
512
514
  function _defineProperty(obj, key, value) {
513
515
  if (key in obj) {
@@ -2306,138 +2308,6 @@ class ScenceViewViewModel extends (mitt_default()) {
2306
2308
  this._viewer = null;
2307
2309
  this._drawManager = null;
2308
2310
  this._layerManager = null;
2309
- } //获取相机焦点
2310
-
2311
-
2312
- getCameraFocus() {
2313
- var scene = this._viewer.scene;
2314
- var camera = scene.camera;
2315
- var rayScratch = new Cesium.Ray();
2316
- rayScratch.origin = camera.positionWC;
2317
- rayScratch.direction = camera.directionWC;
2318
- var result = new Cesium.Cartesian3();
2319
- result = scene.globe.pick(rayScratch, scene, result);
2320
-
2321
- if (result) {
2322
- result = camera.worldToCameraCoordinatesPoint(result, result);
2323
- }
2324
-
2325
- return result;
2326
- } //地图缩放
2327
-
2328
-
2329
- zoom(scale) {
2330
- var scene = this._viewer.scene;
2331
- var camera = scene.camera;
2332
- var focus = this.getCameraFocus();
2333
- var orientation;
2334
-
2335
- if (!focus) {
2336
- // Camera direction is not pointing at the globe, so use the ellipsoid horizon point as
2337
- // the focal point.
2338
- var ray = new Cesium.Ray(camera.worldToCameraCoordinatesPoint(scene.globe.ellipsoid.cartographicToCartesian(camera.positionCartographic)), camera.directionWC);
2339
- focus = Cesium.IntersectionTests.grazingAltitudeLocation(ray, scene.globe.ellipsoid);
2340
- orientation = {
2341
- heading: camera.heading,
2342
- pitch: camera.pitch,
2343
- roll: camera.roll
2344
- };
2345
- } else {
2346
- orientation = {
2347
- direction: camera.direction,
2348
- up: camera.up
2349
- };
2350
- }
2351
-
2352
- var cartesian3Scratch = new Cesium.Cartesian3();
2353
- var direction = Cesium.Cartesian3.subtract(camera.position, focus, cartesian3Scratch);
2354
- var movementVector = Cesium.Cartesian3.multiplyByScalar(direction, scale, direction);
2355
- var endPosition = Cesium.Cartesian3.add(focus, movementVector, focus);
2356
- camera.flyTo({
2357
- destination: endPosition,
2358
- orientation: orientation,
2359
- duration: 0.5,
2360
- convert: false
2361
- });
2362
- } //地图放大
2363
-
2364
-
2365
- zoomIn() {
2366
- this.zoom(0.5);
2367
- } //地图缩小
2368
-
2369
-
2370
- zoomOut() {
2371
- this.zoom(2);
2372
- } //重置视角
2373
-
2374
-
2375
- resetView() {//this._viewer.camera.flyHome(1);
2376
- } //重置方向
2377
-
2378
-
2379
- resetOrientation() {
2380
- var camera = this._viewer.camera;
2381
- var scene = this._viewer.scene;
2382
- var depthTestAgainstTerrain = scene.globe.depthTestAgainstTerrain;
2383
-
2384
- if (!depthTestAgainstTerrain) {
2385
- scene.globe.depthTestAgainstTerrain = true;
2386
- }
2387
-
2388
- var canvas = scene.canvas;
2389
- var windowCenter = new Cesium.Cartesian2(canvas.clientWidth / 2, canvas.clientHeight / 2);
2390
- setTimeout(() => {
2391
- var center = scene.pickPosition(windowCenter);
2392
-
2393
- if (!center) {
2394
- center = scene.camera.pickEllipsoid(windowCenter, scene.globe.ellipsoid);
2395
- }
2396
-
2397
- scene.globe.depthTestAgainstTerrain = depthTestAgainstTerrain;
2398
- var distance = Cesium.Cartesian3.distance(center, camera.positionWC);
2399
- var heading = 6.28319;
2400
- var pitch = camera.pitch;
2401
- var hpr = new Cesium.HeadingPitchRange(heading, pitch, distance);
2402
- camera.lookAt(center, hpr);
2403
- camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
2404
- }, 300);
2405
- } //绑定指南针
2406
-
2407
-
2408
- bindCompassEvent(heading) {
2409
- var camera = this._viewer.camera;
2410
- this._removeEventListener = camera.changed.addEventListener(function () {
2411
- heading.value = camera.heading;
2412
- });
2413
- } //获取三维视角
2414
-
2415
-
2416
- getViewPosition() {
2417
- var camera = this._viewer.camera;
2418
- var position = {
2419
- x: camera.position.x,
2420
- y: camera.position.y,
2421
- z: camera.position.z
2422
- };
2423
- return {
2424
- position: position,
2425
- heading: camera.heading,
2426
- pitch: camera.pitch,
2427
- roll: camera.roll
2428
- };
2429
- } //设置三维视角
2430
-
2431
-
2432
- setViewPosition(view) {
2433
- this._viewer.camera.flyTo({
2434
- destination: view.position,
2435
- orientation: {
2436
- heading: view.heading,
2437
- pitch: view.pitch,
2438
- roll: view.roll
2439
- }
2440
- });
2441
2311
  } //创建底图
2442
2312
 
2443
2313
 
@@ -2580,11 +2450,6 @@ const _hoisted_1 = {
2580
2450
  oncontextmenu: "return false;"
2581
2451
  };
2582
2452
  const _hoisted_2 = ["id"];
2583
- const _hoisted_3 = {
2584
- class: "view-left-tools"
2585
- };
2586
-
2587
-
2588
2453
 
2589
2454
 
2590
2455
  const __default__ = {
@@ -2619,17 +2484,11 @@ const __default__ = {
2619
2484
  defaultShowLayerNames: []
2620
2485
  }
2621
2486
  },
2622
- showToolButtons: {
2623
- type: Boolean,
2624
- default: true
2625
- },
2626
2487
  // ScenceView初始化的参数对象,包含初始化范围和layer信息。
2627
2488
  scenceInfo: Object
2628
2489
  },
2629
2490
 
2630
- setup(__props, {
2631
- expose
2632
- }) {
2491
+ setup(__props) {
2633
2492
  const props = __props;
2634
2493
  const {
2635
2494
  proxy
@@ -2644,7 +2503,6 @@ const __default__ = {
2644
2503
 
2645
2504
  let language = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)({});
2646
2505
  let viewModel = null;
2647
- let heading = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)(0);
2648
2506
  let removeEventListener = null;
2649
2507
  (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.onMounted)(() => {
2650
2508
  //设置语言
@@ -2654,111 +2512,461 @@ const __default__ = {
2654
2512
 
2655
2513
  viewModel = new ScenceViewViewModel(props, _language);
2656
2514
  viewModel.initViewer();
2657
-
2658
- if (props.showToolButtons) {
2659
- //绑定指南针事件
2660
- viewModel.bindCompassEvent(heading);
2661
- }
2662
2515
  }); // 销毁
2663
2516
 
2664
2517
  (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.onBeforeUnmount)(() => {
2665
2518
  viewModel && viewModel.destroy();
2666
- }); //地图放大
2519
+ });
2520
+ return (_ctx, _cache) => {
2521
+ 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", {
2522
+ id: props.target,
2523
+ class: "view-container"
2524
+ }, null, 8
2525
+ /* PROPS */
2526
+ , _hoisted_2)]);
2527
+ };
2528
+ }
2667
2529
 
2668
- function zoomIn() {
2669
- viewModel && viewModel.zoomIn();
2670
- } //地图缩小
2530
+ }));
2531
+ ;// CONCATENATED MODULE: ./src/webgl/scenceview/ScenceView.vue?vue&type=script&setup=true&lang=js
2532
+
2533
+ ;// CONCATENATED MODULE: ./src/webgl/scenceview/ScenceView.vue
2671
2534
 
2672
2535
 
2673
- function zoomOut() {
2674
- viewModel && viewModel.zoomOut();
2675
- } //重置视角
2676
2536
 
2537
+ const __exports__ = ScenceViewvue_type_script_setup_true_lang_js;
2677
2538
 
2678
- function resetView() {
2679
- viewModel && viewModel.resetView();
2680
- } //重置方向
2539
+ /* harmony default export */ var ScenceView = (__exports__);
2540
+ ;// CONCATENATED MODULE: external "@kq_npm/client_common_vue/init.js"
2541
+ var init_js_namespaceObject = require("@kq_npm/client_common_vue/init.js");
2542
+ var init_js_default = /*#__PURE__*/__webpack_require__.n(init_js_namespaceObject);
2543
+ ;// CONCATENATED MODULE: ./src/webgl/scenceview/index.js
2681
2544
 
2682
2545
 
2683
- function resetOrientation() {
2684
- viewModel && viewModel.resetOrientation();
2546
+
2547
+
2548
+ ScenceView.install = (Vue, opts) => {
2549
+ init_js_default()(Vue, opts);
2550
+ Vue.component(ScenceView.name, ScenceView);
2551
+ };
2552
+
2553
+
2554
+ ;// CONCATENATED MODULE: external "@element-plus/icons-vue"
2555
+ var icons_vue_namespaceObject = require("@element-plus/icons-vue");
2556
+ ;// CONCATENATED MODULE: ./src/webgl/fixedzoom/FixedZoomViewModel.js
2557
+
2558
+ // 三维固定缩放逻辑
2559
+ class FixedZoomViewModel {
2560
+ constructor(viewer) {
2561
+ _defineProperty(this, "_viewer", null);
2562
+
2563
+ this._viewer = viewer;
2564
+ } //获取相机焦点
2565
+
2566
+
2567
+ getCameraFocus() {
2568
+ if (!this._viewer) return;
2569
+ var scene = this._viewer.scene;
2570
+ var camera = scene.camera;
2571
+ var rayScratch = new Cesium.Ray();
2572
+ rayScratch.origin = camera.positionWC;
2573
+ rayScratch.direction = camera.directionWC;
2574
+ var result = new Cesium.Cartesian3();
2575
+ result = scene.globe.pick(rayScratch, scene, result);
2576
+
2577
+ if (result) {
2578
+ result = camera.worldToCameraCoordinatesPoint(result, result);
2685
2579
  }
2686
2580
 
2687
- expose({
2688
- zoomIn,
2689
- zoomOut,
2690
- resetView,
2691
- resetOrientation
2581
+ return result;
2582
+ } //地图缩放
2583
+
2584
+
2585
+ zoom(scale) {
2586
+ if (!this._viewer) return;
2587
+ var scene = this._viewer.scene;
2588
+ var camera = scene.camera;
2589
+ var focus = this.getCameraFocus();
2590
+ var orientation;
2591
+
2592
+ if (!focus) {
2593
+ // Camera direction is not pointing at the globe, so use the ellipsoid horizon point as
2594
+ // the focal point.
2595
+ var ray = new Cesium.Ray(camera.worldToCameraCoordinatesPoint(scene.globe.ellipsoid.cartographicToCartesian(camera.positionCartographic)), camera.directionWC);
2596
+ focus = Cesium.IntersectionTests.grazingAltitudeLocation(ray, scene.globe.ellipsoid);
2597
+ orientation = {
2598
+ heading: camera.heading,
2599
+ pitch: camera.pitch,
2600
+ roll: camera.roll
2601
+ };
2602
+ } else {
2603
+ orientation = {
2604
+ direction: camera.direction,
2605
+ up: camera.up
2606
+ };
2607
+ }
2608
+
2609
+ var cartesian3Scratch = new Cesium.Cartesian3();
2610
+ var direction = Cesium.Cartesian3.subtract(camera.position, focus, cartesian3Scratch);
2611
+ var movementVector = Cesium.Cartesian3.multiplyByScalar(direction, scale, direction);
2612
+ var endPosition = Cesium.Cartesian3.add(focus, movementVector, focus);
2613
+ camera.flyTo({
2614
+ destination: endPosition,
2615
+ orientation: orientation,
2616
+ duration: 0.5,
2617
+ convert: false
2692
2618
  });
2619
+ }
2620
+
2621
+ }
2622
+ ;// CONCATENATED MODULE: external "@kq_npm/client_common_vue/_utils/gis-utils"
2623
+ var gis_utils_namespaceObject = require("@kq_npm/client_common_vue/_utils/gis-utils");
2624
+ ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/webgl/fixedzoom/FixedZoom.vue?vue&type=script&setup=true&lang=js
2625
+
2626
+
2627
+
2628
+
2629
+ // 获取组件传参
2630
+
2631
+ const FixedZoomvue_type_script_setup_true_lang_js_default_ = {
2632
+ name: "Kq3dFixedZoom"
2633
+ };
2634
+ /* harmony default export */ var FixedZoomvue_type_script_setup_true_lang_js = (/*#__PURE__*/Object.assign(FixedZoomvue_type_script_setup_true_lang_js_default_, {
2635
+ props: {
2636
+ mapTarget: String,
2637
+ // 切换按钮是固定放大还是固定缩小,值:zoomIn 或 zoomOut
2638
+ isZoomInOrOut: {
2639
+ type: Boolean,
2640
+ default: true
2641
+ },
2642
+ // 按钮图标大小
2643
+ iconSize: {
2644
+ type: Number,
2645
+ default: 16
2646
+ },
2647
+ // 按钮大小
2648
+ buttonSize: {
2649
+ type: String,
2650
+ default: "32px"
2651
+ }
2652
+ },
2653
+
2654
+ setup(__props) {
2655
+ const props = __props;
2656
+ let language = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)({});
2657
+ let viewModel = null;
2658
+ let btn = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)(null);
2659
+ (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.onMounted)(() => {
2660
+ gis_utils_namespaceObject.utils.getWebMap(null, scenceView => {
2661
+ if (scenceView) {
2662
+ language.value = scenceView._language;
2663
+ viewModel = new FixedZoomViewModel(scenceView._viewer);
2664
+ }
2665
+ });
2666
+ }); // 按钮点击事件
2667
+
2668
+ function btnClick() {
2669
+ btn.value.$el.blur();
2670
+ viewModel && viewModel.zoom(props.isZoomInOrOut ? 0.5 : 2);
2671
+ }
2672
+
2693
2673
  return (_ctx, _cache) => {
2694
2674
  const _component_kq_icon = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.resolveComponent)("kq-icon");
2695
2675
 
2696
2676
  const _component_kq_button = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.resolveComponent)("kq-button");
2697
2677
 
2698
- 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", {
2699
- id: props.target,
2700
- class: "view-container"
2701
- }, [(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, {
2702
- onClick: zoomIn,
2703
- title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(language).zoomIn
2678
+ return (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.openBlock)(), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createBlock)(_component_kq_button, {
2679
+ title: __props.isZoomInOrOut ? (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(language).zoomIn : (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(language).zoomOut,
2680
+ ref_key: "btn",
2681
+ ref: btn,
2682
+ onClick: btnClick,
2683
+ style: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.normalizeStyle)('width:' + __props.buttonSize)
2704
2684
  }, {
2705
- 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, {
2706
- size: 16
2685
+ default: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.withCtx)(() => [__props.isZoomInOrOut ? ((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.openBlock)(), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createBlock)(_component_kq_icon, {
2686
+ key: 0,
2687
+ size: __props.iconSize
2707
2688
  }, {
2708
2689
  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))]),
2709
2690
  _: 1
2710
2691
  /* STABLE */
2711
2692
 
2712
- })]),
2713
- _: 1
2714
- /* STABLE */
2715
-
2716
- }, 8
2717
- /* PROPS */
2718
- , ["title"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)(_component_kq_button, {
2719
- onClick: zoomOut,
2720
- title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(language).zoomOut,
2721
- style: {
2722
- "margin-top": "0px"
2723
- }
2724
- }, {
2725
- 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, {
2726
- size: 16
2693
+ }, 8
2694
+ /* PROPS */
2695
+ , ["size"])) : (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createCommentVNode)("v-if", true), !__props.isZoomInOrOut ? ((0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.openBlock)(), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createBlock)(_component_kq_icon, {
2696
+ key: 1,
2697
+ size: __props.iconSize
2727
2698
  }, {
2728
2699
  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))]),
2729
2700
  _: 1
2730
2701
  /* STABLE */
2731
2702
 
2732
- })]),
2703
+ }, 8
2704
+ /* PROPS */
2705
+ , ["size"])) : (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createCommentVNode)("v-if", true)]),
2733
2706
  _: 1
2734
2707
  /* STABLE */
2735
2708
 
2736
2709
  }, 8
2737
2710
  /* PROPS */
2738
- , ["title"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)(_component_kq_button, {
2739
- onClick: resetView,
2740
- title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(language).resetView
2711
+ , ["title", "style"]);
2712
+ };
2713
+ }
2714
+
2715
+ }));
2716
+ ;// CONCATENATED MODULE: ./src/webgl/fixedzoom/FixedZoom.vue?vue&type=script&setup=true&lang=js
2717
+
2718
+ ;// CONCATENATED MODULE: ./src/webgl/fixedzoom/FixedZoom.vue
2719
+
2720
+
2721
+
2722
+ const FixedZoom_exports_ = FixedZoomvue_type_script_setup_true_lang_js;
2723
+
2724
+ /* harmony default export */ var FixedZoom = (FixedZoom_exports_);
2725
+ ;// CONCATENATED MODULE: ./src/webgl/fixedzoom/index.js
2726
+
2727
+
2728
+
2729
+
2730
+ FixedZoom.install = (Vue, opts) => {
2731
+ init_js_default()(Vue, opts);
2732
+ Vue.component(FixedZoom.name, FixedZoom);
2733
+ };
2734
+
2735
+
2736
+ ;// CONCATENATED MODULE: ./src/webgl/resetview/ResetViewViewModel.js
2737
+
2738
+ // 重置视图
2739
+ class ResetViewViewModel {
2740
+ constructor(viewer) {
2741
+ _defineProperty(this, "_viewer", null);
2742
+
2743
+ this._viewer = viewer;
2744
+ } //重置视角
2745
+
2746
+
2747
+ resetView() {
2748
+ this._viewer.camera.flyHome(1);
2749
+ }
2750
+
2751
+ }
2752
+ ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/webgl/resetview/ResetView.vue?vue&type=script&setup=true&lang=js
2753
+
2754
+
2755
+
2756
+
2757
+ // 获取组件传参
2758
+
2759
+ const ResetViewvue_type_script_setup_true_lang_js_default_ = {
2760
+ name: "Kq3dResetView"
2761
+ };
2762
+ /* harmony default export */ var ResetViewvue_type_script_setup_true_lang_js = (/*#__PURE__*/Object.assign(ResetViewvue_type_script_setup_true_lang_js_default_, {
2763
+ props: {
2764
+ mapTarget: String,
2765
+ // 按钮图标大小
2766
+ iconSize: {
2767
+ type: Number,
2768
+ default: 16
2769
+ },
2770
+ // 按钮大小
2771
+ buttonSize: {
2772
+ type: String,
2773
+ default: "32px"
2774
+ }
2775
+ },
2776
+
2777
+ setup(__props) {
2778
+ const props = __props;
2779
+ let language = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)({});
2780
+ let viewModel = null;
2781
+ let btn = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)(null);
2782
+ (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.onMounted)(() => {
2783
+ gis_utils_namespaceObject.utils.getWebMap(null, scenceView => {
2784
+ if (scenceView) {
2785
+ language.value = scenceView._language;
2786
+ viewModel = new ResetViewViewModel(scenceView._viewer);
2787
+ }
2788
+ });
2789
+ }); // 按钮点击事件
2790
+
2791
+ function btnClick(e) {
2792
+ btn.value.$el.blur();
2793
+ viewModel && viewModel.resetView();
2794
+ }
2795
+
2796
+ return (_ctx, _cache) => {
2797
+ const _component_kq_icon = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.resolveComponent)("kq-icon");
2798
+
2799
+ const _component_kq_button = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.resolveComponent)("kq-button");
2800
+
2801
+ return (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.openBlock)(), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createBlock)(_component_kq_button, {
2802
+ ref_key: "btn",
2803
+ ref: btn,
2804
+ onClick: btnClick,
2805
+ title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(language).resetView,
2806
+ style: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.normalizeStyle)('width:' + __props.buttonSize)
2741
2807
  }, {
2742
2808
  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, {
2743
- size: 20
2809
+ size: __props.iconSize
2744
2810
  }, {
2745
2811
  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))]),
2746
2812
  _: 1
2747
2813
  /* STABLE */
2748
2814
 
2749
- })]),
2815
+ }, 8
2816
+ /* PROPS */
2817
+ , ["size"])]),
2750
2818
  _: 1
2751
2819
  /* STABLE */
2752
2820
 
2753
2821
  }, 8
2754
2822
  /* PROPS */
2755
- , ["title"]), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createVNode)(_component_kq_button, {
2756
- onClick: resetOrientation,
2823
+ , ["title", "style"]);
2824
+ };
2825
+ }
2826
+
2827
+ }));
2828
+ ;// CONCATENATED MODULE: ./src/webgl/resetview/ResetView.vue?vue&type=script&setup=true&lang=js
2829
+
2830
+ ;// CONCATENATED MODULE: ./src/webgl/resetview/ResetView.vue
2831
+
2832
+
2833
+
2834
+ const ResetView_exports_ = ResetViewvue_type_script_setup_true_lang_js;
2835
+
2836
+ /* harmony default export */ var ResetView = (ResetView_exports_);
2837
+ ;// CONCATENATED MODULE: ./src/webgl/resetview/index.js
2838
+
2839
+
2840
+
2841
+
2842
+ ResetView.install = (Vue, opts) => {
2843
+ init_js_default()(Vue, opts);
2844
+ Vue.component(ResetView.name, ResetView);
2845
+ };
2846
+
2847
+
2848
+ ;// CONCATENATED MODULE: external "@kq_npm/client_icons_vue"
2849
+ var client_icons_vue_namespaceObject = require("@kq_npm/client_icons_vue");
2850
+ ;// CONCATENATED MODULE: ./src/webgl/compass/CompassViewModel.js
2851
+
2852
+ // 重置视图
2853
+ class CompassViewModel {
2854
+ constructor(viewer) {
2855
+ _defineProperty(this, "_viewer", null);
2856
+
2857
+ this._viewer = viewer;
2858
+ } //重置方向
2859
+
2860
+
2861
+ resetOrientation() {
2862
+ var camera = this._viewer.camera;
2863
+ var scene = this._viewer.scene;
2864
+ var depthTestAgainstTerrain = scene.globe.depthTestAgainstTerrain;
2865
+
2866
+ if (!depthTestAgainstTerrain) {
2867
+ scene.globe.depthTestAgainstTerrain = true;
2868
+ }
2869
+
2870
+ var canvas = scene.canvas;
2871
+ var windowCenter = new Cesium.Cartesian2(canvas.clientWidth / 2, canvas.clientHeight / 2);
2872
+ setTimeout(() => {
2873
+ var center = scene.pickPosition(windowCenter);
2874
+
2875
+ if (!center) {
2876
+ center = scene.camera.pickEllipsoid(windowCenter, scene.globe.ellipsoid);
2877
+ }
2878
+
2879
+ scene.globe.depthTestAgainstTerrain = depthTestAgainstTerrain;
2880
+ var distance = Cesium.Cartesian3.distance(center, camera.positionWC);
2881
+ var heading = 6.28319;
2882
+ var pitch = camera.pitch;
2883
+ var hpr = new Cesium.HeadingPitchRange(heading, pitch, distance);
2884
+ camera.lookAt(center, hpr);
2885
+ camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
2886
+ }, 300);
2887
+ } //绑定指南针
2888
+
2889
+
2890
+ bindCompassEvent(heading) {
2891
+ var camera = this._viewer.camera;
2892
+ this._removeEventListener = camera.changed.addEventListener(function () {
2893
+ heading.value = camera.heading;
2894
+ });
2895
+ } // 注销事件
2896
+
2897
+
2898
+ destroy() {
2899
+ if (this._removeEventListener) {
2900
+ this._removeEventListener();
2901
+
2902
+ this._removeEventListener = null;
2903
+ }
2904
+
2905
+ this._viewer = null;
2906
+ }
2907
+
2908
+ }
2909
+ ;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/dist/index.js??ruleSet[0]!./src/webgl/compass/Compass.vue?vue&type=script&setup=true&lang=js
2910
+
2911
+
2912
+
2913
+
2914
+ // 获取组件传参
2915
+
2916
+ const Compassvue_type_script_setup_true_lang_js_default_ = {
2917
+ name: "Kq3dCompass"
2918
+ };
2919
+ /* harmony default export */ var Compassvue_type_script_setup_true_lang_js = (/*#__PURE__*/Object.assign(Compassvue_type_script_setup_true_lang_js_default_, {
2920
+ props: {
2921
+ mapTarget: String,
2922
+ // 按钮图标大小
2923
+ iconSize: {
2924
+ type: Number,
2925
+ default: 16
2926
+ },
2927
+ // 按钮大小
2928
+ buttonSize: {
2929
+ type: String,
2930
+ default: "32px"
2931
+ }
2932
+ },
2933
+
2934
+ setup(__props) {
2935
+ const props = __props;
2936
+ let language = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)({});
2937
+ let viewModel = null;
2938
+ let heading = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)(0);
2939
+ (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.onMounted)(() => {
2940
+ gis_utils_namespaceObject.utils.getWebMap(null, scenceView => {
2941
+ if (scenceView) {
2942
+ language.value = scenceView._language;
2943
+ viewModel = new CompassViewModel(scenceView._viewer); //绑定指南针事件
2944
+
2945
+ viewModel.bindCompassEvent(heading);
2946
+ }
2947
+ });
2948
+ }); // 按钮点击事件
2949
+
2950
+ function btnClick(e) {
2951
+ viewModel && viewModel.resetOrientation();
2952
+ } // 销毁
2953
+
2954
+
2955
+ (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.onBeforeUnmount)(() => {
2956
+ viewModel && viewModel.destroy();
2957
+ });
2958
+ return (_ctx, _cache) => {
2959
+ const _component_kq_icon = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.resolveComponent)("kq-icon");
2960
+
2961
+ const _component_kq_button = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.resolveComponent)("kq-button");
2962
+
2963
+ return (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.openBlock)(), (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createBlock)(_component_kq_button, {
2964
+ onClick: btnClick,
2757
2965
  title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(language).resetOrientation,
2758
- class: "compass"
2966
+ style: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.normalizeStyle)('clip-path: circle(50%);width:' + __props.buttonSize)
2759
2967
  }, {
2760
2968
  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, {
2761
- size: 20,
2969
+ size: __props.iconSize,
2762
2970
  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)')
2763
2971
  }, {
2764
2972
  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)(client_icons_vue_namespaceObject.IconCompass3D))]),
@@ -2767,46 +2975,37 @@ const __default__ = {
2767
2975
 
2768
2976
  }, 8
2769
2977
  /* PROPS */
2770
- , ["style"])]),
2978
+ , ["size", "style"])]),
2771
2979
  _: 1
2772
2980
  /* STABLE */
2773
2981
 
2774
2982
  }, 8
2775
2983
  /* PROPS */
2776
- , ["title"])], 512
2777
- /* NEED_PATCH */
2778
- ), [[external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.vShow, __props.showToolButtons]])], 8
2779
- /* PROPS */
2780
- , _hoisted_2)]);
2984
+ , ["title", "style"]);
2781
2985
  };
2782
2986
  }
2783
2987
 
2784
2988
  }));
2785
- ;// CONCATENATED MODULE: ./src/webgl/scenceview/ScenceView.vue?vue&type=script&setup=true&lang=js
2989
+ ;// CONCATENATED MODULE: ./src/webgl/compass/Compass.vue?vue&type=script&setup=true&lang=js
2786
2990
 
2787
- ;// CONCATENATED MODULE: ./src/webgl/scenceview/ScenceView.vue
2991
+ ;// CONCATENATED MODULE: ./src/webgl/compass/Compass.vue
2788
2992
 
2789
2993
 
2790
2994
 
2791
- const __exports__ = ScenceViewvue_type_script_setup_true_lang_js;
2995
+ const Compass_exports_ = Compassvue_type_script_setup_true_lang_js;
2792
2996
 
2793
- /* harmony default export */ var ScenceView = (__exports__);
2794
- ;// CONCATENATED MODULE: external "@kq_npm/client_common_vue/init.js"
2795
- var init_js_namespaceObject = require("@kq_npm/client_common_vue/init.js");
2796
- var init_js_default = /*#__PURE__*/__webpack_require__.n(init_js_namespaceObject);
2797
- ;// CONCATENATED MODULE: ./src/webgl/scenceview/index.js
2997
+ /* harmony default export */ var Compass = (Compass_exports_);
2998
+ ;// CONCATENATED MODULE: ./src/webgl/compass/index.js
2798
2999
 
2799
3000
 
2800
3001
 
2801
3002
 
2802
- ScenceView.install = (Vue, opts) => {
3003
+ Compass.install = (Vue, opts) => {
2803
3004
  init_js_default()(Vue, opts);
2804
- Vue.component(ScenceView.name, ScenceView);
3005
+ Vue.component(Compass.name, Compass);
2805
3006
  };
2806
3007
 
2807
3008
 
2808
- ;// CONCATENATED MODULE: external "@kq_npm/client_common_vue/_utils/gis-utils"
2809
- var gis_utils_namespaceObject = require("@kq_npm/client_common_vue/_utils/gis-utils");
2810
3009
  ;// CONCATENATED MODULE: ./src/webgl/baseterraingallery/BaseterrainGalleryViewModel.js
2811
3010
 
2812
3011
  //地形淹没分析逻辑类
@@ -2885,7 +3084,7 @@ const BaseterrainGalleryvue_type_script_setup_true_lang_js_hoisted_1 = {
2885
3084
  const BaseterrainGalleryvue_type_script_setup_true_lang_js_hoisted_2 = {
2886
3085
  class: "divSpan"
2887
3086
  };
2888
- const BaseterrainGalleryvue_type_script_setup_true_lang_js_hoisted_3 = ["src"];
3087
+ const _hoisted_3 = ["src"];
2889
3088
  const _hoisted_4 = ["src"];
2890
3089
  const _hoisted_5 = ["src"];
2891
3090
 
@@ -2999,7 +3198,7 @@ const BaseterrainGalleryvue_type_script_setup_true_lang_js_default_ = {
2999
3198
  alt: ""
3000
3199
  }, null, 8
3001
3200
  /* PROPS */
3002
- , BaseterrainGalleryvue_type_script_setup_true_lang_js_hoisted_3)]),
3201
+ , _hoisted_3)]),
3003
3202
  _: 1
3004
3203
  /* STABLE */
3005
3204
 
@@ -20717,6 +20916,13 @@ Underground.install = (Vue, opts) => {
20717
20916
  * LastEditors: 朱鹏超
20718
20917
  */
20719
20918
 
20919
+ // 三维地图快捷工具
20920
+
20921
+
20922
+
20923
+
20924
+
20925
+
20720
20926
  // 在线地形
20721
20927
 
20722
20928
 
@@ -20795,6 +21001,9 @@ const webglComponents = {
20795
21001
  Kq3dHawkeye: Hawkeye,
20796
21002
  Kq3dRoller: Roller,
20797
21003
  Kq3dScreenShot: Screenshot,
21004
+ Kq3dFixedZoom: FixedZoom,
21005
+ Kq3dResetView: ResetView,
21006
+ Kq3dCompass: Compass,
20798
21007
  kq3dUnderground: Underground
20799
21008
  }; // 全局引入
20800
21009