mars3d-supermap 3.1.13 → 3.1.18

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  <p align="center">
3
- <img src="https://mars3d.cn/logo.png" width="300px" />
3
+ <img src="https://cdn.jsdelivr.net/gh/muyao1987/cdn/mars3d.cn/logo.png" width="300px" />
4
4
  </p>
5
5
  <p align="center">一款免费的三维地球客户端开发平台 :Mars3D</p>
6
6
  <p align="center">
@@ -0,0 +1,982 @@
1
+ /*!
2
+ * Mars3D平台插件,结合supermap超图库使用的功能插件
3
+ * 版本信息:v3.1.18, hash值: 7596fcf29d59e48b56ae
4
+ * 编译日期:2021-12-26 15:10:03
5
+ * 版权所有:Copyright by 火星科技 http://mars3d.cn
6
+ *
7
+ */
8
+ (function webpackUniversalModuleDefinition(root, factory) {
9
+ if(typeof exports === 'object' && typeof module === 'object')
10
+ module.exports = factory(require("mars3d"), require("mars3d-cesium"));
11
+ else if(typeof define === 'function' && define.amd)
12
+ define("mars3dSupermap", ["mars3d", "mars3d-cesium"], factory);
13
+ else if(typeof exports === 'object')
14
+ exports["mars3dSupermap"] = factory(require("mars3d"), require("mars3d-cesium"));
15
+ else
16
+ root["mars3dSupermap"] = factory(root["mars3d"], root["Cesium"]);
17
+ })(window, function(__WEBPACK_EXTERNAL_MODULE__0__, __WEBPACK_EXTERNAL_MODULE__1__) {
18
+ return /******/ (function(modules) { // webpackBootstrap
19
+ /******/ // The module cache
20
+ /******/ var installedModules = {};
21
+ /******/
22
+ /******/ // The require function
23
+ /******/ function __webpack_require__(moduleId) {
24
+ /******/
25
+ /******/ // Check if module is in cache
26
+ /******/ if(installedModules[moduleId]) {
27
+ /******/ return installedModules[moduleId].exports;
28
+ /******/ }
29
+ /******/ // Create a new module (and put it into the cache)
30
+ /******/ var module = installedModules[moduleId] = {
31
+ /******/ i: moduleId,
32
+ /******/ l: false,
33
+ /******/ exports: {}
34
+ /******/ };
35
+ /******/
36
+ /******/ // Execute the module function
37
+ /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
38
+ /******/
39
+ /******/ // Flag the module as loaded
40
+ /******/ module.l = true;
41
+ /******/
42
+ /******/ // Return the exports of the module
43
+ /******/ return module.exports;
44
+ /******/ }
45
+ /******/
46
+ /******/
47
+ /******/ // expose the modules object (__webpack_modules__)
48
+ /******/ __webpack_require__.m = modules;
49
+ /******/
50
+ /******/ // expose the module cache
51
+ /******/ __webpack_require__.c = installedModules;
52
+ /******/
53
+ /******/ // define getter function for harmony exports
54
+ /******/ __webpack_require__.d = function(exports, name, getter) {
55
+ /******/ if(!__webpack_require__.o(exports, name)) {
56
+ /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
57
+ /******/ }
58
+ /******/ };
59
+ /******/
60
+ /******/ // define __esModule on exports
61
+ /******/ __webpack_require__.r = function(exports) {
62
+ /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
63
+ /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
64
+ /******/ }
65
+ /******/ Object.defineProperty(exports, '__esModule', { value: true });
66
+ /******/ };
67
+ /******/
68
+ /******/ // create a fake namespace object
69
+ /******/ // mode & 1: value is a module id, require it
70
+ /******/ // mode & 2: merge all properties of value into the ns
71
+ /******/ // mode & 4: return value when already ns object
72
+ /******/ // mode & 8|1: behave like require
73
+ /******/ __webpack_require__.t = function(value, mode) {
74
+ /******/ if(mode & 1) value = __webpack_require__(value);
75
+ /******/ if(mode & 8) return value;
76
+ /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
77
+ /******/ var ns = Object.create(null);
78
+ /******/ __webpack_require__.r(ns);
79
+ /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
80
+ /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
81
+ /******/ return ns;
82
+ /******/ };
83
+ /******/
84
+ /******/ // getDefaultExport function for compatibility with non-harmony modules
85
+ /******/ __webpack_require__.n = function(module) {
86
+ /******/ var getter = module && module.__esModule ?
87
+ /******/ function getDefault() { return module['default']; } :
88
+ /******/ function getModuleExports() { return module; };
89
+ /******/ __webpack_require__.d(getter, 'a', getter);
90
+ /******/ return getter;
91
+ /******/ };
92
+ /******/
93
+ /******/ // Object.prototype.hasOwnProperty.call
94
+ /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
95
+ /******/
96
+ /******/ // __webpack_public_path__
97
+ /******/ __webpack_require__.p = "";
98
+ /******/
99
+ /******/
100
+ /******/ // Load entry module and return exports
101
+ /******/ return __webpack_require__(__webpack_require__.s = 13);
102
+ /******/ })
103
+ /************************************************************************/
104
+ /******/ ([
105
+ /* 0 */
106
+ /***/ (function(module, exports) {
107
+
108
+ module.exports = __WEBPACK_EXTERNAL_MODULE__0__;
109
+
110
+ /***/ }),
111
+ /* 1 */
112
+ /***/ (function(module, exports) {
113
+
114
+ module.exports = __WEBPACK_EXTERNAL_MODULE__1__;
115
+
116
+ /***/ }),
117
+ /* 2 */
118
+ /***/ (function(module, exports) {
119
+
120
+ function _getPrototypeOf(o) {
121
+ module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
122
+ return o.__proto__ || Object.getPrototypeOf(o);
123
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports;
124
+ return _getPrototypeOf(o);
125
+ }
126
+
127
+ module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
128
+
129
+ /***/ }),
130
+ /* 3 */
131
+ /***/ (function(module, exports) {
132
+
133
+ function _classCallCheck(instance, Constructor) {
134
+ if (!(instance instanceof Constructor)) {
135
+ throw new TypeError("Cannot call a class as a function");
136
+ }
137
+ }
138
+
139
+ module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
140
+
141
+ /***/ }),
142
+ /* 4 */
143
+ /***/ (function(module, exports) {
144
+
145
+ function _defineProperties(target, props) {
146
+ for (var i = 0; i < props.length; i++) {
147
+ var descriptor = props[i];
148
+ descriptor.enumerable = descriptor.enumerable || false;
149
+ descriptor.configurable = true;
150
+ if ("value" in descriptor) descriptor.writable = true;
151
+ Object.defineProperty(target, descriptor.key, descriptor);
152
+ }
153
+ }
154
+
155
+ function _createClass(Constructor, protoProps, staticProps) {
156
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
157
+ if (staticProps) _defineProperties(Constructor, staticProps);
158
+ Object.defineProperty(Constructor, "prototype", {
159
+ writable: false
160
+ });
161
+ return Constructor;
162
+ }
163
+
164
+ module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
165
+
166
+ /***/ }),
167
+ /* 5 */
168
+ /***/ (function(module, exports, __webpack_require__) {
169
+
170
+ var setPrototypeOf = __webpack_require__(9);
171
+
172
+ function _inherits(subClass, superClass) {
173
+ if (typeof superClass !== "function" && superClass !== null) {
174
+ throw new TypeError("Super expression must either be null or a function");
175
+ }
176
+
177
+ Object.defineProperty(subClass, "prototype", {
178
+ value: Object.create(superClass && superClass.prototype, {
179
+ constructor: {
180
+ value: subClass,
181
+ writable: true,
182
+ configurable: true
183
+ }
184
+ }),
185
+ writable: false
186
+ });
187
+ if (superClass) setPrototypeOf(subClass, superClass);
188
+ }
189
+
190
+ module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
191
+
192
+ /***/ }),
193
+ /* 6 */
194
+ /***/ (function(module, exports, __webpack_require__) {
195
+
196
+ var _typeof = __webpack_require__(10)["default"];
197
+
198
+ var assertThisInitialized = __webpack_require__(11);
199
+
200
+ function _possibleConstructorReturn(self, call) {
201
+ if (call && (_typeof(call) === "object" || typeof call === "function")) {
202
+ return call;
203
+ } else if (call !== void 0) {
204
+ throw new TypeError("Derived constructors may only return object or undefined");
205
+ }
206
+
207
+ return assertThisInitialized(self);
208
+ }
209
+
210
+ module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
211
+
212
+ /***/ }),
213
+ /* 7 */
214
+ /***/ (function(module, exports, __webpack_require__) {
215
+
216
+ var superPropBase = __webpack_require__(12);
217
+
218
+ function _get() {
219
+ if (typeof Reflect !== "undefined" && Reflect.get) {
220
+ module.exports = _get = Reflect.get, module.exports.__esModule = true, module.exports["default"] = module.exports;
221
+ } else {
222
+ module.exports = _get = function _get(target, property, receiver) {
223
+ var base = superPropBase(target, property);
224
+ if (!base) return;
225
+ var desc = Object.getOwnPropertyDescriptor(base, property);
226
+
227
+ if (desc.get) {
228
+ return desc.get.call(arguments.length < 3 ? target : receiver);
229
+ }
230
+
231
+ return desc.value;
232
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports;
233
+ }
234
+
235
+ return _get.apply(this, arguments);
236
+ }
237
+
238
+ module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports;
239
+
240
+ /***/ }),
241
+ /* 8 */
242
+ /***/ (function(module, exports) {
243
+
244
+ function _defineProperty(obj, key, value) {
245
+ if (key in obj) {
246
+ Object.defineProperty(obj, key, {
247
+ value: value,
248
+ enumerable: true,
249
+ configurable: true,
250
+ writable: true
251
+ });
252
+ } else {
253
+ obj[key] = value;
254
+ }
255
+
256
+ return obj;
257
+ }
258
+
259
+ module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
260
+
261
+ /***/ }),
262
+ /* 9 */
263
+ /***/ (function(module, exports) {
264
+
265
+ function _setPrototypeOf(o, p) {
266
+ module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
267
+ o.__proto__ = p;
268
+ return o;
269
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports;
270
+ return _setPrototypeOf(o, p);
271
+ }
272
+
273
+ module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
274
+
275
+ /***/ }),
276
+ /* 10 */
277
+ /***/ (function(module, exports) {
278
+
279
+ function _typeof(obj) {
280
+ "@babel/helpers - typeof";
281
+
282
+ return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
283
+ return typeof obj;
284
+ } : function (obj) {
285
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
286
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
287
+ }
288
+
289
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
290
+
291
+ /***/ }),
292
+ /* 11 */
293
+ /***/ (function(module, exports) {
294
+
295
+ function _assertThisInitialized(self) {
296
+ if (self === void 0) {
297
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
298
+ }
299
+
300
+ return self;
301
+ }
302
+
303
+ module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
304
+
305
+ /***/ }),
306
+ /* 12 */
307
+ /***/ (function(module, exports, __webpack_require__) {
308
+
309
+ var getPrototypeOf = __webpack_require__(2);
310
+
311
+ function _superPropBase(object, property) {
312
+ while (!Object.prototype.hasOwnProperty.call(object, property)) {
313
+ object = getPrototypeOf(object);
314
+ if (object === null) break;
315
+ }
316
+
317
+ return object;
318
+ }
319
+
320
+ module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports;
321
+
322
+ /***/ }),
323
+ /* 13 */
324
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
325
+
326
+ "use strict";
327
+ // ESM COMPAT FLAG
328
+ __webpack_require__.r(__webpack_exports__);
329
+
330
+ // EXPORTS
331
+ __webpack_require__.d(__webpack_exports__, "S3MLayer", function() { return /* reexport */ S3MLayer_S3MLayer; });
332
+ __webpack_require__.d(__webpack_exports__, "SmImgLayer", function() { return /* reexport */ SmImgLayer_SmImgLayer; });
333
+ __webpack_require__.d(__webpack_exports__, "SmMvtLayer", function() { return /* reexport */ SmMvtLayer_SmMvtLayer; });
334
+
335
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/classCallCheck.js
336
+ var classCallCheck = __webpack_require__(3);
337
+ var classCallCheck_default = /*#__PURE__*/__webpack_require__.n(classCallCheck);
338
+
339
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/createClass.js
340
+ var createClass = __webpack_require__(4);
341
+ var createClass_default = /*#__PURE__*/__webpack_require__.n(createClass);
342
+
343
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/inherits.js
344
+ var inherits = __webpack_require__(5);
345
+ var inherits_default = /*#__PURE__*/__webpack_require__.n(inherits);
346
+
347
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js
348
+ var possibleConstructorReturn = __webpack_require__(6);
349
+ var possibleConstructorReturn_default = /*#__PURE__*/__webpack_require__.n(possibleConstructorReturn);
350
+
351
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/getPrototypeOf.js
352
+ var getPrototypeOf = __webpack_require__(2);
353
+ var getPrototypeOf_default = /*#__PURE__*/__webpack_require__.n(getPrototypeOf);
354
+
355
+ // EXTERNAL MODULE: external {"commonjs2":"mars3d-cesium","amd":"mars3d-cesium","commonjs":"mars3d-cesium","root":"Cesium"}
356
+ var external_commonjs2_mars3d_cesium_amd_mars3d_cesium_commonjs_mars3d_cesium_root_Cesium_ = __webpack_require__(1);
357
+
358
+ // EXTERNAL MODULE: external "mars3d"
359
+ var external_mars3d_ = __webpack_require__(0);
360
+
361
+ // CONCATENATED MODULE: ./src/supermap/S3MLayer.js
362
+
363
+
364
+
365
+
366
+
367
+
368
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; }
369
+
370
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
371
+
372
+
373
+
374
+ var BaseLayer = external_mars3d_["layer"].BaseLayer;
375
+ /**
376
+ * 超图S3M三维模型图层,
377
+ * 【需要引入 mars3d-supermap 插件库】
378
+ *
379
+ * @param {Object} options 参数对象,包括以下:
380
+ * @param {String} options.url supermap的S3M服务地址,示例:"url": "http://www.supermapol.com/realspace/services/3D-Olympic/rest/realspace"
381
+ * @param {String} [options.layername] 指定图层名称,未指定时,打开iserver场景服务下所有图层
382
+ * @param {String} [options.sceneName] 工作空间中有多个场景,需要指定场景名称;设置为undefined,默认打开第一个
383
+ * @param {Object} [options.s3mOptions] [S3M支持的参数]{@link http://support.supermap.com.cn:8090/webgl/docs/Documentation/S3MTilesLayer.html?classFilter=S3MTilesLayer} ,示例: {"selectEnabled":false},
384
+ * @param {Object} [options.position] 模型新的中心点位置(移动模型)
385
+ * @param {Number} options.position.alt 获取或设置底部高程。(单位:米)
386
+ *
387
+ * @param {String|Number} [options.id = uuid()] 图层id标识
388
+ * @param {String|Number} [options.pid = -1] 图层父级的id,一般图层管理中使用
389
+ * @param {String} [options.name = ''] 图层名称
390
+ * @param {Boolean} [options.show = true] 图层是否显示
391
+ * @param {BaseClass|Boolean} [options.eventParent] 指定的事件冒泡对象,默认为map对象,false时不冒泡
392
+ * @param {Object} [options.center] 图层自定义定位视角 {@link Map#setCameraView}
393
+ * @param {Number} options.center.lng 经度值, 180 - 180
394
+ * @param {Number} options.center.lat 纬度值, -90 - 90
395
+ * @param {Number} options.center.alt 高度值
396
+ * @param {Number} options.center.heading 方向角度值,绕垂直于地心的轴旋转角度, 0-360
397
+ * @param {Number} options.center.pitch 俯仰角度值,绕纬度线旋转角度, 0-360
398
+ * @param {Number} options.center.roll 翻滚角度值,绕经度线旋转角度, 0-360
399
+ * @param {Boolean} [options.flyTo] 加载完成数据后是否自动飞行定位到数据所在的区域。
400
+ * @export
401
+ * @class S3MLayer
402
+ * @extends {BaseLayer}
403
+ */
404
+
405
+ var S3MLayer_S3MLayer = /*#__PURE__*/function (_BaseLayer) {
406
+ inherits_default()(S3MLayer, _BaseLayer);
407
+
408
+ var _super = _createSuper(S3MLayer);
409
+
410
+ function S3MLayer() {
411
+ classCallCheck_default()(this, S3MLayer);
412
+
413
+ return _super.apply(this, arguments);
414
+ }
415
+
416
+ createClass_default()(S3MLayer, [{
417
+ key: "layer",
418
+ get:
419
+ /**
420
+ * 模型对应的Cesium.S3MTilesLayer图层组
421
+ * @type {Object[]}
422
+ * @readonly
423
+ * @see http://support.supermap.com.cn:8090/webgl/docs/Documentation/S3MTilesLayer.html
424
+ */
425
+ function get() {
426
+ return this._layerArr;
427
+ }
428
+ /**
429
+ * 设置S3M图层本身支持的参数
430
+ * @type {Object}
431
+ * @see [S3M支持的参数]{@link http://support.supermap.com.cn:8090/webgl/docs/Documentation/S3MTilesLayer.html?classFilter=S3MTilesLayer}
432
+ */
433
+
434
+ }, {
435
+ key: "s3mOptions",
436
+ get: function get() {
437
+ return this.options.s3mOptions;
438
+ },
439
+ set: function set(value) {
440
+ for (var key in value) {
441
+ var val = value[key];
442
+ this.options.s3mOptions[key] = val;
443
+
444
+ if (key == "transparentBackColor") {
445
+ //去黑边,与offset互斥,注意别配置offset
446
+ val = external_commonjs2_mars3d_cesium_amd_mars3d_cesium_commonjs_mars3d_cesium_root_Cesium_["Color"].fromCssColorString(val);
447
+ } else if (key == "transparentBackColorTolerance") {
448
+ val = Number(val);
449
+ }
450
+
451
+ for (var i = 0; i < this._layerArr.length; i++) {
452
+ var layer = this._layerArr[i];
453
+
454
+ if (layer == null) {
455
+ continue;
456
+ }
457
+
458
+ layer[key] = val;
459
+ }
460
+ }
461
+ }
462
+ /**
463
+ * 对象添加到地图前创建一些对象的钩子方法,
464
+ * 只会调用一次
465
+ * @return {void} 无
466
+ * @private
467
+ */
468
+
469
+ }, {
470
+ key: "_mountedHook",
471
+ value: function _mountedHook() {
472
+ var _this = this;
473
+
474
+ //场景添加S3M图层服务
475
+ var promise;
476
+
477
+ if (this.options.layername) {
478
+ promise = this._map.scene.addS3MTilesLayerByScp(this.options.url, {
479
+ name: this.options.layername,
480
+ autoSetVie: this.options.flyTo,
481
+ cullEnabled: this.options.cullEnabled
482
+ });
483
+ } else {
484
+ promise = this._map.scene.open(this.options.url, this.options.sceneName, {
485
+ autoSetVie: this.options.flyTo
486
+ });
487
+ }
488
+
489
+ external_commonjs2_mars3d_cesium_amd_mars3d_cesium_commonjs_mars3d_cesium_root_Cesium_["when"](promise, function (smLayer) {
490
+ if (Array.isArray(smLayer)) {
491
+ _this._layerArr = smLayer;
492
+ } else {
493
+ _this._layerArr = [smLayer];
494
+ } //设置图层属性
495
+
496
+
497
+ for (var i = 0; i < _this._layerArr.length; i++) {
498
+ var _this$options, _this$options$positio;
499
+
500
+ var layer = _this._layerArr[i];
501
+
502
+ if (layer == null) {
503
+ continue;
504
+ }
505
+
506
+ layer.isS3M = true; //标识下
507
+ //s3mOptions
508
+
509
+ if (_this.options.s3mOptions) {
510
+ for (var key in _this.options.s3mOptions) {
511
+ var val = _this.options.s3mOptions[key];
512
+
513
+ if (key == "transparentBackColor") {
514
+ //去黑边,与offset互斥,注意别配置offset
515
+ layer[key] = external_commonjs2_mars3d_cesium_amd_mars3d_cesium_commonjs_mars3d_cesium_root_Cesium_["Color"].fromCssColorString(val);
516
+ } else if (key == "transparentBackColorTolerance") {
517
+ layer[key] = Number(val);
518
+ } else {
519
+ layer[key] = _this.options.s3mOptions[key];
520
+ }
521
+ }
522
+ } //高度调整 offset.z
523
+
524
+
525
+ if ((_this$options = _this.options) !== null && _this$options !== void 0 && (_this$options$positio = _this$options.position) !== null && _this$options$positio !== void 0 && _this$options$positio.alt) {
526
+ layer.style3D.bottomAltitude = _this.options.position.alt;
527
+ layer.refresh();
528
+ }
529
+ }
530
+
531
+ if (_this.options.flyTo) {
532
+ _this.flyToByAnimationEnd();
533
+ }
534
+
535
+ if (_this.options.dataUrl) {
536
+ for (var _i = 0; _i < _this._layerArr.length; _i++) {
537
+ var ql = _this._layerArr[_i]; //读取子图层信息,通过数组的方式返回子图层的名称以及子图层所包含的对象的IDs
538
+
539
+ ql.setQueryParameter({
540
+ url: _this.options.dataUrl,
541
+ dataSourceName: ql.name.split("@")[1],
542
+ dataSetName: ql.name.split("@")[0],
543
+ isMerge: true
544
+ }); //获取图层风格
545
+ //Note_GJ: rgba, 1为不透明,0为全透明。已经在模型中导入材质,所以这里的颜色不特别设置
546
+ //var style3D = new Cesium.Style3D();
547
+ // var color = Cesium.Color.fromCssColorString("#919191");//混泥土颜色 RGB(145, 145,145)
548
+ // style3D.fillForeColor = color;
549
+ // ql.style3D = style3D;
550
+ //设置后需刷新图层
551
+ // ql.refresh();
552
+
553
+ ql.selectEnabled = true;
554
+ }
555
+ }
556
+ }, function (error) {
557
+ _this.showError("渲染时发生错误,已停止渲染。", error);
558
+ });
559
+ }
560
+ /**
561
+ * 对象添加到地图上的创建钩子方法,
562
+ * 每次add时都会调用
563
+ * @return {void} 无
564
+ * @private
565
+ */
566
+
567
+ }, {
568
+ key: "_addedHook",
569
+ value: function _addedHook() {
570
+ for (var i in this._layerArr) {
571
+ this._layerArr[i].visible = true;
572
+ this._layerArr[i].show = true;
573
+ }
574
+ }
575
+ /**
576
+ * 对象从地图上移除的创建钩子方法,
577
+ * 每次remove时都会调用
578
+ * @return {void} 无
579
+ * @private
580
+ */
581
+
582
+ }, {
583
+ key: "_removedHook",
584
+ value: function _removedHook() {
585
+ if (this._layerArr) {
586
+ for (var i in this._layerArr) {
587
+ this._layerArr[i].visible = false;
588
+ this._layerArr[i].show = false;
589
+ }
590
+ }
591
+ }
592
+ /**
593
+ * 设置透明度
594
+ * @param {Number} value 透明度
595
+ * @return {void} 无
596
+ */
597
+
598
+ }, {
599
+ key: "setOpacity",
600
+ value: function setOpacity(value) {
601
+ if (this._layerArr) {
602
+ for (var i = 0; i < this._layerArr.length; i++) {
603
+ var item = this._layerArr[i];
604
+
605
+ if (item == null) {
606
+ continue;
607
+ }
608
+
609
+ item.style3D.fillForeColor.alpha = value;
610
+ }
611
+ }
612
+ } //定位至数据区域
613
+
614
+ }, {
615
+ key: "flyTo",
616
+ value: function flyTo() {
617
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
618
+
619
+ if (this.options.center) {
620
+ this._map.setCameraView(this.options.center, options);
621
+ } else if (this.options.extent) {
622
+ this._map.flyToExtent(this.options.extent, options);
623
+ }
624
+ }
625
+ }]);
626
+
627
+ return S3MLayer;
628
+ }(BaseLayer);
629
+ external_mars3d_["layer"].S3MLayer = S3MLayer_S3MLayer; //注册下
630
+
631
+ external_mars3d_["LayerUtil"].register("supermap_s3m", S3MLayer_S3MLayer);
632
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/get.js
633
+ var get = __webpack_require__(7);
634
+ var get_default = /*#__PURE__*/__webpack_require__.n(get);
635
+
636
+ // CONCATENATED MODULE: ./src/supermap/SmImgLayer.js
637
+
638
+
639
+
640
+
641
+
642
+
643
+
644
+ function SmImgLayer_createSuper(Derived) { var hasNativeReflectConstruct = SmImgLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; }
645
+
646
+ function SmImgLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
647
+
648
+
649
+
650
+ var BaseTileLayer = external_mars3d_["layer"].BaseTileLayer;
651
+ /**
652
+ * 超图影像瓦片服务图层,
653
+ * 【需要引入 mars3d-supermap 插件库】
654
+ *
655
+ * @param {Object} options 参数对象,包括以下:
656
+ * @param {String} options.url supermap的影像服务地址
657
+ * @param {String|String[]} [options.subdomains] URL模板中用于 {s} 占位符的子域。 如果此参数是单个字符串,则字符串中的每个字符都是一个子域。如果是 一个数组,数组中的每个元素都是一个子域。
658
+ * @param {String} [options.tileFormat] 影像图片格式,默认为png。
659
+ * @param {Boolean} [options.transparent=true] 设置请求的地图服务的参数是否为transparent。
660
+ * @param {String|Cesium.Color} [options.transparentBackColor] 设置影像透明色。
661
+ * @param {Number} [options.transparentBackColorTolerance] 去黑边,设置影像透明色容限,取值范围为0.0~1.0。0.0表示完全透明,1.0表示完全不透明。
662
+ * @param {String} [options.cacheKey] 影像的三维缓存密钥。
663
+ *
664
+ * @param {Number} [options.minimumLevel=0] 瓦片所支持的最低层级,如果数据没有第0层,该参数必须配置,当地图小于该级别时,平台不去请求服务数据。
665
+ * @param {Number} [options.maximumLevel] 瓦片所支持的最大层级,大于该层级时会显示上一层拉伸后的瓦片,当地图大于该级别时,平台不去请求服务数据。
666
+ * @param {Number} [options.minimumTerrainLevel] 展示影像图层的最小地形细节级别,小于该级别时,平台不显示影像数据。
667
+ * @param {Number} [options.maximumTerrainLevel] 展示影像图层的最大地形细节级别,大于该级别时,平台不显示影像数据。
668
+ * @param {Object} [options.rectangle] 瓦片数据的矩形区域范围
669
+ * @param {Number} options.rectangle.xmin 最小经度值, -180 至 180
670
+ * @param {Number} options.rectangle.xmax 最大纬度值, -180 至 180
671
+ * @param {Number} options.rectangle.ymin 最小纬度值, -90 至 90
672
+ * @param {Number} options.rectangle.ymax 最大纬度值, -90 至 90
673
+ * @param {Number[]} options.bbox bbox规范的瓦片数据的矩形区域范围,与rectangle二选一即可。
674
+ * @param {Number} [options.zIndex] 控制图层的叠加层次,默认按加载的顺序进行叠加,但也可以自定义叠加顺序,数字大的在上面。
675
+ * @param {CRS} [options.crs=CRS.EPSG:3857] 瓦片数据的坐标系信息,默认为墨卡托投影
676
+ * @param {ChinaCRS} [options.chinaCRS] 标识瓦片的国内坐标系(用于自动纠偏或加偏),自动将瓦片转为map对应的chinaCRS类型坐标系。
677
+ *
678
+ * @param {String} [options.proxy] 加载资源时要使用的代理服务url。
679
+ * @param {Object} [options.templateValues] 一个对象,用于替换Url中的模板值的键/值对
680
+ * @param {Object} [options.queryParameters] 一个对象,其中包含在检索资源时将发送的查询参数。比如:queryParameters: {'access_token': '123-435-456-000'},
681
+ * @param {Object} [options.headers] 一个对象,将发送的其他HTTP标头。比如:headers: { 'X-My-Header': 'valueOfHeader' },
682
+ * @param {Boolean} [options.enablePickFeatures=true] 如果为true,则 {@link UrlTemplateImageryProvider#pickFeatures} 请求 pickFeaturesUrl 并尝试解释响应中包含的功能。
683
+ * 如果为 false{@link UrlTemplateImageryProvider#pickFeatures} 会立即返回未定义(表示没有可拾取的内容) 功能)而无需与服务器通信。如果您知道数据,则将此属性设置为false 源不支持选择功能,或者您不希望该提供程序的功能可供选择。注意 可以通过修改 {@link UriTemplateImageryProvider#enablePickFeatures}来动态覆盖 属性。
684
+ * @param {Cesium.GetFeatureInfoFormat[]} [options.getFeatureInfoFormats] 在某处获取功能信息的格式 调用 {@link UrlTemplateImageryProvider#pickFeatures} 的特定位置。如果这 参数未指定,功能选择已禁用。
685
+ *
686
+ * @param {Number} [options.opacity = 1.0] 透明度,取值范围:0.0-1.0。
687
+ * @param {Number|Function} [options.alpha=1.0] 同opacity。
688
+ * @param {Number|Function} [options.nightAlpha=1.0] 当 enableLighting 为 true 时 ,在地球的夜晚区域的透明度,取值范围:0.0-1.0。
689
+ * @param {Number|Function} [options.dayAlpha=1.0] 当 enableLighting 为 true 时,在地球的白天区域的透明度,取值范围:0.0-1.0。
690
+ * @param {Number|Function} [options.brightness=1.0] 亮度
691
+ * @param {Number|Function} [options.contrast=1.0] 对比度。 1.0使用未修改的图像颜色,小于1.0会降低对比度,而大于1.0则会提高对比度。
692
+ * @param {Number|Function} [options.hue=0.0] 色调。 0.0 时未修改的图像颜色。
693
+ * @param {Number|Function} [options.saturation=1.0] 饱和度。 1.0使用未修改的图像颜色,小于1.0会降低饱和度,而大于1.0则会增加饱和度。
694
+ * @param {Number|Function} [options.gamma=1.0] 伽马校正值。 1.0使用未修改的图像颜色。
695
+ * @param {Number} [options.maximumAnisotropy=maximum supported] 使用的最大各向异性水平 用于纹理过滤。如果未指定此参数,则支持最大各向异性 将使用WebGL堆栈。较大的值可使影像在水平方向上看起来更好 视图。
696
+ * @param {Cesium.Rectangle} [options.cutoutRectangle] 制图矩形,用于裁剪此ImageryLayer的一部分。
697
+ * @param {Cesium.Color} [options.colorToAlpha] 用作Alpha的颜色。
698
+ * @param {Number} [options.colorToAlphaThreshold=0.004] 颜色到Alpha的阈值。
699
+ * @param {Boolean} [options.hasAlphaChannel=true] 如果此图像提供者提供的图像为真 包括一个Alpha通道;否则为假。如果此属性为false,则为Alpha通道,如果 目前,将被忽略。如果此属性为true,则任何没有Alpha通道的图像都将 它们的alpha随处可见。当此属性为false时,内存使用情况 和纹理上传时间可能会减少。
700
+ * @param {Number} [options.tileWidth=256] 图像图块的像素宽度。
701
+ * @param {Number} [options.tileHeight=256] 图像图块的像素高度。
702
+ * @param {Object} [options.customTags] 允许替换网址模板中的自定义关键字。该对象必须具有字符串作为键,并且必须具有值。
703
+ *
704
+ * @param {String|Number} [options.id = uuid()] 图层id标识
705
+ * @param {String|Number} [options.pid = -1] 图层父级的id,一般图层管理中使用
706
+ * @param {String} [options.name = ''] 图层名称
707
+ * @param {Boolean} [options.show = true] 图层是否显示
708
+ * @param {BaseClass|Boolean} [options.eventParent] 指定的事件冒泡对象,默认为map对象,false时不冒泡
709
+ * @param {Object} [options.center] 图层自定义定位视角 {@link Map#setCameraView}
710
+ * @param {Number} options.center.lng 经度值, 180 - 180
711
+ * @param {Number} options.center.lat 纬度值, -90 - 90
712
+ * @param {Number} options.center.alt 高度值
713
+ * @param {Number} options.center.heading 方向角度值,绕垂直于地心的轴旋转角度, 0-360
714
+ * @param {Number} options.center.pitch 俯仰角度值,绕纬度线旋转角度, 0-360
715
+ * @param {Number} options.center.roll 翻滚角度值,绕经度线旋转角度, 0-360
716
+ * @param {Boolean} [options.flyTo] 加载完成数据后是否自动飞行定位到数据所在的区域。
717
+ * @export
718
+ * @class SmImgLayer
719
+ * @extends {BaseTileLayer}
720
+ *
721
+ * @see http://support.supermap.com.cn:8090/webgl/docs/Documentation/SuperMapImageryProvider.html?classFilter=SuperMapImageryProvider
722
+ */
723
+
724
+ var SmImgLayer_SmImgLayer = /*#__PURE__*/function (_BaseTileLayer) {
725
+ inherits_default()(SmImgLayer, _BaseTileLayer);
726
+
727
+ var _super = SmImgLayer_createSuper(SmImgLayer);
728
+
729
+ function SmImgLayer() {
730
+ classCallCheck_default()(this, SmImgLayer);
731
+
732
+ return _super.apply(this, arguments);
733
+ }
734
+
735
+ createClass_default()(SmImgLayer, [{
736
+ key: "_createImageryProvider",
737
+ value: //构建ImageryProvider
738
+ function _createImageryProvider(options) {
739
+ return createImageryProvider(options);
740
+ } //添加时
741
+
742
+ }, {
743
+ key: "_addedHook",
744
+ value: function _addedHook() {
745
+ get_default()(getPrototypeOf_default()(SmImgLayer.prototype), "_addedHook", this).call(this);
746
+
747
+ if (external_commonjs2_mars3d_cesium_amd_mars3d_cesium_commonjs_mars3d_cesium_root_Cesium_["defined"](this.options.transparentBackColor)) {
748
+ this._imageryLayer.transparentBackColor = external_mars3d_["Util"].getCesiumColor(this.options.transparentBackColor);
749
+ this._imageryLayer.transparentBackColorTolerance = this.options.transparentBackColorTolerance; //去黑边
750
+ }
751
+ }
752
+ }]);
753
+
754
+ return SmImgLayer;
755
+ }(BaseTileLayer);
756
+
757
+ function createImageryProvider(options) {
758
+ options = external_mars3d_["LayerUtil"].converOptions(options);
759
+ if (options.url instanceof external_commonjs2_mars3d_cesium_amd_mars3d_cesium_commonjs_mars3d_cesium_root_Cesium_["Resource"]) options.url = options.url.url;
760
+
761
+ if (external_commonjs2_mars3d_cesium_amd_mars3d_cesium_commonjs_mars3d_cesium_root_Cesium_["defined"](options.transparentBackColor)) {
762
+ delete options.transparentBackColor;
763
+ delete options.transparentBackColorTolerance;
764
+ }
765
+
766
+ return new external_commonjs2_mars3d_cesium_amd_mars3d_cesium_commonjs_mars3d_cesium_root_Cesium_["SuperMapImageryProvider"](options);
767
+ }
768
+ /**
769
+ * 创建用于图层的 ImageryProvider对象
770
+ *
771
+ * @param {Object} options Provider参数,同图层构造参数。
772
+ * @return {Cesium.ImageryProvider} ImageryProvider类
773
+ * @function
774
+ */
775
+
776
+
777
+ SmImgLayer_SmImgLayer.createImageryProvider = createImageryProvider;
778
+ external_mars3d_["layer"].SmImgLayer = SmImgLayer_SmImgLayer; //注册下
779
+
780
+ var layerType = "supermap_img";
781
+ external_mars3d_["LayerUtil"].register(layerType, SmImgLayer_SmImgLayer);
782
+ external_mars3d_["LayerUtil"].registerImageryProvider(layerType, createImageryProvider);
783
+ // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/defineProperty.js
784
+ var defineProperty = __webpack_require__(8);
785
+ var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty);
786
+
787
+ // CONCATENATED MODULE: ./src/supermap/SmMvtLayer.js
788
+
789
+
790
+
791
+
792
+
793
+
794
+
795
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
796
+
797
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { defineProperty_default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
798
+
799
+ function SmMvtLayer_createSuper(Derived) { var hasNativeReflectConstruct = SmMvtLayer_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = getPrototypeOf_default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = getPrototypeOf_default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return possibleConstructorReturn_default()(this, result); }; }
800
+
801
+ function SmMvtLayer_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
802
+
803
+
804
+
805
+ var SmMvtLayer_BaseLayer = external_mars3d_["layer"].BaseLayer;
806
+ /**
807
+ * 超图MVT矢量瓦片图层,
808
+ * 【需要引入 mars3d-supermap 插件库】
809
+ *
810
+ * @param {Object} options 参数对象,包括以下:
811
+ * @param {String} options.url 适用于通过SuperMap桌面软件生成mvt数据,经iServer发布为rest风格的地图服务,只需提供服务地址。
812
+ * @param {String} options.layer 图层名称,适用于第三方发布的WMTS服务。
813
+ * @param {Number} [options.canvasWidth] 用来绘制矢量的纹理边长。默认是512,越大越精细,越小性能越高。
814
+ * @param {String} [options.format='mvt'] 适用于第三方发布的WMTS服务。
815
+ * @param {Object} [options.mapboxStyle] 使用的mapBox风格。
816
+ * @param {Object} [options.其他] 参考[supermap官方API]{@link http://support.supermap.com.cn:8090/webgl/docs/Documentation/Scene.html#addVectorTilesLayer}
817
+ *
818
+ *
819
+ * @param {String|Number} [options.id = uuid()] 图层id标识
820
+ * @param {String|Number} [options.pid = -1] 图层父级的id,一般图层管理中使用
821
+ * @param {String} [options.name = ''] 图层名称
822
+ * @param {Boolean} [options.show = true] 图层是否显示
823
+ * @param {BaseClass|Boolean} [options.eventParent] 指定的事件冒泡对象,默认为map对象,false时不冒泡
824
+ * @param {Object} [options.center] 图层自定义定位视角 {@link Map#setCameraView}
825
+ * @param {Number} options.center.lng 经度值, 180 - 180
826
+ * @param {Number} options.center.lat 纬度值, -90 - 90
827
+ * @param {Number} options.center.alt 高度值
828
+ * @param {Number} options.center.heading 方向角度值,绕垂直于地心的轴旋转角度, 0-360
829
+ * @param {Number} options.center.pitch 俯仰角度值,绕纬度线旋转角度, 0-360
830
+ * @param {Number} options.center.roll 翻滚角度值,绕经度线旋转角度, 0-360
831
+ * @param {Boolean} [options.flyTo] 加载完成数据后是否自动飞行定位到数据所在的区域。
832
+ * @export
833
+ * @class SmMvtLayer
834
+ * @extends {BaseLayer}
835
+ */
836
+
837
+ var SmMvtLayer_SmMvtLayer = /*#__PURE__*/function (_BaseLayer) {
838
+ inherits_default()(SmMvtLayer, _BaseLayer);
839
+
840
+ var _super = SmMvtLayer_createSuper(SmMvtLayer);
841
+
842
+ function SmMvtLayer() {
843
+ classCallCheck_default()(this, SmMvtLayer);
844
+
845
+ return _super.apply(this, arguments);
846
+ }
847
+
848
+ createClass_default()(SmMvtLayer, [{
849
+ key: "layer",
850
+ get:
851
+ /**
852
+ * 对应的supermap图层 Cesium.VectorTilesLayer
853
+ * @type {*}
854
+ * @readonly
855
+ * @see http://support.supermap.com.cn:8090/webgl/docs/Documentation/VectorTilesLayer.html
856
+ */
857
+ function get() {
858
+ return this._mvtLayer;
859
+ }
860
+ /**
861
+ * 对象添加到地图前创建一些对象的钩子方法,
862
+ * 只会调用一次
863
+ * @return {void} 无
864
+ * @private
865
+ */
866
+
867
+ }, {
868
+ key: "_mountedHook",
869
+ value: function _mountedHook() {
870
+ var _this = this;
871
+
872
+ //options参考API文档:http://support.supermap.com.cn:8090/webgl/docs/Documentation/Scene.html
873
+ this._mvtLayer = this._map.scene.addVectorTilesMap(this.options);
874
+ var layerReadyPromise = this._mvtLayer.readyPromise;
875
+ external_commonjs2_mars3d_cesium_amd_mars3d_cesium_commonjs_mars3d_cesium_root_Cesium_["when"](layerReadyPromise, function (data) {//setPaintProperty(layerId, name, value, options)
876
+ // for(var layerId in that.options.style){
877
+ // that._mvtLayer.setPaintProperty(layerId, "fill-color", "rgba(255,0,0,0.8)");
878
+ // }
879
+ }, function (error) {
880
+ _this.showError("渲染时发生错误,已停止渲染。", error);
881
+ });
882
+ var scene = this._map.scene;
883
+ var handler = new external_commonjs2_mars3d_cesium_amd_mars3d_cesium_commonjs_mars3d_cesium_root_Cesium_["ScreenSpaceEventHandler"](scene.canvas);
884
+ handler.setInputAction(function (event) {
885
+ if (!_this.show) {
886
+ return;
887
+ }
888
+
889
+ var position = external_mars3d_["PointUtil"].getCurrentMousePosition(scene, event.position); //查询出相交图层的feature
890
+
891
+ var features = _this._mvtLayer.queryRenderedFeatures([position], {// layers: [selectLayer.id]
892
+ });
893
+
894
+ var filter = features.reduce(function (memo, result) {
895
+ var attr = result.feature.properties;
896
+
897
+ if (!attr) {
898
+ return;
899
+ }
900
+
901
+ var content = external_mars3d_["Util"].getPopupForConfig(_this.options, attr);
902
+ var item = {
903
+ data: attr,
904
+ event: event
905
+ };
906
+
907
+ _this._map.openPopup(position, content, item);
908
+ }, ["in", "$id"]);
909
+ }, external_commonjs2_mars3d_cesium_amd_mars3d_cesium_commonjs_mars3d_cesium_root_Cesium_["ScreenSpaceEventType"].LEFT_CLICK);
910
+ this.handler = handler;
911
+ }
912
+ /**
913
+ * 对象添加到地图上的创建钩子方法,
914
+ * 每次add时都会调用
915
+ * @return {void} 无
916
+ * @private
917
+ */
918
+
919
+ }, {
920
+ key: "_addedHook",
921
+ value: function _addedHook() {
922
+ this._mvtLayer.show = true; // this._mvtLayer.refresh();
923
+ }
924
+ /**
925
+ * 对象从地图上移除的创建钩子方法,
926
+ * 每次remove时都会调用
927
+ * @return {void} 无
928
+ * @private
929
+ */
930
+
931
+ }, {
932
+ key: "_removedHook",
933
+ value: function _removedHook() {
934
+ if (this._mvtLayer) {
935
+ this._mvtLayer.show = false;
936
+ }
937
+ }
938
+ /**
939
+ * 设置透明度
940
+ * @param {Number} value 透明度
941
+ * @return {void} 无
942
+ */
943
+
944
+ }, {
945
+ key: "setOpacity",
946
+ value: function setOpacity(value) {
947
+ if (this._mvtLayer) {
948
+ this._mvtLayer.alpha = parseFloat(value);
949
+ }
950
+ } //定位至数据区域
951
+
952
+ }, {
953
+ key: "flyTo",
954
+ value: function flyTo() {
955
+ var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
956
+
957
+ if (this.options.center) {
958
+ this._map.setCameraView(this.options.center, options);
959
+ } else if (this.options.extent) {
960
+ this._map.flyToExtent(this.options.extent, options);
961
+ } else if (this._mvtLayer) {
962
+ this._map.camera.flyTo(_objectSpread(_objectSpread({}, options), {}, {
963
+ destination: this._mvtLayer.rectangle
964
+ }));
965
+ }
966
+ }
967
+ }]);
968
+
969
+ return SmMvtLayer;
970
+ }(SmMvtLayer_BaseLayer);
971
+ external_mars3d_["layer"].SmMvtLayer = SmMvtLayer_SmMvtLayer; //注册下
972
+
973
+ external_mars3d_["LayerUtil"].register("supermap_mvt", SmMvtLayer_SmMvtLayer);
974
+ // CONCATENATED MODULE: ./src/index.js
975
+
976
+
977
+
978
+
979
+ /***/ })
980
+ /******/ ]);
981
+ });
982
+ //# sourceMappingURL=mars3d-supermap-src.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["webpack://mars3dSupermap/webpack/universalModuleDefinition","webpack://mars3dSupermap/webpack/bootstrap","webpack://mars3dSupermap/external \"mars3d\"","webpack://mars3dSupermap/external {\"commonjs2\":\"mars3d-cesium\",\"amd\":\"mars3d-cesium\",\"commonjs\":\"mars3d-cesium\",\"root\":\"Cesium\"}","webpack://mars3dSupermap/./node_modules/@babel/runtime/helpers/getPrototypeOf.js","webpack://mars3dSupermap/./node_modules/@babel/runtime/helpers/classCallCheck.js","webpack://mars3dSupermap/./node_modules/@babel/runtime/helpers/createClass.js","webpack://mars3dSupermap/./node_modules/@babel/runtime/helpers/inherits.js","webpack://mars3dSupermap/./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","webpack://mars3dSupermap/./node_modules/@babel/runtime/helpers/get.js","webpack://mars3dSupermap/./node_modules/@babel/runtime/helpers/defineProperty.js","webpack://mars3dSupermap/./node_modules/@babel/runtime/helpers/setPrototypeOf.js","webpack://mars3dSupermap/./node_modules/@babel/runtime/helpers/typeof.js","webpack://mars3dSupermap/./node_modules/@babel/runtime/helpers/assertThisInitialized.js","webpack://mars3dSupermap/./node_modules/@babel/runtime/helpers/superPropBase.js","webpack://mars3dSupermap/./src/supermap/S3MLayer.js","webpack://mars3dSupermap/./src/supermap/SmImgLayer.js","webpack://mars3dSupermap/./src/supermap/SmMvtLayer.js","webpack://mars3dSupermap/./src/index.js"],"names":["BaseLayer","mars3d","S3MLayer","_layerArr","options","s3mOptions","value","key","val","Cesium","fromCssColorString","Number","i","length","layer","promise","layername","_map","scene","addS3MTilesLayerByScp","url","name","autoSetVie","flyTo","cullEnabled","open","sceneName","smLayer","Array","isArray","isS3M","position","alt","style3D","bottomAltitude","refresh","flyToByAnimationEnd","dataUrl","ql","setQueryParameter","dataSourceName","split","dataSetName","isMerge","selectEnabled","error","showError","visible","show","item","fillForeColor","alpha","center","setCameraView","extent","flyToExtent","register","BaseTileLayer","SmImgLayer","createImageryProvider","transparentBackColor","_imageryLayer","getCesiumColor","transparentBackColorTolerance","converOptions","layerType","registerImageryProvider","SmMvtLayer","_mvtLayer","addVectorTilesMap","layerReadyPromise","readyPromise","data","handler","canvas","setInputAction","event","getCurrentMousePosition","features","queryRenderedFeatures","filter","reduce","memo","result","attr","feature","properties","content","getPopupForConfig","openPopup","LEFT_CLICK","parseFloat","camera","destination","rectangle"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;QCVA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;AClFA,gD;;;;;;ACAA,gD;;;;;;ACAA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA,+G;;;;;;ACPA;AACA;AACA;AACA;AACA;;AAEA,+G;;;;;;ACNA;AACA,iBAAiB,kBAAkB;AACnC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA,4G;;;;;;ACnBA,qBAAqB,mBAAO,CAAC,CAAqB;;AAElD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;AACH;AACA;;AAEA,yG;;;;;;ACpBA,cAAc,mBAAO,CAAC,EAA+B;;AAErD,4BAA4B,mBAAO,CAAC,EAA4B;;AAEhE;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA,0H;;;;;;ACdA,oBAAoB,mBAAO,CAAC,EAAoB;;AAEhD;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,KAAK;AACL;;AAEA;AACA;;AAEA,oG;;;;;;ACtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;AACH;AACA;;AAEA;AACA;;AAEA,+G;;;;;;ACfA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA,+G;;;;;;ACRA;AACA;;AAEA;AACA;AACA,GAAG;AACH;A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,aAAKnC,IAAL,CAAUoC,aAAV,CAAwB,KAAKjD,OAAL,CAAagD,MAArC,EAA6ChD,OAA7C;AACD,OAFD,MAEO,IAAI,KAAKA,OAAL,CAAakD,MAAjB,EAAyB;AAC9B,aAAKrC,IAAL,CAAUsC,WAAV,CAAsB,KAAKnD,OAAL,CAAakD,MAAnC,EAA2ClD,OAA3C;AACD,OAFM,MAEA,IAAI,KAAKgE,SAAT,EAAoB;AACzB,aAAKnD,IAAL,CAAU2E,MAAV,CAAiBrE,KAAjB,iCACKnB,OADL;AAEEyF,qBAAW,EAAE,KAAKzB,SAAL,CAAe0B;AAF9B;AAID;AACF;AApHH;;AAAA;AAAA,EAAgC9F,oBAAhC;AAsHAC,yBAAA,CAAakE,UAAb,GAA0BA,qBAA1B,C,CAEA;;AACAlE,6BAAA,CAAiBuD,QAAjB,CAA0B,cAA1B,EAA0CW,qBAA1C,E;;AC5JA;AACA","file":"mars3d-supermap-src.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"mars3d\"), require(\"mars3d-cesium\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"mars3dSupermap\", [\"mars3d\", \"mars3d-cesium\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"mars3dSupermap\"] = factory(require(\"mars3d\"), require(\"mars3d-cesium\"));\n\telse\n\t\troot[\"mars3dSupermap\"] = factory(root[\"mars3d\"], root[\"Cesium\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__0__, __WEBPACK_EXTERNAL_MODULE__1__) {\nreturn "," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 13);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","module.exports = __WEBPACK_EXTERNAL_MODULE__1__;","function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var setPrototypeOf = require(\"./setPrototypeOf.js\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n Object.defineProperty(subClass, \"prototype\", {\n value: Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n }),\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var _typeof = require(\"@babel/runtime/helpers/typeof\")[\"default\"];\n\nvar assertThisInitialized = require(\"./assertThisInitialized.js\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var superPropBase = require(\"./superPropBase.js\");\n\nfunction _get() {\n if (typeof Reflect !== \"undefined\" && Reflect.get) {\n module.exports = _get = Reflect.get, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n } else {\n module.exports = _get = function _get(target, property, receiver) {\n var base = superPropBase(target, property);\n if (!base) return;\n var desc = Object.getOwnPropertyDescriptor(base, property);\n\n if (desc.get) {\n return desc.get.call(arguments.length < 3 ? target : receiver);\n }\n\n return desc.value;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n }\n\n return _get.apply(this, arguments);\n}\n\nmodule.exports = _get, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\n\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","var getPrototypeOf = require(\"./getPrototypeOf.js\");\n\nfunction _superPropBase(object, property) {\n while (!Object.prototype.hasOwnProperty.call(object, property)) {\n object = getPrototypeOf(object);\n if (object === null) break;\n }\n\n return object;\n}\n\nmodule.exports = _superPropBase, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","import * as Cesium from \"cesium\";\nimport * as mars3d from \"mars3d\";\n\nlet BaseLayer = mars3d.layer.BaseLayer;\n\n/**\n * 超图S3M三维模型图层,\n * 【需要引入 mars3d-supermap 插件库】\n *\n * @param {Object} options 参数对象,包括以下:\n * @param {String} options.url supermap的S3M服务地址,示例:\"url\": \"http://www.supermapol.com/realspace/services/3D-Olympic/rest/realspace\"\n * @param {String} [options.layername] 指定图层名称,未指定时,打开iserver场景服务下所有图层\n * @param {String} [options.sceneName] 工作空间中有多个场景,需要指定场景名称;设置为undefined,默认打开第一个\n * @param {Object} [options.s3mOptions] [S3M支持的参数]{@link http://support.supermap.com.cn:8090/webgl/docs/Documentation/S3MTilesLayer.html?classFilter=S3MTilesLayer} ,示例: {\"selectEnabled\":false},\n * @param {Object} [options.position] 模型新的中心点位置(移动模型)\n * @param {Number} options.position.alt 获取或设置底部高程。(单位:米)\n *\n * @param {String|Number} [options.id = uuid()] 图层id标识\n * @param {String|Number} [options.pid = -1] 图层父级的id,一般图层管理中使用\n * @param {String} [options.name = ''] 图层名称\n * @param {Boolean} [options.show = true] 图层是否显示\n * @param {BaseClass|Boolean} [options.eventParent] 指定的事件冒泡对象,默认为map对象,false时不冒泡\n * @param {Object} [options.center] 图层自定义定位视角 {@link Map#setCameraView}\n * @param {Number} options.center.lng 经度值, 180 - 180\n * @param {Number} options.center.lat 纬度值, -90 - 90\n * @param {Number} options.center.alt 高度值\n * @param {Number} options.center.heading 方向角度值,绕垂直于地心的轴旋转角度, 0-360\n * @param {Number} options.center.pitch 俯仰角度值,绕纬度线旋转角度, 0-360\n * @param {Number} options.center.roll 翻滚角度值,绕经度线旋转角度, 0-360\n * @param {Boolean} [options.flyTo] 加载完成数据后是否自动飞行定位到数据所在的区域。\n * @export\n * @class S3MLayer\n * @extends {BaseLayer}\n */\nexport class S3MLayer extends BaseLayer {\n /**\n * 模型对应的Cesium.S3MTilesLayer图层组\n * @type {Object[]}\n * @readonly\n * @see http://support.supermap.com.cn:8090/webgl/docs/Documentation/S3MTilesLayer.html\n */\n get layer() {\n return this._layerArr;\n }\n\n /**\n * 设置S3M图层本身支持的参数\n * @type {Object}\n * @see [S3M支持的参数]{@link http://support.supermap.com.cn:8090/webgl/docs/Documentation/S3MTilesLayer.html?classFilter=S3MTilesLayer}\n */\n get s3mOptions() {\n return this.options.s3mOptions;\n }\n set s3mOptions(value) {\n for (let key in value) {\n let val = value[key];\n this.options.s3mOptions[key] = val;\n\n if (key == \"transparentBackColor\") {\n //去黑边,与offset互斥,注意别配置offset\n val = Cesium.Color.fromCssColorString(val);\n } else if (key == \"transparentBackColorTolerance\") {\n val = Number(val);\n }\n\n for (let i = 0; i < this._layerArr.length; i++) {\n let layer = this._layerArr[i];\n if (layer == null) {\n continue;\n }\n layer[key] = val;\n }\n }\n }\n\n /**\n * 对象添加到地图前创建一些对象的钩子方法,\n * 只会调用一次\n * @return {void} 无\n * @private\n */\n _mountedHook() {\n //场景添加S3M图层服务\n let promise;\n if (this.options.layername) {\n promise = this._map.scene.addS3MTilesLayerByScp(this.options.url, {\n name: this.options.layername,\n autoSetVie: this.options.flyTo,\n cullEnabled: this.options.cullEnabled,\n });\n } else {\n promise = this._map.scene.open(this.options.url, this.options.sceneName, {\n autoSetVie: this.options.flyTo,\n });\n }\n\n Cesium.when(\n promise,\n (smLayer) => {\n if (Array.isArray(smLayer)) {\n this._layerArr = smLayer;\n } else {\n this._layerArr = [smLayer];\n }\n\n //设置图层属性\n for (let i = 0; i < this._layerArr.length; i++) {\n let layer = this._layerArr[i];\n if (layer == null) {\n continue;\n }\n\n layer.isS3M = true; //标识下\n\n //s3mOptions\n if (this.options.s3mOptions) {\n for (let key in this.options.s3mOptions) {\n let val = this.options.s3mOptions[key];\n if (key == \"transparentBackColor\") {\n //去黑边,与offset互斥,注意别配置offset\n layer[key] = Cesium.Color.fromCssColorString(val);\n } else if (key == \"transparentBackColorTolerance\") {\n layer[key] = Number(val);\n } else {\n layer[key] = this.options.s3mOptions[key];\n }\n }\n }\n\n //高度调整 offset.z\n if (this.options?.position?.alt) {\n layer.style3D.bottomAltitude = this.options.position.alt;\n layer.refresh();\n }\n }\n\n if (this.options.flyTo) {\n this.flyToByAnimationEnd();\n }\n\n if (this.options.dataUrl) {\n for (let i = 0; i < this._layerArr.length; i++) {\n let ql = this._layerArr[i];\n\n //读取子图层信息,通过数组的方式返回子图层的名称以及子图层所包含的对象的IDs\n ql.setQueryParameter({\n url: this.options.dataUrl,\n dataSourceName: ql.name.split(\"@\")[1],\n dataSetName: ql.name.split(\"@\")[0],\n isMerge: true,\n });\n\n //获取图层风格\n //Note_GJ: rgba, 1为不透明,0为全透明。已经在模型中导入材质,所以这里的颜色不特别设置\n //var style3D = new Cesium.Style3D();\n // var color = Cesium.Color.fromCssColorString(\"#919191\");//混泥土颜色 RGB(145, 145,145)\n // style3D.fillForeColor = color;\n // ql.style3D = style3D;\n //设置后需刷新图层\n // ql.refresh();\n ql.selectEnabled = true;\n }\n }\n },\n (error) => {\n this.showError(\"渲染时发生错误,已停止渲染。\", error);\n }\n );\n }\n\n /**\n * 对象添加到地图上的创建钩子方法,\n * 每次add时都会调用\n * @return {void} 无\n * @private\n */\n _addedHook() {\n for (let i in this._layerArr) {\n this._layerArr[i].visible = true;\n this._layerArr[i].show = true;\n }\n }\n\n /**\n * 对象从地图上移除的创建钩子方法,\n * 每次remove时都会调用\n * @return {void} 无\n * @private\n */\n _removedHook() {\n if (this._layerArr) {\n for (let i in this._layerArr) {\n this._layerArr[i].visible = false;\n this._layerArr[i].show = false;\n }\n }\n }\n\n /**\n * 设置透明度\n * @param {Number} value 透明度\n * @return {void} 无\n */\n setOpacity(value) {\n if (this._layerArr) {\n for (let i = 0; i < this._layerArr.length; i++) {\n let item = this._layerArr[i];\n if (item == null) {\n continue;\n }\n\n item.style3D.fillForeColor.alpha = value;\n }\n }\n }\n\n //定位至数据区域\n flyTo(options = {}) {\n if (this.options.center) {\n this._map.setCameraView(this.options.center, options);\n } else if (this.options.extent) {\n this._map.flyToExtent(this.options.extent, options);\n }\n }\n}\nmars3d.layer.S3MLayer = S3MLayer;\n\n//注册下\nmars3d.LayerUtil.register(\"supermap_s3m\", S3MLayer);\n","import * as Cesium from \"cesium\";\nimport * as mars3d from \"mars3d\";\n\nlet BaseTileLayer = mars3d.layer.BaseTileLayer;\n\n/**\n * 超图影像瓦片服务图层,\n * 【需要引入 mars3d-supermap 插件库】\n *\n * @param {Object} options 参数对象,包括以下:\n * @param {String} options.url supermap的影像服务地址\n * @param {String|String[]} [options.subdomains] URL模板中用于 {s} 占位符的子域。 如果此参数是单个字符串,则字符串中的每个字符都是一个子域。如果是 一个数组,数组中的每个元素都是一个子域。\n * @param {String} [options.tileFormat] 影像图片格式,默认为png。\n * @param {Boolean} [options.transparent=true] 设置请求的地图服务的参数是否为transparent。\n * @param {String|Cesium.Color} [options.transparentBackColor] 设置影像透明色。\n * @param {Number} [options.transparentBackColorTolerance] 去黑边,设置影像透明色容限,取值范围为0.0~1.0。0.0表示完全透明,1.0表示完全不透明。\n * @param {String} [options.cacheKey] 影像的三维缓存密钥。\n *\n * @param {Number} [options.minimumLevel=0] 瓦片所支持的最低层级,如果数据没有第0层,该参数必须配置,当地图小于该级别时,平台不去请求服务数据。\n * @param {Number} [options.maximumLevel] 瓦片所支持的最大层级,大于该层级时会显示上一层拉伸后的瓦片,当地图大于该级别时,平台不去请求服务数据。\n * @param {Number} [options.minimumTerrainLevel] 展示影像图层的最小地形细节级别,小于该级别时,平台不显示影像数据。\n * @param {Number} [options.maximumTerrainLevel] 展示影像图层的最大地形细节级别,大于该级别时,平台不显示影像数据。\n * @param {Object} [options.rectangle] 瓦片数据的矩形区域范围\n * @param {Number} options.rectangle.xmin 最小经度值, -180 至 180\n * @param {Number} options.rectangle.xmax 最大纬度值, -180 至 180\n * @param {Number} options.rectangle.ymin 最小纬度值, -90 至 90\n * @param {Number} options.rectangle.ymax 最大纬度值, -90 至 90\n * @param {Number[]} options.bbox bbox规范的瓦片数据的矩形区域范围,与rectangle二选一即可。\n * @param {Number} [options.zIndex] 控制图层的叠加层次,默认按加载的顺序进行叠加,但也可以自定义叠加顺序,数字大的在上面。\n * @param {CRS} [options.crs=CRS.EPSG:3857] 瓦片数据的坐标系信息,默认为墨卡托投影\n * @param {ChinaCRS} [options.chinaCRS] 标识瓦片的国内坐标系(用于自动纠偏或加偏),自动将瓦片转为map对应的chinaCRS类型坐标系。\n *\n * @param {String} [options.proxy] 加载资源时要使用的代理服务url。\n * @param {Object} [options.templateValues] 一个对象,用于替换Url中的模板值的键/值对\n * @param {Object} [options.queryParameters] 一个对象,其中包含在检索资源时将发送的查询参数。比如:queryParameters: {'access_token': '123-435-456-000'},\n * @param {Object} [options.headers] 一个对象,将发送的其他HTTP标头。比如:headers: { 'X-My-Header': 'valueOfHeader' },\n * @param {Boolean} [options.enablePickFeatures=true] 如果为true,则 {@link UrlTemplateImageryProvider#pickFeatures} 请求 pickFeaturesUrl 并尝试解释响应中包含的功能。\n * 如果为 false{@link UrlTemplateImageryProvider#pickFeatures} 会立即返回未定义(表示没有可拾取的内容) 功能)而无需与服务器通信。如果您知道数据,则将此属性设置为false 源不支持选择功能,或者您不希望该提供程序的功能可供选择。注意 可以通过修改 {@link UriTemplateImageryProvider#enablePickFeatures}来动态覆盖 属性。\n * @param {Cesium.GetFeatureInfoFormat[]} [options.getFeatureInfoFormats] 在某处获取功能信息的格式 调用 {@link UrlTemplateImageryProvider#pickFeatures} 的特定位置。如果这 参数未指定,功能选择已禁用。\n *\n * @param {Number} [options.opacity = 1.0] 透明度,取值范围:0.0-1.0。\n * @param {Number|Function} [options.alpha=1.0] 同opacity。\n * @param {Number|Function} [options.nightAlpha=1.0] 当 enableLighting 为 true 时 ,在地球的夜晚区域的透明度,取值范围:0.0-1.0。\n * @param {Number|Function} [options.dayAlpha=1.0] 当 enableLighting 为 true 时,在地球的白天区域的透明度,取值范围:0.0-1.0。\n * @param {Number|Function} [options.brightness=1.0] 亮度\n * @param {Number|Function} [options.contrast=1.0] 对比度。 1.0使用未修改的图像颜色,小于1.0会降低对比度,而大于1.0则会提高对比度。\n * @param {Number|Function} [options.hue=0.0] 色调。 0.0 时未修改的图像颜色。\n * @param {Number|Function} [options.saturation=1.0] 饱和度。 1.0使用未修改的图像颜色,小于1.0会降低饱和度,而大于1.0则会增加饱和度。\n * @param {Number|Function} [options.gamma=1.0] 伽马校正值。 1.0使用未修改的图像颜色。\n * @param {Number} [options.maximumAnisotropy=maximum supported] 使用的最大各向异性水平 用于纹理过滤。如果未指定此参数,则支持最大各向异性 将使用WebGL堆栈。较大的值可使影像在水平方向上看起来更好 视图。\n * @param {Cesium.Rectangle} [options.cutoutRectangle] 制图矩形,用于裁剪此ImageryLayer的一部分。\n * @param {Cesium.Color} [options.colorToAlpha] 用作Alpha的颜色。\n * @param {Number} [options.colorToAlphaThreshold=0.004] 颜色到Alpha的阈值。\n * @param {Boolean} [options.hasAlphaChannel=true] 如果此图像提供者提供的图像为真 包括一个Alpha通道;否则为假。如果此属性为false,则为Alpha通道,如果 目前,将被忽略。如果此属性为true,则任何没有Alpha通道的图像都将 它们的alpha随处可见。当此属性为false时,内存使用情况 和纹理上传时间可能会减少。\n * @param {Number} [options.tileWidth=256] 图像图块的像素宽度。\n * @param {Number} [options.tileHeight=256] 图像图块的像素高度。\n * @param {Object} [options.customTags] 允许替换网址模板中的自定义关键字。该对象必须具有字符串作为键,并且必须具有值。\n *\n * @param {String|Number} [options.id = uuid()] 图层id标识\n * @param {String|Number} [options.pid = -1] 图层父级的id,一般图层管理中使用\n * @param {String} [options.name = ''] 图层名称\n * @param {Boolean} [options.show = true] 图层是否显示\n * @param {BaseClass|Boolean} [options.eventParent] 指定的事件冒泡对象,默认为map对象,false时不冒泡\n * @param {Object} [options.center] 图层自定义定位视角 {@link Map#setCameraView}\n * @param {Number} options.center.lng 经度值, 180 - 180\n * @param {Number} options.center.lat 纬度值, -90 - 90\n * @param {Number} options.center.alt 高度值\n * @param {Number} options.center.heading 方向角度值,绕垂直于地心的轴旋转角度, 0-360\n * @param {Number} options.center.pitch 俯仰角度值,绕纬度线旋转角度, 0-360\n * @param {Number} options.center.roll 翻滚角度值,绕经度线旋转角度, 0-360\n * @param {Boolean} [options.flyTo] 加载完成数据后是否自动飞行定位到数据所在的区域。\n * @export\n * @class SmImgLayer\n * @extends {BaseTileLayer}\n *\n * @see http://support.supermap.com.cn:8090/webgl/docs/Documentation/SuperMapImageryProvider.html?classFilter=SuperMapImageryProvider\n */\nexport class SmImgLayer extends BaseTileLayer {\n //构建ImageryProvider\n _createImageryProvider(options) {\n return createImageryProvider(options);\n }\n //添加时\n _addedHook() {\n super._addedHook();\n\n if (Cesium.defined(this.options.transparentBackColor)) {\n this._imageryLayer.transparentBackColor = mars3d.Util.getCesiumColor(this.options.transparentBackColor);\n this._imageryLayer.transparentBackColorTolerance = this.options.transparentBackColorTolerance; //去黑边\n }\n }\n}\nfunction createImageryProvider(options) {\n options = mars3d.LayerUtil.converOptions(options);\n\n if (options.url instanceof Cesium.Resource) options.url = options.url.url;\n\n if (Cesium.defined(options.transparentBackColor)) {\n delete options.transparentBackColor;\n delete options.transparentBackColorTolerance;\n }\n return new Cesium.SuperMapImageryProvider(options);\n}\n\n/**\n * 创建用于图层的 ImageryProvider对象\n *\n * @param {Object} options Provider参数,同图层构造参数。\n * @return {Cesium.ImageryProvider} ImageryProvider类\n * @function\n */\nSmImgLayer.createImageryProvider = createImageryProvider;\n\nmars3d.layer.SmImgLayer = SmImgLayer;\n\n//注册下\nconst layerType = \"supermap_img\";\nmars3d.LayerUtil.register(layerType, SmImgLayer);\nmars3d.LayerUtil.registerImageryProvider(layerType, createImageryProvider);\n","import * as Cesium from \"cesium\";\nimport * as mars3d from \"mars3d\";\n\nlet BaseLayer = mars3d.layer.BaseLayer;\n\n/**\n * 超图MVT矢量瓦片图层,\n * 【需要引入 mars3d-supermap 插件库】\n *\n * @param {Object} options 参数对象,包括以下:\n * @param {String} options.url 适用于通过SuperMap桌面软件生成mvt数据,经iServer发布为rest风格的地图服务,只需提供服务地址。\n * @param {String} options.layer 图层名称,适用于第三方发布的WMTS服务。\n * @param {Number} [options.canvasWidth] 用来绘制矢量的纹理边长。默认是512,越大越精细,越小性能越高。\n * @param {String} [options.format='mvt'] 适用于第三方发布的WMTS服务。\n * @param {Object} [options.mapboxStyle] 使用的mapBox风格。\n * @param {Object} [options.其他] 参考[supermap官方API]{@link http://support.supermap.com.cn:8090/webgl/docs/Documentation/Scene.html#addVectorTilesLayer}\n *\n *\n * @param {String|Number} [options.id = uuid()] 图层id标识\n * @param {String|Number} [options.pid = -1] 图层父级的id,一般图层管理中使用\n * @param {String} [options.name = ''] 图层名称\n * @param {Boolean} [options.show = true] 图层是否显示\n * @param {BaseClass|Boolean} [options.eventParent] 指定的事件冒泡对象,默认为map对象,false时不冒泡\n * @param {Object} [options.center] 图层自定义定位视角 {@link Map#setCameraView}\n * @param {Number} options.center.lng 经度值, 180 - 180\n * @param {Number} options.center.lat 纬度值, -90 - 90\n * @param {Number} options.center.alt 高度值\n * @param {Number} options.center.heading 方向角度值,绕垂直于地心的轴旋转角度, 0-360\n * @param {Number} options.center.pitch 俯仰角度值,绕纬度线旋转角度, 0-360\n * @param {Number} options.center.roll 翻滚角度值,绕经度线旋转角度, 0-360\n * @param {Boolean} [options.flyTo] 加载完成数据后是否自动飞行定位到数据所在的区域。\n * @export\n * @class SmMvtLayer\n * @extends {BaseLayer}\n */\nexport class SmMvtLayer extends BaseLayer {\n /**\n * 对应的supermap图层 Cesium.VectorTilesLayer\n * @type {*}\n * @readonly\n * @see http://support.supermap.com.cn:8090/webgl/docs/Documentation/VectorTilesLayer.html\n */\n get layer() {\n return this._mvtLayer;\n }\n\n /**\n * 对象添加到地图前创建一些对象的钩子方法,\n * 只会调用一次\n * @return {void} 无\n * @private\n */\n _mountedHook() {\n //options参考API文档:http://support.supermap.com.cn:8090/webgl/docs/Documentation/Scene.html\n this._mvtLayer = this._map.scene.addVectorTilesMap(this.options);\n let layerReadyPromise = this._mvtLayer.readyPromise;\n\n Cesium.when(\n layerReadyPromise,\n (data) => {\n //setPaintProperty(layerId, name, value, options)\n // for(var layerId in that.options.style){\n // that._mvtLayer.setPaintProperty(layerId, \"fill-color\", \"rgba(255,0,0,0.8)\");\n // }\n },\n (error) => {\n this.showError(\"渲染时发生错误,已停止渲染。\", error);\n }\n );\n\n let scene = this._map.scene;\n let handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);\n handler.setInputAction((event) => {\n if (!this.show) {\n return;\n }\n\n let position = mars3d.PointUtil.getCurrentMousePosition(scene, event.position);\n\n //查询出相交图层的feature\n let features = this._mvtLayer.queryRenderedFeatures([position], {\n // layers: [selectLayer.id]\n });\n\n let filter = features.reduce(\n (memo, result) => {\n let attr = result.feature.properties;\n if (!attr) {\n return;\n }\n\n let content = mars3d.Util.getPopupForConfig(this.options, attr);\n let item = {\n data: attr,\n event: event,\n };\n this._map.openPopup(position, content, item);\n },\n [\"in\", \"$id\"]\n );\n }, Cesium.ScreenSpaceEventType.LEFT_CLICK);\n\n this.handler = handler;\n }\n\n /**\n * 对象添加到地图上的创建钩子方法,\n * 每次add时都会调用\n * @return {void} 无\n * @private\n */\n _addedHook() {\n this._mvtLayer.show = true;\n // this._mvtLayer.refresh();\n }\n\n /**\n * 对象从地图上移除的创建钩子方法,\n * 每次remove时都会调用\n * @return {void} 无\n * @private\n */\n _removedHook() {\n if (this._mvtLayer) {\n this._mvtLayer.show = false;\n }\n }\n\n /**\n * 设置透明度\n * @param {Number} value 透明度\n * @return {void} 无\n */\n setOpacity(value) {\n if (this._mvtLayer) {\n this._mvtLayer.alpha = parseFloat(value);\n }\n }\n\n //定位至数据区域\n flyTo(options = {}) {\n if (this.options.center) {\n this._map.setCameraView(this.options.center, options);\n } else if (this.options.extent) {\n this._map.flyToExtent(this.options.extent, options);\n } else if (this._mvtLayer) {\n this._map.camera.flyTo({\n ...options,\n destination: this._mvtLayer.rectangle,\n });\n }\n }\n}\nmars3d.layer.SmMvtLayer = SmMvtLayer;\n\n//注册下\nmars3d.LayerUtil.register(\"supermap_mvt\", SmMvtLayer);\n","export { S3MLayer } from \"./supermap/S3MLayer\";\nexport { SmImgLayer } from \"./supermap/SmImgLayer\";\nexport { SmMvtLayer } from \"./supermap/SmMvtLayer\";\n"],"sourceRoot":""}
@@ -1,7 +1,7 @@
1
1
  /*!
2
2
  * Mars3D平台插件,结合supermap超图库使用的功能插件
3
- * 版本信息:v3.1.13
4
- * 编译日期:2021-11-21 14:08:54
3
+ * 版本信息:v3.1.18
4
+ * 编译日期:2021-12-26 15:10:08
5
5
  * 版权所有:Copyright by 火星科技 http://mars3d.cn
6
6
  */
7
7
  (function webpackUniversalModuleDefinition(window) {
@@ -28,12 +28,12 @@
28
28
 
29
29
  /*!
30
30
  * Mars3D平台插件,结合supermap超图库使用的功能插件
31
- * 版本信息:v3.1.13, hash值: 93382d1feb96b058e851
32
- * 编译日期:2021-11-21 14:08:54
31
+ * 版本信息:v3.1.18, hash值: c3b03b3f6c88330e0f46
32
+ * 编译日期:2021-12-26 15:10:08
33
33
  * 版权所有:Copyright by 火星科技 http://mars3d.cn
34
34
  *
35
35
  */
36
- window.mars3dSupermap=function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=13)}([function(e,t){e.exports=window.mars3d},function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.default=e.exports,e.exports.__esModule=!0,r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=window.Cesium},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}e.exports=function(e,t,o){return t&&r(e.prototype,t),o&&r(e,o),e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var o=r(9);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var o=r(10).default,n=r(11);e.exports=function(e,t){if(t&&("object"===o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return n(e)},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var o=r(12);function n(t,r,i){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=n=Reflect.get,e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=n=function(e,t,r){var n=o(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(r):i.value}},e.exports.default=e.exports,e.exports.__esModule=!0),n(t,r,i||t)}e.exports=n,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(t,o){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.default=e.exports,e.exports.__esModule=!0,r(t,o)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){function r(t){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?(e.exports=r=function(e){return typeof e},e.exports.default=e.exports,e.exports.__esModule=!0):(e.exports=r=function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.default=e.exports,e.exports.__esModule=!0),r(t)}e.exports=r,e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){var o=r(1);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=o(e)););return e},e.exports.default=e.exports,e.exports.__esModule=!0},function(e,t,r){"use strict";r.r(t),r.d(t,"S3MLayer",(function(){return v})),r.d(t,"SmImgLayer",(function(){return b})),r.d(t,"SmMvtLayer",(function(){return M}));var o=r(3),n=r.n(o),i=r(4),s=r.n(i),a=r(5),u=r.n(a),l=r(6),c=r.n(l),p=r(1),f=r.n(p),y=r(2),d=r(0);function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=f()(e);if(t){var n=f()(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return c()(this,r)}}var v=function(e){u()(r,e);var t=h(r);function r(){return n()(this,r),t.apply(this,arguments)}return s()(r,[{key:"layer",get:function(){return this._layerArr}},{key:"s3mOptions",get:function(){return this.options.s3mOptions},set:function(e){for(var t in e){var r=e[t];this.options.s3mOptions[t]=r,"transparentBackColor"==t?r=y.Color.fromCssColorString(r):"transparentBackColorTolerance"==t&&(r=Number(r));for(var o=0;o<this._layerArr.length;o++){var n=this._layerArr[o];null!=n&&(n[t]=r)}}}},{key:"_mountedHook",value:function(){var e,t=this;e=this.options.layername?this._map.scene.addS3MTilesLayerByScp(this.options.url,{name:this.options.layername,autoSetVie:this.options.flyTo,cullEnabled:this.options.cullEnabled}):this._map.scene.open(this.options.url,this.options.sceneName,{autoSetVie:this.options.flyTo}),y.when(e,(function(e){Array.isArray(e)?t._layerArr=e:t._layerArr=[e];for(var r=0;r<t._layerArr.length;r++){var o,n,i=t._layerArr[r];if(null!=i){if(i.isS3M=!0,t.options.s3mOptions)for(var s in t.options.s3mOptions){var a=t.options.s3mOptions[s];i[s]="transparentBackColor"==s?y.Color.fromCssColorString(a):"transparentBackColorTolerance"==s?Number(a):t.options.s3mOptions[s]}null!==(o=t.options)&&void 0!==o&&null!==(n=o.position)&&void 0!==n&&n.alt&&(i.style3D.bottomAltitude=t.options.position.alt,i.refresh())}}if(t.options.flyTo&&t.flyToByAnimationEnd(),t.options.dataUrl)for(var u=0;u<t._layerArr.length;u++){var l=t._layerArr[u];l.setQueryParameter({url:t.options.dataUrl,dataSourceName:l.name.split("@")[1],dataSetName:l.name.split("@")[0],isMerge:!0}),l.selectEnabled=!0}}),(function(e){t.showError("渲染时发生错误,已停止渲染。",e)}))}},{key:"_addedHook",value:function(){for(var e in this._layerArr)this._layerArr[e].visible=!0,this._layerArr[e].show=!0}},{key:"_removedHook",value:function(){if(this._layerArr)for(var e in this._layerArr)this._layerArr[e].visible=!1,this._layerArr[e].show=!1}},{key:"setOpacity",value:function(e){if(this._layerArr)for(var t=0;t<this._layerArr.length;t++){var r=this._layerArr[t];null!=r&&(r.style3D.fillForeColor.alpha=e)}}},{key:"flyTo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options.center?this._map.setCameraView(this.options.center,e):this.options.extent&&this._map.flyToExtent(this.options.extent,e)}}]),r}(d.layer.BaseLayer);d.layer.S3MLayer=v,d.LayerUtil.register("supermap_s3m",v);var _=r(7),m=r.n(_);function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=f()(e);if(t){var n=f()(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return c()(this,r)}}var b=function(e){u()(r,e);var t=x(r);function r(){return n()(this,r),t.apply(this,arguments)}return s()(r,[{key:"_createImageryProvider",value:function(e){return g(e)}},{key:"_addedHook",value:function(){m()(f()(r.prototype),"_addedHook",this).call(this),y.defined(this.options.transparentBackColorTolerance)&&(this._imageryLayer.transparentBackColorTolerance=this.options.transparentBackColorTolerance)}}]),r}(d.layer.BaseTileLayer);function g(e){return e=d.LayerUtil.converOptions(e),new y.SuperMapImageryProvider(e)}b.createImageryProvider=g,d.layer.SmImgLayer=b;d.LayerUtil.register("supermap_img",b),d.LayerUtil.registerImageryProvider("supermap_img",g);var O=r(8),w=r.n(O);function P(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function S(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?P(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):P(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function k(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=f()(e);if(t){var n=f()(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return c()(this,r)}}var M=function(e){u()(r,e);var t=k(r);function r(){return n()(this,r),t.apply(this,arguments)}return s()(r,[{key:"layer",get:function(){return this._mvtLayer}},{key:"_mountedHook",value:function(){var e=this;this._mvtLayer=this._map.scene.addVectorTilesMap(this.options);var t=this._mvtLayer.readyPromise;y.when(t,(function(e){}),(function(t){e.showError("渲染时发生错误,已停止渲染。",t)}));var r=this._map.scene,o=new y.ScreenSpaceEventHandler(r.canvas);o.setInputAction((function(t){if(e.show){var o=d.PointUtil.getCurrentMousePosition(r,t.position);e._mvtLayer.queryRenderedFeatures([o],{}).reduce((function(r,n){var i=n.feature.properties;if(i){var s=d.Util.getPopupForConfig(e.options,i),a={data:i,event:t};e._map.openPopup(o,s,a)}}),["in","$id"])}}),y.ScreenSpaceEventType.LEFT_CLICK),this.handler=o}},{key:"_addedHook",value:function(){this._mvtLayer.show=!0,this._mvtLayer.refresh()}},{key:"_removedHook",value:function(){this._mvtLayer&&(this._mvtLayer.show=!1)}},{key:"setOpacity",value:function(e){this._mvtLayer&&(this._mvtLayer.alpha=parseFloat(e))}},{key:"flyTo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options.center?this._map.setCameraView(this.options.center,e):this.options.extent?this._map.flyToExtent(this.options.extent,e):this._mvtLayer&&this._map.camera.flyTo(S(S({},e),{},{destination:this._mvtLayer.rectangle}))}}]),r}(d.layer.BaseLayer);d.layer.SmMvtLayer=M,d.LayerUtil.register("supermap_mvt",M)}]);
36
+ window.mars3dSupermap=function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=13)}([function(e,t){e.exports=window.mars3d},function(e,t){e.exports=window.Cesium},function(e,t){function r(t){return e.exports=r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function r(e,t){for(var r=0;r<t.length;r++){var o=t[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}e.exports=function(e,t,o){return t&&r(e.prototype,t),o&&r(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var o=r(9);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");Object.defineProperty(e,"prototype",{value:Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),writable:!1}),t&&o(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var o=r(10).default,n=r(11);e.exports=function(e,t){if(t&&("object"===o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var o=r(12);function n(){return"undefined"!=typeof Reflect&&Reflect.get?(e.exports=n=Reflect.get,e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=n=function(e,t,r){var n=o(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},e.exports.__esModule=!0,e.exports.default=e.exports),n.apply(this,arguments)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function r(t,o){return e.exports=r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,r(t,o)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){function r(t){return e.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var o=r(2);e.exports=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=o(e)););return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";r.r(t),r.d(t,"S3MLayer",(function(){return v})),r.d(t,"SmImgLayer",(function(){return b})),r.d(t,"SmMvtLayer",(function(){return j}));var o=r(3),n=r.n(o),i=r(4),a=r.n(i),s=r(5),u=r.n(s),l=r(6),c=r.n(l),p=r(2),f=r.n(p),y=r(1),d=r(0);function h(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=f()(e);if(t){var n=f()(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return c()(this,r)}}var v=function(e){u()(r,e);var t=h(r);function r(){return n()(this,r),t.apply(this,arguments)}return a()(r,[{key:"layer",get:function(){return this._layerArr}},{key:"s3mOptions",get:function(){return this.options.s3mOptions},set:function(e){for(var t in e){var r=e[t];this.options.s3mOptions[t]=r,"transparentBackColor"==t?r=y.Color.fromCssColorString(r):"transparentBackColorTolerance"==t&&(r=Number(r));for(var o=0;o<this._layerArr.length;o++){var n=this._layerArr[o];null!=n&&(n[t]=r)}}}},{key:"_mountedHook",value:function(){var e,t=this;e=this.options.layername?this._map.scene.addS3MTilesLayerByScp(this.options.url,{name:this.options.layername,autoSetVie:this.options.flyTo,cullEnabled:this.options.cullEnabled}):this._map.scene.open(this.options.url,this.options.sceneName,{autoSetVie:this.options.flyTo}),y.when(e,(function(e){Array.isArray(e)?t._layerArr=e:t._layerArr=[e];for(var r=0;r<t._layerArr.length;r++){var o,n,i=t._layerArr[r];if(null!=i){if(i.isS3M=!0,t.options.s3mOptions)for(var a in t.options.s3mOptions){var s=t.options.s3mOptions[a];i[a]="transparentBackColor"==a?y.Color.fromCssColorString(s):"transparentBackColorTolerance"==a?Number(s):t.options.s3mOptions[a]}null!==(o=t.options)&&void 0!==o&&null!==(n=o.position)&&void 0!==n&&n.alt&&(i.style3D.bottomAltitude=t.options.position.alt,i.refresh())}}if(t.options.flyTo&&t.flyToByAnimationEnd(),t.options.dataUrl)for(var u=0;u<t._layerArr.length;u++){var l=t._layerArr[u];l.setQueryParameter({url:t.options.dataUrl,dataSourceName:l.name.split("@")[1],dataSetName:l.name.split("@")[0],isMerge:!0}),l.selectEnabled=!0}}),(function(e){t.showError("渲染时发生错误,已停止渲染。",e)}))}},{key:"_addedHook",value:function(){for(var e in this._layerArr)this._layerArr[e].visible=!0,this._layerArr[e].show=!0}},{key:"_removedHook",value:function(){if(this._layerArr)for(var e in this._layerArr)this._layerArr[e].visible=!1,this._layerArr[e].show=!1}},{key:"setOpacity",value:function(e){if(this._layerArr)for(var t=0;t<this._layerArr.length;t++){var r=this._layerArr[t];null!=r&&(r.style3D.fillForeColor.alpha=e)}}},{key:"flyTo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options.center?this._map.setCameraView(this.options.center,e):this.options.extent&&this._map.flyToExtent(this.options.extent,e)}}]),r}(d.layer.BaseLayer);d.layer.S3MLayer=v,d.LayerUtil.register("supermap_s3m",v);var _=r(7),m=r.n(_);function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=f()(e);if(t){var n=f()(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return c()(this,r)}}var b=function(e){u()(r,e);var t=x(r);function r(){return n()(this,r),t.apply(this,arguments)}return a()(r,[{key:"_createImageryProvider",value:function(e){return g(e)}},{key:"_addedHook",value:function(){m()(f()(r.prototype),"_addedHook",this).call(this),y.defined(this.options.transparentBackColor)&&(this._imageryLayer.transparentBackColor=d.Util.getCesiumColor(this.options.transparentBackColor),this._imageryLayer.transparentBackColorTolerance=this.options.transparentBackColorTolerance)}}]),r}(d.layer.BaseTileLayer);function g(e){return(e=d.LayerUtil.converOptions(e)).url instanceof y.Resource&&(e.url=e.url.url),y.defined(e.transparentBackColor)&&(delete e.transparentBackColor,delete e.transparentBackColorTolerance),new y.SuperMapImageryProvider(e)}b.createImageryProvider=g,d.layer.SmImgLayer=b;d.LayerUtil.register("supermap_img",b),d.LayerUtil.registerImageryProvider("supermap_img",g);var O=r(8),w=r.n(O);function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,o)}return r}function P(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach((function(t){w()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function S(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,o=f()(e);if(t){var n=f()(this).constructor;r=Reflect.construct(o,arguments,n)}else r=o.apply(this,arguments);return c()(this,r)}}var j=function(e){u()(r,e);var t=S(r);function r(){return n()(this,r),t.apply(this,arguments)}return a()(r,[{key:"layer",get:function(){return this._mvtLayer}},{key:"_mountedHook",value:function(){var e=this;this._mvtLayer=this._map.scene.addVectorTilesMap(this.options);var t=this._mvtLayer.readyPromise;y.when(t,(function(e){}),(function(t){e.showError("渲染时发生错误,已停止渲染。",t)}));var r=this._map.scene,o=new y.ScreenSpaceEventHandler(r.canvas);o.setInputAction((function(t){if(e.show){var o=d.PointUtil.getCurrentMousePosition(r,t.position);e._mvtLayer.queryRenderedFeatures([o],{}).reduce((function(r,n){var i=n.feature.properties;if(i){var a=d.Util.getPopupForConfig(e.options,i),s={data:i,event:t};e._map.openPopup(o,a,s)}}),["in","$id"])}}),y.ScreenSpaceEventType.LEFT_CLICK),this.handler=o}},{key:"_addedHook",value:function(){this._mvtLayer.show=!0}},{key:"_removedHook",value:function(){this._mvtLayer&&(this._mvtLayer.show=!1)}},{key:"setOpacity",value:function(e){this._mvtLayer&&(this._mvtLayer.alpha=parseFloat(e))}},{key:"flyTo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options.center?this._map.setCameraView(this.options.center,e):this.options.extent?this._map.flyToExtent(this.options.extent,e):this._mvtLayer&&this._map.camera.flyTo(P(P({},e),{},{destination:this._mvtLayer.rectangle}))}}]),r}(d.layer.BaseLayer);d.layer.SmMvtLayer=j,d.LayerUtil.register("supermap_mvt",j)}]);
37
37
 
38
38
  })(window);
39
39
 
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "mars3d-supermap",
3
- "version": "3.1.13",
3
+ "version": "3.1.18",
4
4
  "description": "Mars3D平台插件,结合supermap超图库使用的功能插件",
5
5
  "main": "dist/mars3d-supermap.js",
6
+ "files": [
7
+ "dist"
8
+ ],
6
9
  "dependencies": {
7
- "mars3d": "^3.1.13",
8
- "mars3d-cesium": "^1.87.0"
10
+ "mars3d": "^3.1.18",
11
+ "mars3d-cesium": "^1.88.0"
9
12
  },
10
13
  "devDependencies": {},
11
14
  "scripts": {
package/index.html DELETED
@@ -1,115 +0,0 @@
1
- <!DOCTYPE html>
2
- <html class="no-js css-menubar" lang="zh-cn">
3
-
4
- <head>
5
- <title> Mars3D三维地球 supermap插件</title>
6
- <meta charset="utf-8">
7
- <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
8
- <!-- 移动设备 viewport -->
9
- <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no,minimal-ui">
10
- <meta name="author" content="火星科技 http://mars3d.cn ">
11
- <!-- 360浏览器默认使用Webkit内核 -->
12
- <meta name="renderer" content="webkit">
13
- <!-- Chrome浏览器添加桌面快捷方式(安卓) -->
14
- <link rel="icon" type="image/png" href="img/favicon/favicon.png">
15
- <meta name="mobile-web-app-capable" content="yes">
16
- <!-- Safari浏览器添加到主屏幕(IOS) -->
17
- <link rel="icon" sizes="192x192" href="img/favicon/apple-touch-icon.png">
18
- <meta name="apple-mobile-web-app-capable" content="yes">
19
- <meta name="apple-mobile-web-app-status-bar-style" content="black">
20
- <meta name="apple-mobile-web-app-title" content="火星科技 MarsGIS">
21
- <!-- Win8标题栏及ICON图标 -->
22
- <link rel="apple-touch-icon-precomposed" href="img/favicon/apple-touch-icon.png">
23
- <meta name="msapplication-TileImage" content="img/favicon/app-icon72x72@2x.png">
24
- <meta name="msapplication-TileColor" content="#62a8ea">
25
-
26
-
27
- <!--引入基础lib-->
28
- <link href="https://mars3d.cn/lib/Cesium-supermap/Widgets/widgets.css" rel="stylesheet" type="text/css" />
29
- <script src="https://mars3d.cn/lib/Cesium-supermap/Cesium.js" type="text/javascript"></script>
30
- <script type="text/javascript" src="http://mars3d.cn/lib/turf/turf.min.js"></script>
31
- <script type="text/javascript" src="http://mars3d.cn/lib/jquery/jquery-2.1.4.min.js"></script>
32
- <script type="text/javascript" src="http://mars3d.cn/lib/hao/haoutil.js"></script>
33
-
34
- <!--引入mars3d库lib-->
35
- <link href="https://mars3d.cn/lib/mars3d/mars3d.css" rel="stylesheet" type="text/css" />
36
- <script src="https://mars3d.cn/lib/mars3d/mars3d.js" type="text/javascript"></script>
37
-
38
- <script type="text/javascript" src="dist/mars3d-supermap.js"></script>
39
-
40
- <style>
41
- html,
42
- body {
43
- height: 100%;
44
- width: 100%;
45
- margin: 0;
46
- padding: 0;
47
- border: none;
48
- overflow: hidden;
49
- font-size: 14px;
50
- background: #000;
51
- }
52
- </style>
53
- </head>
54
-
55
- <body>
56
- <div id="mars3dContainer" class="mars3d-container"></div>
57
-
58
- <!--业务代码-->
59
- <script type="text/javascript">
60
- //判断webgl支持
61
- if (!mars3d.Util.webglreport()) {
62
- mars3d.Util.webglerror()
63
- }
64
-
65
- //读取 config.json 配置文件
66
- var configUrl = 'http://mars3d.cn/example/config/config.json'
67
- mars3d.Resource.fetchJson({ url: configUrl }).then(function (json) {
68
- initMap(json.map3d)//构建地图
69
- })
70
-
71
- var map
72
-
73
- //创建三维地球场景
74
- function initMap(options) {
75
- //合并属性参数,可覆盖config.json中的对应配置
76
- let mapOptions = mars3d.Util.merge(options, {
77
- basemaps: [
78
- {
79
- "pid": 10,
80
- "name": "超图底图",
81
- "type": "supermap_img",
82
- "icon": "img/basemaps/google_img.png",
83
- "url": "http://www.supermapol.com/realspace/services/map-China400/rest/maps/China400"
84
- },
85
- ],
86
- "layers": [
87
- {
88
- "pid": 40,
89
- "name": "鸟巢",
90
- "type": "supermap_s3m",
91
- "url": "http://www.supermapol.com/realspace/services/3D-Olympic/rest/realspace",
92
- "center": {
93
- "lat": 39.98578,
94
- "lng": 116.395599,
95
- "alt": 736,
96
- "heading": 317,
97
- "pitch": -37
98
- },
99
- "position": { "alt": 45 },
100
- "show": true,
101
- "flyTo": true
102
- }
103
- ],
104
- })
105
- delete mapOptions.terrain
106
-
107
- map = new mars3d.Map('mars3dContainer', mapOptions)
108
-
109
-
110
- }
111
-
112
- </script>
113
- </body>
114
-
115
- </html>