@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/compass/index.js +243 -0
- package/fixedzoom/index.js +262 -0
- package/index.js +433 -224
- package/package.json +1 -1
- package/resetview/index.js +196 -0
- package/roller/style/roller.css +1 -1
- package/scenceview/index.js +2 -262
- package/style.css +1 -1
package/compass/index.js
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
/******/ (function() { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ // The require scope
|
|
4
|
+
/******/ var __webpack_require__ = {};
|
|
5
|
+
/******/
|
|
6
|
+
/************************************************************************/
|
|
7
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
8
|
+
/******/ !function() {
|
|
9
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
10
|
+
/******/ __webpack_require__.n = function(module) {
|
|
11
|
+
/******/ var getter = module && module.__esModule ?
|
|
12
|
+
/******/ function() { return module['default']; } :
|
|
13
|
+
/******/ function() { return module; };
|
|
14
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
15
|
+
/******/ return getter;
|
|
16
|
+
/******/ };
|
|
17
|
+
/******/ }();
|
|
18
|
+
/******/
|
|
19
|
+
/******/ /* webpack/runtime/define property getters */
|
|
20
|
+
/******/ !function() {
|
|
21
|
+
/******/ // define getter functions for harmony exports
|
|
22
|
+
/******/ __webpack_require__.d = function(exports, definition) {
|
|
23
|
+
/******/ for(var key in definition) {
|
|
24
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
25
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
26
|
+
/******/ }
|
|
27
|
+
/******/ }
|
|
28
|
+
/******/ };
|
|
29
|
+
/******/ }();
|
|
30
|
+
/******/
|
|
31
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
32
|
+
/******/ !function() {
|
|
33
|
+
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
|
34
|
+
/******/ }();
|
|
35
|
+
/******/
|
|
36
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
37
|
+
/******/ !function() {
|
|
38
|
+
/******/ // define __esModule on exports
|
|
39
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
40
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
41
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
42
|
+
/******/ }
|
|
43
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
44
|
+
/******/ };
|
|
45
|
+
/******/ }();
|
|
46
|
+
/******/
|
|
47
|
+
/************************************************************************/
|
|
48
|
+
var __webpack_exports__ = {};
|
|
49
|
+
// ESM COMPAT FLAG
|
|
50
|
+
__webpack_require__.r(__webpack_exports__);
|
|
51
|
+
|
|
52
|
+
// EXPORTS
|
|
53
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
54
|
+
"CompassViewModel": function() { return /* reexport */ CompassViewModel; },
|
|
55
|
+
"default": function() { return /* reexport */ Compass; }
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
;// CONCATENATED MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
|
|
59
|
+
var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject = require("vue");
|
|
60
|
+
;// CONCATENATED MODULE: external "@kq_npm/client_icons_vue"
|
|
61
|
+
var client_icons_vue_namespaceObject = require("@kq_npm/client_icons_vue");
|
|
62
|
+
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
63
|
+
function _defineProperty(obj, key, value) {
|
|
64
|
+
if (key in obj) {
|
|
65
|
+
Object.defineProperty(obj, key, {
|
|
66
|
+
value: value,
|
|
67
|
+
enumerable: true,
|
|
68
|
+
configurable: true,
|
|
69
|
+
writable: true
|
|
70
|
+
});
|
|
71
|
+
} else {
|
|
72
|
+
obj[key] = value;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return obj;
|
|
76
|
+
}
|
|
77
|
+
;// CONCATENATED MODULE: ./src/webgl/compass/CompassViewModel.js
|
|
78
|
+
|
|
79
|
+
// 重置视图
|
|
80
|
+
class CompassViewModel {
|
|
81
|
+
constructor(viewer) {
|
|
82
|
+
_defineProperty(this, "_viewer", null);
|
|
83
|
+
|
|
84
|
+
this._viewer = viewer;
|
|
85
|
+
} //重置方向
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
resetOrientation() {
|
|
89
|
+
var camera = this._viewer.camera;
|
|
90
|
+
var scene = this._viewer.scene;
|
|
91
|
+
var depthTestAgainstTerrain = scene.globe.depthTestAgainstTerrain;
|
|
92
|
+
|
|
93
|
+
if (!depthTestAgainstTerrain) {
|
|
94
|
+
scene.globe.depthTestAgainstTerrain = true;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
var canvas = scene.canvas;
|
|
98
|
+
var windowCenter = new Cesium.Cartesian2(canvas.clientWidth / 2, canvas.clientHeight / 2);
|
|
99
|
+
setTimeout(() => {
|
|
100
|
+
var center = scene.pickPosition(windowCenter);
|
|
101
|
+
|
|
102
|
+
if (!center) {
|
|
103
|
+
center = scene.camera.pickEllipsoid(windowCenter, scene.globe.ellipsoid);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
scene.globe.depthTestAgainstTerrain = depthTestAgainstTerrain;
|
|
107
|
+
var distance = Cesium.Cartesian3.distance(center, camera.positionWC);
|
|
108
|
+
var heading = 6.28319;
|
|
109
|
+
var pitch = camera.pitch;
|
|
110
|
+
var hpr = new Cesium.HeadingPitchRange(heading, pitch, distance);
|
|
111
|
+
camera.lookAt(center, hpr);
|
|
112
|
+
camera.lookAtTransform(Cesium.Matrix4.IDENTITY);
|
|
113
|
+
}, 300);
|
|
114
|
+
} //绑定指南针
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
bindCompassEvent(heading) {
|
|
118
|
+
var camera = this._viewer.camera;
|
|
119
|
+
this._removeEventListener = camera.changed.addEventListener(function () {
|
|
120
|
+
heading.value = camera.heading;
|
|
121
|
+
});
|
|
122
|
+
} // 注销事件
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
destroy() {
|
|
126
|
+
if (this._removeEventListener) {
|
|
127
|
+
this._removeEventListener();
|
|
128
|
+
|
|
129
|
+
this._removeEventListener = null;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
this._viewer = null;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
}
|
|
136
|
+
;// CONCATENATED MODULE: external "@kq_npm/client_common_vue/_utils/gis-utils"
|
|
137
|
+
var gis_utils_namespaceObject = require("@kq_npm/client_common_vue/_utils/gis-utils");
|
|
138
|
+
;// 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
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
// 获取组件传参
|
|
144
|
+
|
|
145
|
+
const __default__ = {
|
|
146
|
+
name: "Kq3dCompass"
|
|
147
|
+
};
|
|
148
|
+
/* harmony default export */ var Compassvue_type_script_setup_true_lang_js = (/*#__PURE__*/Object.assign(__default__, {
|
|
149
|
+
props: {
|
|
150
|
+
mapTarget: String,
|
|
151
|
+
// 按钮图标大小
|
|
152
|
+
iconSize: {
|
|
153
|
+
type: Number,
|
|
154
|
+
default: 16
|
|
155
|
+
},
|
|
156
|
+
// 按钮大小
|
|
157
|
+
buttonSize: {
|
|
158
|
+
type: String,
|
|
159
|
+
default: "32px"
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
setup(__props) {
|
|
164
|
+
const props = __props;
|
|
165
|
+
let language = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)({});
|
|
166
|
+
let viewModel = null;
|
|
167
|
+
let heading = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)(0);
|
|
168
|
+
(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.onMounted)(() => {
|
|
169
|
+
gis_utils_namespaceObject.utils.getWebMap(null, scenceView => {
|
|
170
|
+
if (scenceView) {
|
|
171
|
+
language.value = scenceView._language;
|
|
172
|
+
viewModel = new CompassViewModel(scenceView._viewer); //绑定指南针事件
|
|
173
|
+
|
|
174
|
+
viewModel.bindCompassEvent(heading);
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}); // 按钮点击事件
|
|
178
|
+
|
|
179
|
+
function btnClick(e) {
|
|
180
|
+
viewModel && viewModel.resetOrientation();
|
|
181
|
+
} // 销毁
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.onBeforeUnmount)(() => {
|
|
185
|
+
viewModel && viewModel.destroy();
|
|
186
|
+
});
|
|
187
|
+
return (_ctx, _cache) => {
|
|
188
|
+
const _component_kq_icon = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.resolveComponent)("kq-icon");
|
|
189
|
+
|
|
190
|
+
const _component_kq_button = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.resolveComponent)("kq-button");
|
|
191
|
+
|
|
192
|
+
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, {
|
|
193
|
+
onClick: btnClick,
|
|
194
|
+
title: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.unref)(language).resetOrientation,
|
|
195
|
+
style: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.normalizeStyle)('clip-path: circle(50%);width:' + __props.buttonSize)
|
|
196
|
+
}, {
|
|
197
|
+
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, {
|
|
198
|
+
size: __props.iconSize,
|
|
199
|
+
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)')
|
|
200
|
+
}, {
|
|
201
|
+
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))]),
|
|
202
|
+
_: 1
|
|
203
|
+
/* STABLE */
|
|
204
|
+
|
|
205
|
+
}, 8
|
|
206
|
+
/* PROPS */
|
|
207
|
+
, ["size", "style"])]),
|
|
208
|
+
_: 1
|
|
209
|
+
/* STABLE */
|
|
210
|
+
|
|
211
|
+
}, 8
|
|
212
|
+
/* PROPS */
|
|
213
|
+
, ["title", "style"]);
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
}));
|
|
218
|
+
;// CONCATENATED MODULE: ./src/webgl/compass/Compass.vue?vue&type=script&setup=true&lang=js
|
|
219
|
+
|
|
220
|
+
;// CONCATENATED MODULE: ./src/webgl/compass/Compass.vue
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
|
|
224
|
+
const __exports__ = Compassvue_type_script_setup_true_lang_js;
|
|
225
|
+
|
|
226
|
+
/* harmony default export */ var Compass = (__exports__);
|
|
227
|
+
;// CONCATENATED MODULE: external "@kq_npm/client_common_vue/init.js"
|
|
228
|
+
var init_js_namespaceObject = require("@kq_npm/client_common_vue/init.js");
|
|
229
|
+
var init_js_default = /*#__PURE__*/__webpack_require__.n(init_js_namespaceObject);
|
|
230
|
+
;// CONCATENATED MODULE: ./src/webgl/compass/index.js
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
Compass.install = (Vue, opts) => {
|
|
236
|
+
init_js_default()(Vue, opts);
|
|
237
|
+
Vue.component(Compass.name, Compass);
|
|
238
|
+
};
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
module.exports = __webpack_exports__;
|
|
242
|
+
/******/ })()
|
|
243
|
+
;
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
/******/ (function() { // webpackBootstrap
|
|
2
|
+
/******/ "use strict";
|
|
3
|
+
/******/ // The require scope
|
|
4
|
+
/******/ var __webpack_require__ = {};
|
|
5
|
+
/******/
|
|
6
|
+
/************************************************************************/
|
|
7
|
+
/******/ /* webpack/runtime/compat get default export */
|
|
8
|
+
/******/ !function() {
|
|
9
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
10
|
+
/******/ __webpack_require__.n = function(module) {
|
|
11
|
+
/******/ var getter = module && module.__esModule ?
|
|
12
|
+
/******/ function() { return module['default']; } :
|
|
13
|
+
/******/ function() { return module; };
|
|
14
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
|
15
|
+
/******/ return getter;
|
|
16
|
+
/******/ };
|
|
17
|
+
/******/ }();
|
|
18
|
+
/******/
|
|
19
|
+
/******/ /* webpack/runtime/define property getters */
|
|
20
|
+
/******/ !function() {
|
|
21
|
+
/******/ // define getter functions for harmony exports
|
|
22
|
+
/******/ __webpack_require__.d = function(exports, definition) {
|
|
23
|
+
/******/ for(var key in definition) {
|
|
24
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
25
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
26
|
+
/******/ }
|
|
27
|
+
/******/ }
|
|
28
|
+
/******/ };
|
|
29
|
+
/******/ }();
|
|
30
|
+
/******/
|
|
31
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
32
|
+
/******/ !function() {
|
|
33
|
+
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
|
34
|
+
/******/ }();
|
|
35
|
+
/******/
|
|
36
|
+
/******/ /* webpack/runtime/make namespace object */
|
|
37
|
+
/******/ !function() {
|
|
38
|
+
/******/ // define __esModule on exports
|
|
39
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
40
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
41
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
42
|
+
/******/ }
|
|
43
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
44
|
+
/******/ };
|
|
45
|
+
/******/ }();
|
|
46
|
+
/******/
|
|
47
|
+
/************************************************************************/
|
|
48
|
+
var __webpack_exports__ = {};
|
|
49
|
+
// ESM COMPAT FLAG
|
|
50
|
+
__webpack_require__.r(__webpack_exports__);
|
|
51
|
+
|
|
52
|
+
// EXPORTS
|
|
53
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
54
|
+
"FixedZoomViewModel": function() { return /* reexport */ FixedZoomViewModel; },
|
|
55
|
+
"default": function() { return /* reexport */ FixedZoom; }
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
;// CONCATENATED MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
|
|
59
|
+
var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject = require("vue");
|
|
60
|
+
;// CONCATENATED MODULE: external "@element-plus/icons-vue"
|
|
61
|
+
var icons_vue_namespaceObject = require("@element-plus/icons-vue");
|
|
62
|
+
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
63
|
+
function _defineProperty(obj, key, value) {
|
|
64
|
+
if (key in obj) {
|
|
65
|
+
Object.defineProperty(obj, key, {
|
|
66
|
+
value: value,
|
|
67
|
+
enumerable: true,
|
|
68
|
+
configurable: true,
|
|
69
|
+
writable: true
|
|
70
|
+
});
|
|
71
|
+
} else {
|
|
72
|
+
obj[key] = value;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return obj;
|
|
76
|
+
}
|
|
77
|
+
;// CONCATENATED MODULE: ./src/webgl/fixedzoom/FixedZoomViewModel.js
|
|
78
|
+
|
|
79
|
+
// 三维固定缩放逻辑
|
|
80
|
+
class FixedZoomViewModel {
|
|
81
|
+
constructor(viewer) {
|
|
82
|
+
_defineProperty(this, "_viewer", null);
|
|
83
|
+
|
|
84
|
+
this._viewer = viewer;
|
|
85
|
+
} //获取相机焦点
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
getCameraFocus() {
|
|
89
|
+
if (!this._viewer) return;
|
|
90
|
+
var scene = this._viewer.scene;
|
|
91
|
+
var camera = scene.camera;
|
|
92
|
+
var rayScratch = new Cesium.Ray();
|
|
93
|
+
rayScratch.origin = camera.positionWC;
|
|
94
|
+
rayScratch.direction = camera.directionWC;
|
|
95
|
+
var result = new Cesium.Cartesian3();
|
|
96
|
+
result = scene.globe.pick(rayScratch, scene, result);
|
|
97
|
+
|
|
98
|
+
if (result) {
|
|
99
|
+
result = camera.worldToCameraCoordinatesPoint(result, result);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
return result;
|
|
103
|
+
} //地图缩放
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
zoom(scale) {
|
|
107
|
+
if (!this._viewer) return;
|
|
108
|
+
var scene = this._viewer.scene;
|
|
109
|
+
var camera = scene.camera;
|
|
110
|
+
var focus = this.getCameraFocus();
|
|
111
|
+
var orientation;
|
|
112
|
+
|
|
113
|
+
if (!focus) {
|
|
114
|
+
// Camera direction is not pointing at the globe, so use the ellipsoid horizon point as
|
|
115
|
+
// the focal point.
|
|
116
|
+
var ray = new Cesium.Ray(camera.worldToCameraCoordinatesPoint(scene.globe.ellipsoid.cartographicToCartesian(camera.positionCartographic)), camera.directionWC);
|
|
117
|
+
focus = Cesium.IntersectionTests.grazingAltitudeLocation(ray, scene.globe.ellipsoid);
|
|
118
|
+
orientation = {
|
|
119
|
+
heading: camera.heading,
|
|
120
|
+
pitch: camera.pitch,
|
|
121
|
+
roll: camera.roll
|
|
122
|
+
};
|
|
123
|
+
} else {
|
|
124
|
+
orientation = {
|
|
125
|
+
direction: camera.direction,
|
|
126
|
+
up: camera.up
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
var cartesian3Scratch = new Cesium.Cartesian3();
|
|
131
|
+
var direction = Cesium.Cartesian3.subtract(camera.position, focus, cartesian3Scratch);
|
|
132
|
+
var movementVector = Cesium.Cartesian3.multiplyByScalar(direction, scale, direction);
|
|
133
|
+
var endPosition = Cesium.Cartesian3.add(focus, movementVector, focus);
|
|
134
|
+
camera.flyTo({
|
|
135
|
+
destination: endPosition,
|
|
136
|
+
orientation: orientation,
|
|
137
|
+
duration: 0.5,
|
|
138
|
+
convert: false
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
}
|
|
143
|
+
;// CONCATENATED MODULE: external "@kq_npm/client_common_vue/_utils/gis-utils"
|
|
144
|
+
var gis_utils_namespaceObject = require("@kq_npm/client_common_vue/_utils/gis-utils");
|
|
145
|
+
;// 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
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
// 获取组件传参
|
|
151
|
+
|
|
152
|
+
const __default__ = {
|
|
153
|
+
name: "Kq3dFixedZoom"
|
|
154
|
+
};
|
|
155
|
+
/* harmony default export */ var FixedZoomvue_type_script_setup_true_lang_js = (/*#__PURE__*/Object.assign(__default__, {
|
|
156
|
+
props: {
|
|
157
|
+
mapTarget: String,
|
|
158
|
+
// 切换按钮是固定放大还是固定缩小,值:zoomIn 或 zoomOut
|
|
159
|
+
isZoomInOrOut: {
|
|
160
|
+
type: Boolean,
|
|
161
|
+
default: true
|
|
162
|
+
},
|
|
163
|
+
// 按钮图标大小
|
|
164
|
+
iconSize: {
|
|
165
|
+
type: Number,
|
|
166
|
+
default: 16
|
|
167
|
+
},
|
|
168
|
+
// 按钮大小
|
|
169
|
+
buttonSize: {
|
|
170
|
+
type: String,
|
|
171
|
+
default: "32px"
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
setup(__props) {
|
|
176
|
+
const props = __props;
|
|
177
|
+
let language = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)({});
|
|
178
|
+
let viewModel = null;
|
|
179
|
+
let btn = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.ref)(null);
|
|
180
|
+
(0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.onMounted)(() => {
|
|
181
|
+
gis_utils_namespaceObject.utils.getWebMap(null, scenceView => {
|
|
182
|
+
if (scenceView) {
|
|
183
|
+
language.value = scenceView._language;
|
|
184
|
+
viewModel = new FixedZoomViewModel(scenceView._viewer);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}); // 按钮点击事件
|
|
188
|
+
|
|
189
|
+
function btnClick() {
|
|
190
|
+
btn.value.$el.blur();
|
|
191
|
+
viewModel && viewModel.zoom(props.isZoomInOrOut ? 0.5 : 2);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
return (_ctx, _cache) => {
|
|
195
|
+
const _component_kq_icon = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.resolveComponent)("kq-icon");
|
|
196
|
+
|
|
197
|
+
const _component_kq_button = (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.resolveComponent)("kq-button");
|
|
198
|
+
|
|
199
|
+
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, {
|
|
200
|
+
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,
|
|
201
|
+
ref_key: "btn",
|
|
202
|
+
ref: btn,
|
|
203
|
+
onClick: btnClick,
|
|
204
|
+
style: (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.normalizeStyle)('width:' + __props.buttonSize)
|
|
205
|
+
}, {
|
|
206
|
+
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, {
|
|
207
|
+
key: 0,
|
|
208
|
+
size: __props.iconSize
|
|
209
|
+
}, {
|
|
210
|
+
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))]),
|
|
211
|
+
_: 1
|
|
212
|
+
/* STABLE */
|
|
213
|
+
|
|
214
|
+
}, 8
|
|
215
|
+
/* PROPS */
|
|
216
|
+
, ["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, {
|
|
217
|
+
key: 1,
|
|
218
|
+
size: __props.iconSize
|
|
219
|
+
}, {
|
|
220
|
+
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))]),
|
|
221
|
+
_: 1
|
|
222
|
+
/* STABLE */
|
|
223
|
+
|
|
224
|
+
}, 8
|
|
225
|
+
/* PROPS */
|
|
226
|
+
, ["size"])) : (0,external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_namespaceObject.createCommentVNode)("v-if", true)]),
|
|
227
|
+
_: 1
|
|
228
|
+
/* STABLE */
|
|
229
|
+
|
|
230
|
+
}, 8
|
|
231
|
+
/* PROPS */
|
|
232
|
+
, ["title", "style"]);
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
}));
|
|
237
|
+
;// CONCATENATED MODULE: ./src/webgl/fixedzoom/FixedZoom.vue?vue&type=script&setup=true&lang=js
|
|
238
|
+
|
|
239
|
+
;// CONCATENATED MODULE: ./src/webgl/fixedzoom/FixedZoom.vue
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
const __exports__ = FixedZoomvue_type_script_setup_true_lang_js;
|
|
244
|
+
|
|
245
|
+
/* harmony default export */ var FixedZoom = (__exports__);
|
|
246
|
+
;// CONCATENATED MODULE: external "@kq_npm/client_common_vue/init.js"
|
|
247
|
+
var init_js_namespaceObject = require("@kq_npm/client_common_vue/init.js");
|
|
248
|
+
var init_js_default = /*#__PURE__*/__webpack_require__.n(init_js_namespaceObject);
|
|
249
|
+
;// CONCATENATED MODULE: ./src/webgl/fixedzoom/index.js
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
FixedZoom.install = (Vue, opts) => {
|
|
255
|
+
init_js_default()(Vue, opts);
|
|
256
|
+
Vue.component(FixedZoom.name, FixedZoom);
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
module.exports = __webpack_exports__;
|
|
261
|
+
/******/ })()
|
|
262
|
+
;
|