@ohuoy/easymap 1.0.21 → 1.0.22

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/dist/bundle.js CHANGED
@@ -197,7 +197,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n\n
197
197
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
198
198
 
199
199
  "use strict";
200
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EasyMap: () => (/* binding */ EasyMap)\n/* harmony export */ });\n/* harmony import */ var _lib_antv_l7__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/@antv/l7 */ \"./lib/@antv/l7/es/index.js\");\n/* harmony import */ var _lib_antv_l7_maps__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./lib/@antv/l7-maps */ \"./lib/@antv/l7-maps/es/mapbox/index.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\n/* harmony import */ var _mdi_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @mdi/js */ \"./node_modules/@mdi/js/mdi.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/mapbox-gl/dist/mapbox-gl.css */ \"./lib/mapbox-gl/dist/mapbox-gl.css\");\n/* harmony import */ var _mapbox_mapbox_gl_draw_dist_mapbox_gl_draw_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css */ \"./node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css\");\n/* harmony import */ var _turf_turf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @turf/turf */ \"./node_modules/@turf/turf/dist/es/index.js\");\n/* harmony import */ var _src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./src/utils/util.js */ \"./src/utils/util.js\");\n/* harmony import */ var _src_components_control_Toobars_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./src/components/control/Toobars.js */ \"./src/components/control/Toobars.js\");\n/* harmony import */ var _src_components_control_TilesBar_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./src/components/control/TilesBar.js */ \"./src/components/control/TilesBar.js\");\n/* harmony import */ var _src_components_control_DrawBar_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./src/components/control/DrawBar.js */ \"./src/components/control/DrawBar.js\");\n/* harmony import */ var _src_components_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./src/components/index */ \"./src/components/index.js\");\n/* harmony import */ var jszip__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! jszip */ \"./node_modules/jszip/dist/jszip.min.js\");\n/* harmony import */ var jszip__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(jszip__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _src_components_gif_gif_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./src/components/gif/gif.js */ \"./src/components/gif/gif.js\");\n/* harmony import */ var _src_components_gif_gif_worker_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./src/components/gif/gif.worker.js */ \"./src/components/gif/gif.worker.js\");\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n//import * as mdiSvg from '@mdi/font'\n\n\n\n\n\n\n\n\n\n\n\n\n\n//导出组件\nvar EasyMap = /*#__PURE__*/function () {\n function EasyMap(target, styleUrl, config) {\n _classCallCheck(this, EasyMap);\n _defineProperty(this, \"map\", void 0);\n _defineProperty(this, \"scene\", void 0);\n _defineProperty(this, \"markers\", void 0);\n _defineProperty(this, \"target\", void 0);\n _defineProperty(this, \"contextMenu\", void 0);\n _defineProperty(this, \"dialog\", void 0);\n _defineProperty(this, \"config\", {\n center: [108.7198975, 35.0446],\n pitch: 0,\n zoom: 13,\n rotation: 0,\n bearing: 0,\n projection: 'mercator'\n });\n //control\n _defineProperty(this, \"ScaleControl\", null);\n _defineProperty(this, \"NavigationControl\", null);\n _defineProperty(this, \"ToobarsControl\", null);\n _defineProperty(this, \"TilesBarControl\", null);\n _defineProperty(this, \"placesLabels\", {\n 'type': 'FeatureCollection',\n 'features': []\n });\n _defineProperty(this, \"labelLayer\", null);\n _defineProperty(this, \"drawBar\", null);\n if (!_lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].supported()) {\n alert('Your browser does not support Mapbox GL');\n }\n config.center = config !== null && config !== void 0 && config.center ? (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)(config.center) : (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)([108.7198975, 35.0446]);\n this.config = Object.assign(this.config, config);\n var scene = new _lib_antv_l7__WEBPACK_IMPORTED_MODULE_0__.Scene({\n id: target,\n logoVisible: false,\n // map: new Mapbox({\n // mapInstance: map,\n // }),\n map: new _lib_antv_l7_maps__WEBPACK_IMPORTED_MODULE_13__[\"default\"]({\n style: styleUrl,\n preserveDrawingBuffer: true,\n center: config !== null && config !== void 0 && config.center ? (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)(config.center) : (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)([108.7198975, 35.0446]),\n pitch: config !== null && config !== void 0 && config.pitch ? config.pitch : 0,\n projection: config.projection ? config.projection : 'mercator',\n zoom: config !== null && config !== void 0 && config.zoom ? config.zoom : 13,\n fadeDuration: 300,\n rotation: config !== null && config !== void 0 && config.rotation ? config.rotation : 0,\n token: '' //'pk.eyJ1Ijoid2hpdGVidWxkaW5nIiwiYSI6ImNsc3UwaXlnZDIwbDkybG1qbXJ6YnRtcmwifQ.jtQeo0gt3UNTCWw5FEyv_w',\n })\n });\n var map = scene.map;\n this.scene = scene;\n this.map = map;\n this.target = map.target;\n var that = this;\n this.map.on('load', function () {\n that.map.addSource('placesLabels', {\n 'type': 'geojson',\n 'data': that.placesLabels\n });\n that.addPlaceLabelsLayer();\n\n // that.labelLayer = new PolygonLayer({})\n // .source(that.placesLabels)\n // .color('blue')\n // .shape('label', 'text')\n // .size(18)\n // .style({\n // textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left\n // textOffset: [0, 0], // 文本相对锚点的偏移量 [水平, 垂直]\n // spacing: 2, // 字符间距\n // padding: [1, 1], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近\n // stroke: '#ffffff', // 描边颜色\n // strokeWidth: 0.3, // 描边宽度\n // strokeOpacity: 1.0,\n // });\n // that.scene.addLayer(that.labelLayer);\n config !== null && config !== void 0 && config.callback ? config === null || config === void 0 ? void 0 : config.callback(that) : null;\n that.contextMenu = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Popup({\n className: 'context-popup',\n closeButton: false\n });\n that.dialog = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Popup({\n className: 'context-popup',\n closeButton: false\n });\n });\n }\n return _createClass(EasyMap, [{\n key: \"addScale\",\n value: function addScale() {\n var postion = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"bottom-right\";\n if (this.ScaleControl) {\n this.map.addControl(this.ScaleControl, postion);\n } else {\n this.ScaleControl = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ScaleControl();\n this.map.addControl(this.ScaleControl, postion);\n }\n }\n }, {\n key: \"addNav\",\n value: function addNav() {\n var postion = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"bottom-right\";\n if (this.NavigationControl) {\n this.map.addControl(this.NavigationControl, postion);\n } else {\n this.NavigationControl = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].NavigationControl({\n showCompass: true,\n showZoom: true,\n visualizePitch: true\n });\n this.map.addControl(this.NavigationControl, postion);\n }\n }\n }, {\n key: \"addToorbars\",\n value: function addToorbars(config) {\n var postion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"bottom-right\";\n if (this.ToobarsControl) {\n for (var i in this.ToobarsControl.config) {\n if (config[i]) this.ToobarsControl.config[i] = Object.assign({}, this.ToobarsControl.config[i], config[i]);\n }\n\n //this.ToobarsControl.resetEvent();\n //this.map.addControl(this.ToobarsControl,postion);\n } else {\n this.ToobarsControl = new _src_components_control_Toobars_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"](config);\n this.map.addControl(this.ToobarsControl, postion);\n }\n }\n }, {\n key: \"addDrawBar\",\n value: function addDrawBar(config) {\n var postion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"bottom-right\";\n if (!this.drawBar) {\n this.drawBar = new _src_components_control_DrawBar_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"](this.map, config, postion);\n }\n }\n }, {\n key: \"addTilesLayer\",\n value: function addTilesLayer(config) {\n var postion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"bottom-right\";\n if (this.TilesBarControl) {\n this.TilesBarControl.config = config;\n this.map.addControl(this.ToobarsControl, postion);\n } else {\n this.TilesBarControl = new _src_components_control_TilesBar_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"](config);\n this.map.addControl(this.TilesBarControl, postion);\n }\n }\n\n /*\r\n 按钮列表\r\n 类型 info btn 图片\r\n {\r\n type:'info',\r\n content:''//字符,\r\n height:20px\r\n }\r\n {\r\n type:'btn',\r\n content:event//字符,\r\n height:20px\r\n }\r\n {\r\n type:'image',\r\n content:image//字符\r\n height:20px\r\n }\r\n */\n }, {\n key: \"addContextMenu\",\n value: function addContextMenu(btnlist) {\n var _this = this;\n var propertys = ['type', 'content'];\n this.map.off('contextmenu');\n if (btnlist instanceof Array) {\n this.map.on('contextmenu', function (e) {\n var lngLat = [e.lngLat.lng, e.lngLat.lat];\n //创建el\n var dom = document.createElement('div');\n dom.style = \"min-width:120px;min-height:30px;margin:0 -10px;\";\n var el = '';\n for (var i in btnlist) {\n var _item = btnlist[i];\n for (var prop in propertys) {\n if (!_item.hasOwnProperty(propertys[prop]) && (_item === null || _item === void 0 ? void 0 : _item.type) != 'line') {\n throw new Error(\"Item \".concat(i, \" is wrong,The \").concat(propertys[prop], \" property is not included\"));\n }\n }\n if ((_item === null || _item === void 0 ? void 0 : _item.type) == 'image') {\n if (!_item.hasOwnProperty('width') || !_item.hasOwnProperty('height')) {\n throw new Error(\"Item \".concat(i, \" is wrong,The image width and height is needed\"));\n }\n }\n switch (_item.type) {\n case 'title':\n el += \"<div class='context-map-title' style='\".concat(_item !== null && _item !== void 0 && _item.style ? _item === null || _item === void 0 ? void 0 : _item.style : '', \",font-size:18px;font-weight:600;width:calc(100% - 10px);height:\").concat(_item !== null && _item !== void 0 && _item.height ? _item === null || _item === void 0 ? void 0 : _item.height : 22, \"px;margin:5px;display:flex'>\\n <div>\").concat(_item.content, \"</div>\\n </div>\");\n break;\n case 'line':\n el += \"<hr class='context-map-line' style='display: block;\\n flex: 1 1 100%;\\n height: 0px;\\n max-height: 0px;\\n opacity: 0.12;\\n transition: inherit;\\n border-style: solid;\\n border-width: thin 0 0 0;' aria-orientation=\\\"horizontal\\\" role=\\\"separator\\\">\";\n break;\n case 'btn':\n el += \"<div class='context-map-btn' style='\".concat(_item !== null && _item !== void 0 && _item.style ? _item === null || _item === void 0 ? void 0 : _item.style : '', \",width:calc(100% - 10px);height:\").concat(_item !== null && _item !== void 0 && _item.height ? _item === null || _item === void 0 ? void 0 : _item.height : 22, \"px;margin:5px;display:flex'>\\n <div style='width:14px;height:\").concat(_item !== null && _item !== void 0 && _item.height ? _item === null || _item === void 0 ? void 0 : _item.height : 22, \"px;margin:0 8px'>\\n <img style='display:\").concat(_item.iconPre ? 'block' : 'none', \";height:16px' src='\").concat(_item.iconPre, \"' />\\n </div>\\n \\n <div style='width:calc(100% - 32PX)'>\").concat(_item.content, \"</div>\\n <div style='width:16px;height:\").concat(_item !== null && _item !== void 0 && _item.height ? _item === null || _item === void 0 ? void 0 : _item.height : 22, \"px'>\\n <img src='\").concat(_item.iconApp, \"' style='display:\").concat(_item.iconApp ? 'block' : 'none', \"' />\\n </div>\\n </div>\");\n break;\n case 'text':\n var textContent = _item.content;\n textContent = textContent.replaceAll('$lng$', e.lngLat.lng.toFixed(6)).replaceAll('$lat$', e.lngLat.lat.toFixed(6));\n el += \"<div class='context-map-text' style='\".concat(_item !== null && _item !== void 0 && _item.style ? _item === null || _item === void 0 ? void 0 : _item.style : '', \",width:calc(100% - 10px);margin:5px;display:flex'>\\n <div style='width:100%;text-wrap:wrap;'>\").concat(textContent, \"</div>\\n </div>\");\n break;\n case 'image':\n _item.width = typeof _item.width == 'number' ? _item.width + 'px' : _item.width;\n _item.height = typeof _item.height == 'number' ? _item.height + 'px' : _item.height;\n el += \"<div class='context-map-image' style='\".concat(_item !== null && _item !== void 0 && _item.style ? _item === null || _item === void 0 ? void 0 : _item.style : '', \",width:calc(100% - 10px);margin:5px;display:flex'>\\n <img src='\").concat(_item.content, \"' style='width:\").concat(_item.width, \";height:\").concat(_item.height, \"' />\\n </div>\");\n break;\n default:\n throw new Error('type must is one of \"line, text,title, image, btn\"');\n }\n }\n dom.innerHTML = el;\n var _loop = function _loop() {\n var item = dom.children[_i2];\n var _item = btnlist[_i2];\n if (_typeof(item) == 'object') {\n if (_item.type == 'btn') {\n // item?.addEventListener('mouseenter',(e)=>{\n // let elm = e.target;\n // elm.style.background='#e6f1ff'\n // })\n // item?.addEventListener('mouseleave',(e)=>{\n // let elm = e.target;\n // elm.style.background=''\n // })\n }\n if (_item.event) {\n item === null || item === void 0 || item.addEventListener(_item.event.type, function (_event) {\n _event.stopPropagation();\n var _obj = Object.assign({}, e);\n _obj.lngLat = (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)([_obj.lngLat.lng, _obj.lngLat.lat], true);\n _item.event.fun(_event, _obj);\n _this.contextMenu.remove();\n });\n }\n }\n };\n for (var _i2 in btnlist) {\n _loop();\n }\n _this.contextMenu.addTo(_this.map).setLngLat({\n lng: lngLat[0],\n lat: lngLat[1]\n }).setDOMContent(dom);\n });\n } else {\n throw new Error('parmas must be array');\n }\n }\n }, {\n key: \"addDialog\",\n value: function addDialog(btnlist, _lngLat) {\n var propertys = ['type', 'content'];\n if (!_lngLat) {\n throw new Error(\"params 2 is needed, please input [lng,lat] at params 2\");\n }\n if (btnlist instanceof Array) {\n var lngLat = (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)(_lngLat);\n //创建el\n var dom = document.createElement('div');\n dom.style = \"min-width:120px;min-height:30px;margin:0 -10px;\";\n var el = '';\n for (var i in btnlist) {\n var _item = btnlist[i];\n for (var prop in propertys) {\n if (!_item.hasOwnProperty(propertys[prop]) && (_item === null || _item === void 0 ? void 0 : _item.type) != 'line') {\n throw new Error(\"Item \".concat(i, \" is wrong,The \").concat(propertys[prop], \" property is not included\"));\n }\n }\n if ((_item === null || _item === void 0 ? void 0 : _item.type) == 'image') {\n if (!_item.hasOwnProperty('width') || !_item.hasOwnProperty('height')) {\n throw new Error(\"Item \".concat(i, \" is wrong,The image width and height is needed\"));\n }\n }\n switch (_item.type) {\n case 'title':\n el += \"<div class='context-map-title' style='\".concat(_item !== null && _item !== void 0 && _item.style ? _item === null || _item === void 0 ? void 0 : _item.style : '', \",font-size:18px;font-weight:600;width:calc(100% - 10px);height:\").concat(_item !== null && _item !== void 0 && _item.height ? _item === null || _item === void 0 ? void 0 : _item.height : 22, \"px;margin:5px;display:flex'>\\n <div>\").concat(_item.content, \"</div>\\n </div>\");\n break;\n case 'line':\n el += \"<hr class='context-map-line' style='display: block;\\n flex: 1 1 100%;\\n height: 0px;\\n max-height: 0px;\\n opacity: 0.12;\\n transition: inherit;\\n border-style: solid;\\n border-width: thin 0 0 0;' aria-orientation=\\\"horizontal\\\" role=\\\"separator\\\">\";\n break;\n case 'btn':\n el += \"<div class='context-map-btn' style='\".concat(_item !== null && _item !== void 0 && _item.style ? _item === null || _item === void 0 ? void 0 : _item.style : '', \",width:calc(100% - 10px);height:\").concat(_item !== null && _item !== void 0 && _item.height ? _item === null || _item === void 0 ? void 0 : _item.height : 22, \"px;margin:5px;display:flex'>\\n <div style='width:14px;height:\").concat(_item !== null && _item !== void 0 && _item.height ? _item === null || _item === void 0 ? void 0 : _item.height : 22, \"px;margin:0 6px'>\\n <img style='display:\").concat(_item.iconPre ? 'block' : 'none', \";height:16px' src='\").concat(_item.iconPre, \"' />\\n </div>\\n \\n <div style='width:calc(100% - 32PX)'>\").concat(_item.content, \"</div>\\n <div style='width:16px;height:\").concat(_item !== null && _item !== void 0 && _item.height ? _item === null || _item === void 0 ? void 0 : _item.height : 22, \"px'>\\n <img src='\").concat(_item.iconApp, \"' style='display:\").concat(_item.iconApp ? 'block' : 'none', \"' />\\n </div>\\n </div>\");\n break;\n case 'text':\n el += \"<div class='context-map-text' style='\".concat(_item !== null && _item !== void 0 && _item.style ? _item === null || _item === void 0 ? void 0 : _item.style : '', \",width:calc(100% - 10px);margin:5px;display:flex'>\\n <div style='width:100%;text-wrap:wrap;'>\").concat(_item.content, \"</div>\\n </div>\");\n break;\n case 'image':\n _item.width = typeof _item.width == 'number' ? _item.width + 'px' : _item.width;\n _item.height = typeof _item.height == 'number' ? _item.height + 'px' : _item.height;\n el += \"<div class='context-map-image' style='\".concat(_item !== null && _item !== void 0 && _item.style ? _item === null || _item === void 0 ? void 0 : _item.style : '', \",width:calc(100% - 10px);margin:5px;display:flex'>\\n <img src='\").concat(_item.content, \"' style='width:\").concat(_item.width, \";height:\").concat(_item.height, \"' />\\n </div>\");\n break;\n default:\n throw new Error('type must is one of \"line, text,title, image, btn\"');\n }\n }\n dom.innerHTML = el;\n var _loop2 = function _loop2() {\n var item = dom.children[_i3];\n var _item = btnlist[_i3];\n if (_typeof(item) == 'object') {\n if (_item.type == 'btn') {\n // item?.addEventListener('mouseenter',(e)=>{\n // let elm = e.target;\n // elm.style.background='#e6f1ff'\n // })\n // item?.addEventListener('mouseleave',(e)=>{\n // let elm = e.target;\n // elm.style.background=''\n // })\n }\n if (_item.event) {\n item === null || item === void 0 || item.addEventListener(_item.event.type, function (_event) {\n _item.event.fun(_event, e);\n });\n }\n }\n };\n for (var _i3 in btnlist) {\n _loop2();\n }\n this.dialog.addTo(this.map).setLngLat({\n lng: lngLat[0],\n lat: lngLat[1]\n }).setDOMContent(dom);\n } else {\n throw new Error('parmas must be array');\n }\n }\n }, {\n key: \"addPlaceLabelsLayer\",\n value: function addPlaceLabelsLayer() {\n this.map.addLayer({\n 'id': 'poi-labels',\n 'type': 'symbol',\n 'source': 'placesLabels',\n 'layout': {\n 'text-field': ['get', 'label'],\n //'text-anchor':'center',\n 'text-size': 18,\n 'text-variable-anchor': ['top', 'bottom', 'left', 'right'],\n //'text-radial-offset': 0.5,\n 'text-justify': 'auto',\n 'icon-image': ['get', 'icon'],\n 'icon-anchor': 'center',\n 'icon-offset': ['get', 'icon-offset'],\n 'text-ignore-placement': true,\n 'icon-ignore-placement': true\n //'icon-text-fit':'width', \n },\n 'paint': {\n 'text-color': ['get', 'text-color'],\n 'icon-color': '#0f3ad0',\n 'text-halo-color': ['get', 'text-border-color'],\n 'text-halo-width': 1\n }\n });\n }\n }, {\n key: \"removePlaceLabelsLayer\",\n value: function removePlaceLabelsLayer() {\n this.map.remove('poi-labels');\n }\n //type = 0 替换\n //type = 1 增加 经纬度一样替换\n }, {\n key: \"updateLabels\",\n value: function updateLabels(labels, style) {\n var _this2 = this;\n var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var label = {\n name: '',\n icon: '',\n coords: []\n };\n var icon = {\n name: '',\n image: '',\n type: ''\n };\n var geojsonFeatures = [];\n if (labels instanceof Array) {\n var _loop3 = function _loop3() {\n var _item = labels[_i];\n for (var _i4 in label) {\n if (!_item.hasOwnProperty(_i4)) {\n throw new Error(\"The index \".concat(_i, \" is wrong , \").concat(_i4, \" property is not included\"));\n }\n }\n if (_item.icon) {\n if (typeof _item.icon == 'string' && !_this2.map.hasImage(_item.icon)) {\n var imgUrl = \"data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" style='fill:%230f3ad0' width=\\\"24\\\" height=\\\"24\\\">%3Cpath d=\\\"\".concat(_mdi_js__WEBPACK_IMPORTED_MODULE_14__[_item.icon], \"\\\"/>%3C/svg>\");\n var image = new Image(20, 20);\n image.src = imgUrl;\n image.onload = function (e) {\n if (!_this2.map.hasImage(_item.icon)) {\n _this2.map.addImage(_item.icon, e.target);\n }\n };\n }\n } else {\n //this.map.\n }\n geojsonFeatures.push({\n 'type': 'Feature',\n 'properties': {\n 'label': _item.name,\n 'text-color': '#0f3ad0',\n 'text-border-color': '#fff',\n 'icon': _item.icon,\n 'icon-offset': [_item.name.length * -10, 10]\n },\n 'geometry': {\n 'type': 'Point',\n 'coordinates': (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)(_item.coords)\n }\n });\n };\n for (var _i in labels) {\n _loop3();\n }\n if (type == 0) {\n this.placesLabels.features = geojsonFeatures;\n } else {\n var _loop4 = function _loop4() {\n var item = geojsonFeatures[i];\n var index = _this2.placesLabels.features.findIndex(function (a) {\n return a.coordinates == item.coords;\n });\n if (index >= 0) {\n _this2.placesLabels.features[index] = item;\n } else {\n _this2.placesLabels.features.push(item);\n }\n };\n for (var i in geojsonFeatures) {\n _loop4();\n }\n }\n var placesLabelsSource = this.map.getSource('placesLabels');\n placesLabelsSource.setData(this.placesLabels);\n // this.labelLayer.setData(this.placesLabels)\n // console.log(this.labelLayer)\n } else {\n throw new Error(\"The params 0 must be array\");\n }\n }\n }, {\n key: \"addMarker\",\n value: function addMarker(marker) {\n this.map.addMarker(marker);\n this.markers.push(marker);\n }\n }, {\n key: \"getMarker\",\n value: function getMarker(id) {\n return this.markers.find(function (a) {\n return a.id == id;\n });\n }\n\n //获取指定位置指定距离截图\n }, {\n key: \"getMapImageByDistance\",\n value: function getMapImageByDistance(center, distance) {\n var imageList = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {\n target: null,\n style: 'http://192.168.11.93:1234/api/styles/osm',\n type: 'blob',\n pix: {\n w: 1024,\n h: 1024\n },\n callback: function callback() {}\n };\n var target;\n config = Object.assign({}, {\n target: null,\n type: 'blob',\n delay: 300,\n pix: {\n w: 1024,\n h: 1024\n },\n opacity: 0.7,\n style: 'http://192.168.11.93:1234/api/styles/osm',\n callback: function callback() {}\n }, config);\n var bounds = (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.getLayerMapPosition)(distance, (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)(center));\n if (!config.target) {\n target = document.createElement('div');\n } else {\n target = config.target;\n }\n var pix = config.pix;\n target.style = \"width:\".concat(pix.w, \"px;height:\").concat(pix.h, \"px;z-index:-1;\");\n document.body.appendChild(target);\n var scene = new _lib_antv_l7__WEBPACK_IMPORTED_MODULE_0__.Scene({\n id: target,\n // map: new Mapbox({\n // mapInstance: map,\n // }),\n map: new _lib_antv_l7_maps__WEBPACK_IMPORTED_MODULE_13__[\"default\"]({\n style: config.style,\n preserveDrawingBuffer: true,\n //center:transform([114.7198975,23.0446]),\n bounds: [bounds[0], bounds[2]],\n container: target,\n opacity: 0.7,\n pitch: 0,\n zoom: 0,\n rotation: 0,\n token: '' //'pk.eyJ1Ijoid2hpdGVidWxkaW5nIiwiYSI6ImNsc3UwaXlnZDIwbDkybG1qbXJ6YnRtcmwifQ.jtQeo0gt3UNTCWw5FEyv_w',\n })\n });\n var map = scene.map;\n map.on('load', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var base64, scanLayer, i, a, _base;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(!imageList || imageList.length == 0)) {\n _context.next = 5;\n break;\n }\n base64 = map._canvas.toDataURL();\n if (config.type == 'download') {\n (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.downloadFileByBase64)(base64, (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.guid)());\n } //downloadFileByBase64(base64,guid())\n else if (config.type == 'blob') {\n config.callback((0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.downloadFileBlobByBase64)(base64));\n }\n _context.next = 17;\n break;\n case 5:\n scanLayer = map.getLayer('threescan-layer');\n if (!scanLayer) {\n scanLayer = new _src_components_index_js__WEBPACK_IMPORTED_MODULE_9__.ThreeScanLayer('threescan-layer', {\n opacity: config.opacity,\n textClass: ' map-time zmax '\n });\n map.addLayer(scanLayer);\n }\n _context.t0 = _regeneratorRuntime().keys(imageList);\n case 8:\n if ((_context.t1 = _context.t0()).done) {\n _context.next = 17;\n break;\n }\n i = _context.t1.value;\n a = imageList[i];\n _context.next = 13;\n return scanLayer.drawImageList(a, config.delay);\n case 13:\n _base = _context.sent;\n // map.getCanvas().toDataURL()\n config.callback((0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.downloadFileBlobByBase64)(_base));\n _context.next = 8;\n break;\n case 17:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n })));\n }\n\n //获取指定位置指定距离截图\n }, {\n key: \"getMapImageWithScan\",\n value: function getMapImageWithScan(_center, distance, imgList, _target) {\n var downloadType = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'file';\n var callback = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;\n if (imgList instanceof Array) {\n var jsZip = new (jszip__WEBPACK_IMPORTED_MODULE_10___default())();\n var _gif = new GIF({\n repeat: 0,\n workers: 2,\n quality: 64,\n workerScript: (0,_src_components_gif_gif_worker_js__WEBPACK_IMPORTED_MODULE_12__.getGifWorker)(),\n debug: true\n });\n if (imgList.length == 0) return;\n var target;\n var dataUrlList = [];\n var center = (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)(_center);\n var bounds = (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.getLayerMapPosition)(distance, center);\n if (!_target) target = document.createElement('div');else target = _target;\n var pix = 1024;\n target.style = \"width:\".concat(pix, \"px;height:\").concat(pix, \"px;z-index:1;position:relative;\");\n document.body.appendChild(target);\n var scene = new _lib_antv_l7__WEBPACK_IMPORTED_MODULE_0__.Scene({\n id: target,\n // map: new Mapbox({\n // mapInstance: map,\n // }),\n map: new _lib_antv_l7_maps__WEBPACK_IMPORTED_MODULE_13__[\"default\"]({\n style: 'http://192.168.11.93:1234/api/styles/osm',\n preserveDrawingBuffer: true,\n center: center,\n bounds: [bounds[0], bounds[2]],\n fadeDuration: 0,\n pitch: 0,\n zoom: 0,\n rotation: 0,\n token: '' //'pk.eyJ1Ijoid2hpdGVidWxkaW5nIiwiYSI6ImNsc3UwaXlnZDIwbDkybG1qbXJ6YnRtcmwifQ.jtQeo0gt3UNTCWw5FEyv_w',\n })\n });\n var map = scene.map;\n map.on('load', function () {\n //添加图层\n var _canLayer = new _src_components_index_js__WEBPACK_IMPORTED_MODULE_9__.ScanLayer('scanimage');\n var _canvas = target.getElementsByClassName('mapboxgl-canvas')[0];\n var i = 0;\n var _interval = setInterval(function () {\n if (i >= imgList.length) {\n clearInterval(_interval);\n setTimeout(function () {\n callback ? callback() : '';\n }, 500);\n return;\n }\n var url = imgList[i];\n map.loadImage(url, function (err, image) {\n var _i = i;\n if (err) {\n throw new Error(err);\n }\n _canLayer.drawList({\n id: 'SD01',\n image: image,\n coords: (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.getLayerMapPosition)(distance, _center)\n });\n _canLayer.renderBack = function () {\n if (dataUrlList.findIndex(function (a) {\n return a.i == _i;\n }) < 0) {\n dataUrlList.push({\n i: _i,\n base64: _canvas.toDataURL()\n });\n i += 1;\n if (downloadType == 'gif') {\n _gif.addFrame(_canvas, {\n delay: 1000,\n copy: true\n });\n }\n }\n if (_i == imgList.length - 1) {\n _canLayer.renderBack = null;\n if (downloadType == 'file') {\n dataUrlList.forEach(function (a) {\n return (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.downloadFileByBase64)(a.base64, a.i + '.png');\n });\n }\n if (downloadType == 'zip') {\n dataUrlList.forEach(function (a) {\n return jsZip.file(a.i + '.png', a.base64.replace(/^data:image\\/(png|jpg);base64,/, \"\"), {\n base64: true\n });\n });\n jsZip.generateAsync({\n type: \"blob\"\n }).then(function (blob) {\n var url = window.URL.createObjectURL(blob);\n (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.downloadFile)(url, \"pnglist.zip\");\n });\n }\n if (downloadType == 'obj') {\n return dataUrlList;\n }\n if (downloadType == 'gif') {\n // 将每一帧渲染成一张完成的gif\n _gif.render();\n _gif.on('finished', function (blob) {\n var url = URL.createObjectURL(blob);\n (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.downloadFile)(url, \"pnglist.gif\");\n });\n }\n }\n };\n });\n }, 200);\n setTimeout(function () {\n map.addLayer(_canLayer);\n }, 201);\n });\n target.remove();\n } else throw new Error('The params 2 image list must be array ');\n }\n\n //设置底图图层\n }, {\n key: \"setTile\",\n value: function setTile(key) {\n var currentFillLayerIndex = this.map.style.stylesheet.layers.findIndex(function (a) {\n return a.type != 'fill' && a.type != 'background';\n });\n var beforeId = this.map.style.stylesheet.layers[currentFillLayerIndex].id;\n if (key == 'standard') {\n if (this.map.getLayer('yingxiang')) this.map.removeLayer('yingxiang');\n if (this.map.getLayer('tiandi')) this.map.removeLayer('tiandi');\n }\n if (key == 'satellite') {\n if (this.map.getLayer('tiandi')) this.map.removeLayer('tiandi');\n if (!this.map.getLayer('yingxiang')) {\n this.map.addLayer({\n \"id\": \"yingxiang\",\n \"source\": \"yingxiang\",\n \"type\": \"raster\"\n }, beforeId);\n }\n ;\n }\n if (key == 'tiandi') {\n if (this.map.getLayer('yingxiang')) this.map.removeLayer('yingxiang');\n if (!this.map.getLayer('tiandi')) {\n this.map.addLayer({\n \"id\": \"tiandi\",\n \"source\": \"tianditu\",\n \"type\": \"raster\"\n }, beforeId);\n }\n ;\n }\n }\n }, {\n key: \"jumpTo\",\n value: function jumpTo(_ref2) {\n var _ref2$center = _ref2.center,\n center = _ref2$center === void 0 ? (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)(this.config.center) : _ref2$center,\n _ref2$zoom = _ref2.zoom,\n zoom = _ref2$zoom === void 0 ? this.config.zoom : _ref2$zoom,\n _ref2$pitch = _ref2.pitch,\n pitch = _ref2$pitch === void 0 ? this.config.pitch : _ref2$pitch,\n _ref2$bearing = _ref2.bearing,\n bearing = _ref2$bearing === void 0 ? this.config.bearing : _ref2$bearing;\n this.map.jumpTo({\n center: center,\n zoom: zoom,\n pitch: pitch,\n bearing: bearing\n });\n }\n }]);\n}();\n\n//# sourceURL=webpack://@ohuoy/easymap/./index.js?");
200
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EasyMap: () => (/* binding */ EasyMap)\n/* harmony export */ });\n/* harmony import */ var _lib_antv_l7__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./lib/@antv/l7 */ \"./lib/@antv/l7/es/index.js\");\n/* harmony import */ var _lib_antv_l7_maps__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./lib/@antv/l7-maps */ \"./lib/@antv/l7-maps/es/mapbox/index.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\n/* harmony import */ var _mdi_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @mdi/js */ \"./node_modules/@mdi/js/mdi.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lib/mapbox-gl/dist/mapbox-gl.css */ \"./lib/mapbox-gl/dist/mapbox-gl.css\");\n/* harmony import */ var _mapbox_mapbox_gl_draw_dist_mapbox_gl_draw_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css */ \"./node_modules/@mapbox/mapbox-gl-draw/dist/mapbox-gl-draw.css\");\n/* harmony import */ var _turf_turf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @turf/turf */ \"./node_modules/@turf/turf/dist/es/index.js\");\n/* harmony import */ var _src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./src/utils/util.js */ \"./src/utils/util.js\");\n/* harmony import */ var _src_components_control_Toobars_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./src/components/control/Toobars.js */ \"./src/components/control/Toobars.js\");\n/* harmony import */ var _src_components_control_TilesBar_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./src/components/control/TilesBar.js */ \"./src/components/control/TilesBar.js\");\n/* harmony import */ var _src_components_control_DrawBar_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./src/components/control/DrawBar.js */ \"./src/components/control/DrawBar.js\");\n/* harmony import */ var _src_components_index_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./src/components/index */ \"./src/components/index.js\");\n/* harmony import */ var jszip__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! jszip */ \"./node_modules/jszip/dist/jszip.min.js\");\n/* harmony import */ var jszip__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(jszip__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _src_components_gif_gif_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./src/components/gif/gif.js */ \"./src/components/gif/gif.js\");\n/* harmony import */ var _src_components_gif_gif_worker_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./src/components/gif/gif.worker.js */ \"./src/components/gif/gif.worker.js\");\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n//import * as mdiSvg from '@mdi/font'\n\n\n\n\n\n\n\n\n\n\n\n\n\n//导出组件\nvar EasyMap = /*#__PURE__*/function () {\n function EasyMap(target, styleUrl, config) {\n _classCallCheck(this, EasyMap);\n _defineProperty(this, \"map\", void 0);\n _defineProperty(this, \"scene\", void 0);\n _defineProperty(this, \"markers\", void 0);\n _defineProperty(this, \"target\", void 0);\n _defineProperty(this, \"contextMenu\", void 0);\n _defineProperty(this, \"dialog\", void 0);\n _defineProperty(this, \"config\", {\n center: [108.7198975, 35.0446],\n pitch: 0,\n zoom: 13,\n rotation: 0,\n bearing: 0,\n projection: 'mercator'\n });\n //control\n _defineProperty(this, \"ScaleControl\", null);\n _defineProperty(this, \"NavigationControl\", null);\n _defineProperty(this, \"ToobarsControl\", null);\n _defineProperty(this, \"TilesBarControl\", null);\n _defineProperty(this, \"placesLabels\", {\n 'type': 'FeatureCollection',\n 'features': []\n });\n _defineProperty(this, \"labelLayer\", null);\n _defineProperty(this, \"drawBar\", null);\n if (!_lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].supported()) {\n alert('Your browser does not support Mapbox GL');\n }\n config.center = config !== null && config !== void 0 && config.center ? (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)(config.center) : (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)([108.7198975, 35.0446]);\n this.config = Object.assign(this.config, config);\n var scene = new _lib_antv_l7__WEBPACK_IMPORTED_MODULE_0__.Scene({\n id: target,\n logoVisible: false,\n // map: new Mapbox({\n // mapInstance: map,\n // }),\n map: new _lib_antv_l7_maps__WEBPACK_IMPORTED_MODULE_13__[\"default\"]({\n style: styleUrl,\n preserveDrawingBuffer: true,\n center: config !== null && config !== void 0 && config.center ? (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)(config.center) : (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)([108.7198975, 35.0446]),\n pitch: config !== null && config !== void 0 && config.pitch ? config.pitch : 0,\n projection: config.projection ? config.projection : 'mercator',\n zoom: config !== null && config !== void 0 && config.zoom ? config.zoom : 13,\n fadeDuration: 300,\n rotation: config !== null && config !== void 0 && config.rotation ? config.rotation : 0,\n token: '' //'pk.eyJ1Ijoid2hpdGVidWxkaW5nIiwiYSI6ImNsc3UwaXlnZDIwbDkybG1qbXJ6YnRtcmwifQ.jtQeo0gt3UNTCWw5FEyv_w',\n })\n });\n var map = scene.map;\n this.scene = scene;\n this.map = map;\n this.target = map.target;\n var that = this;\n this.map.on('load', function () {\n that.map.addSource('placesLabels', {\n 'type': 'geojson',\n 'data': that.placesLabels\n });\n that.addPlaceLabelsLayer();\n\n // that.labelLayer = new PolygonLayer({})\n // .source(that.placesLabels)\n // .color('blue')\n // .shape('label', 'text')\n // .size(18)\n // .style({\n // textAnchor: 'center', // 文本相对锚点的位置 center|left|right|top|bottom|top-left\n // textOffset: [0, 0], // 文本相对锚点的偏移量 [水平, 垂直]\n // spacing: 2, // 字符间距\n // padding: [1, 1], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近\n // stroke: '#ffffff', // 描边颜色\n // strokeWidth: 0.3, // 描边宽度\n // strokeOpacity: 1.0,\n // });\n // that.scene.addLayer(that.labelLayer);\n config !== null && config !== void 0 && config.callback ? config === null || config === void 0 ? void 0 : config.callback(that) : null;\n that.contextMenu = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Popup({\n className: 'context-popup',\n closeButton: false\n });\n that.dialog = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Popup({\n className: 'context-popup',\n closeButton: false\n });\n });\n }\n return _createClass(EasyMap, [{\n key: \"addScale\",\n value: function addScale() {\n var postion = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"bottom-right\";\n if (this.ScaleControl) {\n this.map.addControl(this.ScaleControl, postion);\n } else {\n this.ScaleControl = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].ScaleControl();\n this.map.addControl(this.ScaleControl, postion);\n }\n }\n }, {\n key: \"addNav\",\n value: function addNav() {\n var postion = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : \"bottom-right\";\n if (this.NavigationControl) {\n this.map.addControl(this.NavigationControl, postion);\n } else {\n this.NavigationControl = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].NavigationControl({\n showCompass: true,\n showZoom: true,\n visualizePitch: true\n });\n this.map.addControl(this.NavigationControl, postion);\n }\n }\n }, {\n key: \"addToorbars\",\n value: function addToorbars(config) {\n var postion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"bottom-right\";\n if (this.ToobarsControl) {\n for (var i in this.ToobarsControl.config) {\n if (config[i]) this.ToobarsControl.config[i] = Object.assign({}, this.ToobarsControl.config[i], config[i]);\n }\n\n //this.ToobarsControl.resetEvent();\n //this.map.addControl(this.ToobarsControl,postion);\n } else {\n this.ToobarsControl = new _src_components_control_Toobars_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"](config);\n this.map.addControl(this.ToobarsControl, postion);\n }\n }\n }, {\n key: \"addDrawBar\",\n value: function addDrawBar(config) {\n var postion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"bottom-right\";\n if (!this.drawBar) {\n this.drawBar = new _src_components_control_DrawBar_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"](this.map, config, postion);\n }\n }\n }, {\n key: \"addTilesLayer\",\n value: function addTilesLayer(config) {\n var postion = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : \"bottom-right\";\n if (this.TilesBarControl) {\n this.TilesBarControl.config = config;\n this.map.addControl(this.ToobarsControl, postion);\n } else {\n this.TilesBarControl = new _src_components_control_TilesBar_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"](config);\n this.map.addControl(this.TilesBarControl, postion);\n }\n }\n\n /*\r\n 按钮列表\r\n 类型 info btn 图片\r\n {\r\n type:'info',\r\n content:''//字符,\r\n height:20px\r\n }\r\n {\r\n type:'btn',\r\n content:event//字符,\r\n height:20px\r\n }\r\n {\r\n type:'image',\r\n content:image//字符\r\n height:20px\r\n }\r\n */\n }, {\n key: \"addContextMenu\",\n value: function addContextMenu(btnlist) {\n var _this = this;\n var propertys = ['type', 'content'];\n this.map.off('contextmenu');\n if (btnlist instanceof Array) {\n this.map.on('contextmenu', function (e) {\n var lngLat = [e.lngLat.lng, e.lngLat.lat];\n //创建el\n var dom = document.createElement('div');\n dom.style = \"min-width:120px;min-height:30px;margin:0 -10px;\";\n var el = '';\n for (var i in btnlist) {\n var _item = btnlist[i];\n for (var prop in propertys) {\n if (!_item.hasOwnProperty(propertys[prop]) && (_item === null || _item === void 0 ? void 0 : _item.type) != 'line') {\n throw new Error(\"Item \".concat(i, \" is wrong,The \").concat(propertys[prop], \" property is not included\"));\n }\n }\n if ((_item === null || _item === void 0 ? void 0 : _item.type) == 'image') {\n if (!_item.hasOwnProperty('width') || !_item.hasOwnProperty('height')) {\n throw new Error(\"Item \".concat(i, \" is wrong,The image width and height is needed\"));\n }\n }\n switch (_item.type) {\n case 'title':\n el += \"<div class='context-map-title' style='\".concat(_item !== null && _item !== void 0 && _item.style ? _item === null || _item === void 0 ? void 0 : _item.style : '', \",font-size:18px;font-weight:600;width:calc(100% - 10px);height:\").concat(_item !== null && _item !== void 0 && _item.height ? _item === null || _item === void 0 ? void 0 : _item.height : 22, \"px;margin:5px;display:flex'>\\n <div>\").concat(_item.content, \"</div>\\n </div>\");\n break;\n case 'line':\n el += \"<hr class='context-map-line' style='display: block;\\n flex: 1 1 100%;\\n height: 0px;\\n max-height: 0px;\\n opacity: 0.12;\\n transition: inherit;\\n border-style: solid;\\n border-width: thin 0 0 0;' aria-orientation=\\\"horizontal\\\" role=\\\"separator\\\">\";\n break;\n case 'btn':\n el += \"<div class='context-map-btn' style='\".concat(_item !== null && _item !== void 0 && _item.style ? _item === null || _item === void 0 ? void 0 : _item.style : '', \",width:calc(100% - 10px);height:\").concat(_item !== null && _item !== void 0 && _item.height ? _item === null || _item === void 0 ? void 0 : _item.height : 22, \"px;margin:5px;display:flex'>\\n <div style='width:14px;height:\").concat(_item !== null && _item !== void 0 && _item.height ? _item === null || _item === void 0 ? void 0 : _item.height : 22, \"px;margin:0 8px'>\\n <img style='display:\").concat(_item.iconPre ? 'block' : 'none', \";height:16px' src='\").concat(_item.iconPre, \"' />\\n </div>\\n \\n <div style='width:calc(100% - 32PX)'>\").concat(_item.content, \"</div>\\n <div style='width:16px;height:\").concat(_item !== null && _item !== void 0 && _item.height ? _item === null || _item === void 0 ? void 0 : _item.height : 22, \"px'>\\n <img src='\").concat(_item.iconApp, \"' style='display:\").concat(_item.iconApp ? 'block' : 'none', \"' />\\n </div>\\n </div>\");\n break;\n case 'text':\n var textContent = _item.content;\n textContent = textContent.replaceAll('$lng$', e.lngLat.lng.toFixed(6)).replaceAll('$lat$', e.lngLat.lat.toFixed(6));\n el += \"<div class='context-map-text' style='\".concat(_item !== null && _item !== void 0 && _item.style ? _item === null || _item === void 0 ? void 0 : _item.style : '', \",width:calc(100% - 10px);margin:5px;display:flex'>\\n <div style='width:100%;text-wrap:wrap;'>\").concat(textContent, \"</div>\\n </div>\");\n break;\n case 'image':\n _item.width = typeof _item.width == 'number' ? _item.width + 'px' : _item.width;\n _item.height = typeof _item.height == 'number' ? _item.height + 'px' : _item.height;\n el += \"<div class='context-map-image' style='\".concat(_item !== null && _item !== void 0 && _item.style ? _item === null || _item === void 0 ? void 0 : _item.style : '', \",width:calc(100% - 10px);margin:5px;display:flex'>\\n <img src='\").concat(_item.content, \"' style='width:\").concat(_item.width, \";height:\").concat(_item.height, \"' />\\n </div>\");\n break;\n default:\n throw new Error('type must is one of \"line, text,title, image, btn\"');\n }\n }\n dom.innerHTML = el;\n var _loop = function _loop() {\n var item = dom.children[_i2];\n var _item = btnlist[_i2];\n if (_typeof(item) == 'object') {\n if (_item.type == 'btn') {\n // item?.addEventListener('mouseenter',(e)=>{\n // let elm = e.target;\n // elm.style.background='#e6f1ff'\n // })\n // item?.addEventListener('mouseleave',(e)=>{\n // let elm = e.target;\n // elm.style.background=''\n // })\n }\n if (_item.event) {\n item === null || item === void 0 || item.addEventListener(_item.event.type, function (_event) {\n _event.stopPropagation();\n var _obj = Object.assign({}, e);\n _obj.lngLat = (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)([_obj.lngLat.lng, _obj.lngLat.lat], true);\n _item.event.fun(_event, _obj);\n _this.contextMenu.remove();\n });\n }\n }\n };\n for (var _i2 in btnlist) {\n _loop();\n }\n _this.contextMenu.addTo(_this.map).setLngLat({\n lng: lngLat[0],\n lat: lngLat[1]\n }).setDOMContent(dom);\n });\n } else {\n throw new Error('parmas must be array');\n }\n }\n }, {\n key: \"addDialog\",\n value: function addDialog(btnlist, _lngLat) {\n var propertys = ['type', 'content'];\n if (!_lngLat) {\n throw new Error(\"params 2 is needed, please input [lng,lat] at params 2\");\n }\n if (btnlist instanceof Array) {\n var lngLat = (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)(_lngLat);\n //创建el\n var dom = document.createElement('div');\n dom.style = \"min-width:120px;min-height:30px;margin:0 -10px;\";\n var el = '';\n for (var i in btnlist) {\n var _item = btnlist[i];\n for (var prop in propertys) {\n if (!_item.hasOwnProperty(propertys[prop]) && (_item === null || _item === void 0 ? void 0 : _item.type) != 'line') {\n throw new Error(\"Item \".concat(i, \" is wrong,The \").concat(propertys[prop], \" property is not included\"));\n }\n }\n if ((_item === null || _item === void 0 ? void 0 : _item.type) == 'image') {\n if (!_item.hasOwnProperty('width') || !_item.hasOwnProperty('height')) {\n throw new Error(\"Item \".concat(i, \" is wrong,The image width and height is needed\"));\n }\n }\n switch (_item.type) {\n case 'title':\n el += \"<div class='context-map-title' style='\".concat(_item !== null && _item !== void 0 && _item.style ? _item === null || _item === void 0 ? void 0 : _item.style : '', \",font-size:18px;font-weight:600;width:calc(100% - 10px);height:\").concat(_item !== null && _item !== void 0 && _item.height ? _item === null || _item === void 0 ? void 0 : _item.height : 22, \"px;margin:5px;display:flex'>\\n <div>\").concat(_item.content, \"</div>\\n </div>\");\n break;\n case 'line':\n el += \"<hr class='context-map-line' style='display: block;\\n flex: 1 1 100%;\\n height: 0px;\\n max-height: 0px;\\n opacity: 0.12;\\n transition: inherit;\\n border-style: solid;\\n border-width: thin 0 0 0;' aria-orientation=\\\"horizontal\\\" role=\\\"separator\\\">\";\n break;\n case 'btn':\n el += \"<div class='context-map-btn' style='\".concat(_item !== null && _item !== void 0 && _item.style ? _item === null || _item === void 0 ? void 0 : _item.style : '', \",width:calc(100% - 10px);height:\").concat(_item !== null && _item !== void 0 && _item.height ? _item === null || _item === void 0 ? void 0 : _item.height : 22, \"px;margin:5px;display:flex'>\\n <div style='width:14px;height:\").concat(_item !== null && _item !== void 0 && _item.height ? _item === null || _item === void 0 ? void 0 : _item.height : 22, \"px;margin:0 6px'>\\n <img style='display:\").concat(_item.iconPre ? 'block' : 'none', \";height:16px' src='\").concat(_item.iconPre, \"' />\\n </div>\\n \\n <div style='width:calc(100% - 32PX)'>\").concat(_item.content, \"</div>\\n <div style='width:16px;height:\").concat(_item !== null && _item !== void 0 && _item.height ? _item === null || _item === void 0 ? void 0 : _item.height : 22, \"px'>\\n <img src='\").concat(_item.iconApp, \"' style='display:\").concat(_item.iconApp ? 'block' : 'none', \"' />\\n </div>\\n </div>\");\n break;\n case 'text':\n el += \"<div class='context-map-text' style='\".concat(_item !== null && _item !== void 0 && _item.style ? _item === null || _item === void 0 ? void 0 : _item.style : '', \",width:calc(100% - 10px);margin:5px;display:flex'>\\n <div style='width:100%;text-wrap:wrap;'>\").concat(_item.content, \"</div>\\n </div>\");\n break;\n case 'image':\n _item.width = typeof _item.width == 'number' ? _item.width + 'px' : _item.width;\n _item.height = typeof _item.height == 'number' ? _item.height + 'px' : _item.height;\n el += \"<div class='context-map-image' style='\".concat(_item !== null && _item !== void 0 && _item.style ? _item === null || _item === void 0 ? void 0 : _item.style : '', \",width:calc(100% - 10px);margin:5px;display:flex'>\\n <img src='\").concat(_item.content, \"' style='width:\").concat(_item.width, \";height:\").concat(_item.height, \"' />\\n </div>\");\n break;\n default:\n throw new Error('type must is one of \"line, text,title, image, btn\"');\n }\n }\n dom.innerHTML = el;\n var _loop2 = function _loop2() {\n var item = dom.children[_i3];\n var _item = btnlist[_i3];\n if (_typeof(item) == 'object') {\n if (_item.type == 'btn') {\n // item?.addEventListener('mouseenter',(e)=>{\n // let elm = e.target;\n // elm.style.background='#e6f1ff'\n // })\n // item?.addEventListener('mouseleave',(e)=>{\n // let elm = e.target;\n // elm.style.background=''\n // })\n }\n if (_item.event) {\n item === null || item === void 0 || item.addEventListener(_item.event.type, function (_event) {\n _item.event.fun(_event, e);\n });\n }\n }\n };\n for (var _i3 in btnlist) {\n _loop2();\n }\n this.dialog.addTo(this.map).setLngLat({\n lng: lngLat[0],\n lat: lngLat[1]\n }).setDOMContent(dom);\n } else {\n throw new Error('parmas must be array');\n }\n }\n }, {\n key: \"addPlaceLabelsLayer\",\n value: function addPlaceLabelsLayer() {\n this.map.addLayer({\n 'id': 'poi-labels',\n 'type': 'symbol',\n 'source': 'placesLabels',\n 'layout': {\n 'text-field': ['get', 'label'],\n //'text-anchor':'center',\n 'text-size': 18,\n 'text-variable-anchor': ['top', 'bottom', 'left', 'right'],\n //'text-radial-offset': 0.5,\n 'text-justify': 'auto',\n 'icon-image': ['get', 'icon'],\n 'icon-anchor': 'center',\n 'icon-offset': ['get', 'icon-offset'],\n 'text-ignore-placement': true,\n 'icon-ignore-placement': true\n //'icon-text-fit':'width', \n },\n 'paint': {\n 'text-color': ['get', 'text-color'],\n 'icon-color': '#0f3ad0',\n 'text-halo-color': ['get', 'text-border-color'],\n 'text-halo-width': 1\n }\n });\n }\n }, {\n key: \"removePlaceLabelsLayer\",\n value: function removePlaceLabelsLayer() {\n this.map.remove('poi-labels');\n }\n //type = 0 替换\n //type = 1 增加 经纬度一样替换\n }, {\n key: \"updateLabels\",\n value: function updateLabels(labels, style) {\n var _this2 = this;\n var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var label = {\n name: '',\n icon: '',\n coords: []\n };\n var icon = {\n name: '',\n image: '',\n type: ''\n };\n var geojsonFeatures = [];\n if (labels instanceof Array) {\n var _loop3 = function _loop3() {\n var _item = labels[_i];\n for (var _i4 in label) {\n if (!_item.hasOwnProperty(_i4)) {\n throw new Error(\"The index \".concat(_i, \" is wrong , \").concat(_i4, \" property is not included\"));\n }\n }\n if (_item.icon) {\n if (typeof _item.icon == 'string' && !_this2.map.hasImage(_item.icon)) {\n var imgUrl = \"data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" style='fill:%230f3ad0' width=\\\"24\\\" height=\\\"24\\\">%3Cpath d=\\\"\".concat(_mdi_js__WEBPACK_IMPORTED_MODULE_14__[_item.icon], \"\\\"/>%3C/svg>\");\n var image = new Image(20, 20);\n image.src = imgUrl;\n image.onload = function (e) {\n if (!_this2.map.hasImage(_item.icon)) {\n _this2.map.addImage(_item.icon, e.target);\n }\n };\n }\n } else {\n //this.map.\n }\n geojsonFeatures.push({\n 'type': 'Feature',\n 'properties': {\n 'label': _item.name,\n 'text-color': '#0f3ad0',\n 'text-border-color': '#fff',\n 'icon': _item.icon,\n 'icon-offset': [_item.name.length * -10, 10]\n },\n 'geometry': {\n 'type': 'Point',\n 'coordinates': (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)(_item.coords)\n }\n });\n };\n for (var _i in labels) {\n _loop3();\n }\n if (type == 0) {\n this.placesLabels.features = geojsonFeatures;\n } else {\n var _loop4 = function _loop4() {\n var item = geojsonFeatures[i];\n var index = _this2.placesLabels.features.findIndex(function (a) {\n return a.coordinates == item.coords;\n });\n if (index >= 0) {\n _this2.placesLabels.features[index] = item;\n } else {\n _this2.placesLabels.features.push(item);\n }\n };\n for (var i in geojsonFeatures) {\n _loop4();\n }\n }\n var placesLabelsSource = this.map.getSource('placesLabels');\n placesLabelsSource.setData(this.placesLabels);\n // this.labelLayer.setData(this.placesLabels)\n // console.log(this.labelLayer)\n } else {\n throw new Error(\"The params 0 must be array\");\n }\n }\n }, {\n key: \"addMarker\",\n value: function addMarker(marker) {\n this.map.addMarker(marker);\n this.markers.push(marker);\n }\n }, {\n key: \"getMarker\",\n value: function getMarker(id) {\n return this.markers.find(function (a) {\n return a.id == id;\n });\n }\n\n //获取指定位置指定距离截图\n }, {\n key: \"getMapImageByDistance\",\n value: function getMapImageByDistance(center, distance) {\n var imageList = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];\n var config = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {\n target: null,\n style: 'http://192.168.11.93:1234/api/styles/osm',\n type: 'blob',\n pix: {\n w: 1024,\n h: 1024\n },\n callback: function callback() {}\n };\n var target;\n config = Object.assign({}, {\n target: null,\n type: 'blob',\n delay: 300,\n pix: {\n w: 1024,\n h: 1024\n },\n opacity: 0.7,\n style: 'http://192.168.11.93:1234/api/styles/osm',\n callback: function callback() {}\n }, config);\n var bounds = (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.getLayerMapPosition)(distance, (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)(center));\n if (!config.target) {\n target = document.createElement('div');\n } else {\n target = config.target;\n }\n var pix = config.pix;\n target.style = \"width:\".concat(pix.w, \"px;height:\").concat(pix.h, \"px;z-index:-1;\");\n document.body.appendChild(target);\n var scene = new _lib_antv_l7__WEBPACK_IMPORTED_MODULE_0__.Scene({\n id: target,\n // map: new Mapbox({\n // mapInstance: map,\n // }),\n map: new _lib_antv_l7_maps__WEBPACK_IMPORTED_MODULE_13__[\"default\"]({\n style: config.style,\n preserveDrawingBuffer: true,\n //center:transform([114.7198975,23.0446]),\n bounds: [bounds[0], bounds[2]],\n container: target,\n opacity: 0.7,\n pitch: 0,\n zoom: 0,\n rotation: 0,\n token: '' //'pk.eyJ1Ijoid2hpdGVidWxkaW5nIiwiYSI6ImNsc3UwaXlnZDIwbDkybG1qbXJ6YnRtcmwifQ.jtQeo0gt3UNTCWw5FEyv_w',\n })\n });\n var map = scene.map;\n map.on('load', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var base64, scanLayer, i, a, _base;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n if (!(!imageList || imageList.length == 0)) {\n _context.next = 5;\n break;\n }\n base64 = map._canvas.toDataURL();\n if (config.type == 'download') {\n (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.downloadFileByBase64)(base64, (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.guid)());\n } //downloadFileByBase64(base64,guid())\n else if (config.type == 'blob') {\n config.callback((0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.downloadFileBlobByBase64)(base64));\n }\n _context.next = 17;\n break;\n case 5:\n scanLayer = map.getLayer('threescan-layer');\n if (!scanLayer) {\n scanLayer = new _src_components_index_js__WEBPACK_IMPORTED_MODULE_9__.ThreeScanLayer('threescan-layer', {\n opacity: config.opacity,\n textClass: ' map-time zmax '\n });\n map.addLayer(scanLayer);\n }\n _context.t0 = _regeneratorRuntime().keys(imageList);\n case 8:\n if ((_context.t1 = _context.t0()).done) {\n _context.next = 17;\n break;\n }\n i = _context.t1.value;\n a = imageList[i];\n _context.next = 13;\n return scanLayer.drawImageList(a, config.delay);\n case 13:\n _base = _context.sent;\n // map.getCanvas().toDataURL()\n config.callback((0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.downloadFileBlobByBase64)(_base));\n _context.next = 8;\n break;\n case 17:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n })));\n }\n\n //获取指定位置指定距离截图\n }, {\n key: \"getMapImageWithScan\",\n value: function getMapImageWithScan(_center, distance, imgList, _target) {\n var downloadType = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'file';\n var callback = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : null;\n if (imgList instanceof Array) {\n var jsZip = new (jszip__WEBPACK_IMPORTED_MODULE_10___default())();\n var _gif = new GIF({\n repeat: 0,\n workers: 2,\n quality: 64,\n workerScript: (0,_src_components_gif_gif_worker_js__WEBPACK_IMPORTED_MODULE_12__.getGifWorker)(),\n debug: true\n });\n if (imgList.length == 0) return;\n var target;\n var dataUrlList = [];\n var center = (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)(_center);\n var bounds = (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.getLayerMapPosition)(distance, center);\n if (!_target) target = document.createElement('div');else target = _target;\n var pix = 1024;\n target.style = \"width:\".concat(pix, \"px;height:\").concat(pix, \"px;z-index:1;position:relative;\");\n document.body.appendChild(target);\n var scene = new _lib_antv_l7__WEBPACK_IMPORTED_MODULE_0__.Scene({\n id: target,\n // map: new Mapbox({\n // mapInstance: map,\n // }),\n map: new _lib_antv_l7_maps__WEBPACK_IMPORTED_MODULE_13__[\"default\"]({\n style: 'http://192.168.11.93:1234/api/styles/osm',\n preserveDrawingBuffer: true,\n center: center,\n bounds: [bounds[0], bounds[2]],\n fadeDuration: 0,\n pitch: 0,\n zoom: 0,\n rotation: 0,\n token: '' //'pk.eyJ1Ijoid2hpdGVidWxkaW5nIiwiYSI6ImNsc3UwaXlnZDIwbDkybG1qbXJ6YnRtcmwifQ.jtQeo0gt3UNTCWw5FEyv_w',\n })\n });\n var map = scene.map;\n map.on('load', function () {\n //添加图层\n var _canLayer = new _src_components_index_js__WEBPACK_IMPORTED_MODULE_9__.ScanLayer('scanimage');\n var _canvas = target.getElementsByClassName('mapboxgl-canvas')[0];\n var i = 0;\n var _interval = setInterval(function () {\n if (i >= imgList.length) {\n clearInterval(_interval);\n setTimeout(function () {\n callback ? callback() : '';\n }, 500);\n return;\n }\n var url = imgList[i];\n map.loadImage(url, function (err, image) {\n var _i = i;\n if (err) {\n throw new Error(err);\n }\n _canLayer.drawList({\n id: 'SD01',\n image: image,\n coords: (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.getLayerMapPosition)(distance, _center)\n });\n _canLayer.renderBack = function () {\n if (dataUrlList.findIndex(function (a) {\n return a.i == _i;\n }) < 0) {\n dataUrlList.push({\n i: _i,\n base64: _canvas.toDataURL()\n });\n i += 1;\n if (downloadType == 'gif') {\n _gif.addFrame(_canvas, {\n delay: 1000,\n copy: true\n });\n }\n }\n if (_i == imgList.length - 1) {\n _canLayer.renderBack = null;\n if (downloadType == 'file') {\n dataUrlList.forEach(function (a) {\n return (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.downloadFileByBase64)(a.base64, a.i + '.png');\n });\n }\n if (downloadType == 'zip') {\n dataUrlList.forEach(function (a) {\n return jsZip.file(a.i + '.png', a.base64.replace(/^data:image\\/(png|jpg);base64,/, \"\"), {\n base64: true\n });\n });\n jsZip.generateAsync({\n type: \"blob\"\n }).then(function (blob) {\n var url = window.URL.createObjectURL(blob);\n (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.downloadFile)(url, \"pnglist.zip\");\n });\n }\n if (downloadType == 'obj') {\n return dataUrlList;\n }\n if (downloadType == 'gif') {\n // 将每一帧渲染成一张完成的gif\n _gif.render();\n _gif.on('finished', function (blob) {\n var url = URL.createObjectURL(blob);\n (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.downloadFile)(url, \"pnglist.gif\");\n });\n }\n }\n };\n });\n }, 200);\n setTimeout(function () {\n map.addLayer(_canLayer);\n }, 201);\n });\n target.remove();\n } else throw new Error('The params 2 image list must be array ');\n }\n\n //设置底图图层\n }, {\n key: \"setTile\",\n value: function setTile(key) {\n var currentFillLayerIndex = this.map.style.stylesheet.layers.findIndex(function (a) {\n return a.type != 'fill' && a.type != 'background';\n });\n var beforeId = this.map.style.stylesheet.layers[currentFillLayerIndex].id;\n if (key == 'standard') {\n if (this.map.getLayer('yingxiang')) this.map.removeLayer('yingxiang');\n if (this.map.getLayer('tiandi')) this.map.removeLayer('tiandi');\n }\n if (key == 'satellite') {\n if (this.map.getLayer('tiandi')) this.map.removeLayer('tiandi');\n if (!this.map.getLayer('yingxiang')) {\n this.map.addLayer({\n \"id\": \"yingxiang\",\n \"source\": \"yingxiang\",\n \"type\": \"raster\"\n }, beforeId);\n }\n ;\n }\n if (key == 'tiandi') {\n if (this.map.getLayer('yingxiang')) this.map.removeLayer('yingxiang');\n if (!this.map.getLayer('tiandi')) {\n this.map.addLayer({\n \"id\": \"tiandi\",\n \"source\": \"tianditu\",\n \"type\": \"raster\"\n }, beforeId);\n }\n ;\n }\n }\n }, {\n key: \"jumpTo\",\n value: function jumpTo(_ref2) {\n var _ref2$center = _ref2.center,\n center = _ref2$center === void 0 ? (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)(this.config.center) : _ref2$center,\n _ref2$zoom = _ref2.zoom,\n zoom = _ref2$zoom === void 0 ? this.config.zoom : _ref2$zoom,\n _ref2$pitch = _ref2.pitch,\n pitch = _ref2$pitch === void 0 ? this.config.pitch : _ref2$pitch,\n _ref2$bearing = _ref2.bearing,\n bearing = _ref2$bearing === void 0 ? this.config.bearing : _ref2$bearing;\n this.map.jumpTo({\n center: center,\n zoom: zoom,\n pitch: pitch,\n bearing: bearing\n });\n }\n }, {\n key: \"removeLayer\",\n value: function removeLayer(layerId) {\n if (this.map.getLayer(layerId)) {\n this.map.removeLayer(layerId);\n }\n }\n }]);\n}();\n\n//# sourceURL=webpack://@ohuoy/easymap/./index.js?");
201
201
 
202
202
  /***/ }),
203
203
 
@@ -4980,7 +4980,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
4980
4980
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4981
4981
 
4982
4982
  "use strict";
4983
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ EasyMapMarker)\n/* harmony export */ });\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\n/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/util */ \"./src/utils/util.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\nvar EasyMapMarker = /*#__PURE__*/function () {\n function EasyMapMarker(_config) {\n _classCallCheck(this, EasyMapMarker);\n _defineProperty(this, \"marker\", void 0);\n _defineProperty(this, \"config\", {\n id: '',\n position: [117.2, 22.4],\n popup: null,\n map: {},\n event: null\n });\n _defineProperty(this, \"markerList\", []);\n if (_config) {\n if (_config instanceof Array) {\n var pointList = [];\n for (var j in _config) {\n var en = _config[j];\n for (var i in this.config) {\n if (!en.hasOwnProperty(i) && this.config[i] != null) {\n throw new Error(i + ' property is needed');\n }\n }\n var config = Object.assign({}, this.config, en);\n var position = (0,_utils_util__WEBPACK_IMPORTED_MODULE_1__.transform)(config.position);\n var marker = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Marker().setLngLat(position);\n if (config.popup) {\n marker.setPopup(config.popup);\n }\n marker.addTo(config.map);\n this.markerList.push(marker);\n pointList.push(position);\n }\n _config[0].map.fitBounds((0,_utils_util__WEBPACK_IMPORTED_MODULE_1__.getBBox)(pointList), {\n padding: {\n top: 35,\n bottom: 25,\n left: 15,\n right: 15\n }\n });\n } else {\n for (var _i in this.config) {\n if (!_config.hasOwnProperty(_i) && this.config[_i] != null) {\n throw new Error(_i + ' property is needed');\n }\n }\n this.config = Object.assign({}, this.config, _config);\n this.marker = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Marker().setLngLat((0,_utils_util__WEBPACK_IMPORTED_MODULE_1__.transform)(this.config.position));\n if (this.config.popup) {\n this.marker.setPopup(this.config.popup);\n }\n this.marker.addTo(this.config.map);\n }\n } else {\n throw new Error('no config');\n }\n }\n return _createClass(EasyMapMarker, [{\n key: \"moveTo\",\n value: function moveTo(location) {\n var zoom = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 12.5;\n var _location = (0,_utils_util__WEBPACK_IMPORTED_MODULE_1__.transform)(location);\n this.marker.setLngLat(_location);\n var point = this.config.map.project(_location);\n var isOnsurface = this.config.map.isPointOnSurface(point);\n if (!isOnsurface) {\n this.config.map.jumpTo({\n center: _location,\n zoom: zoom\n });\n }\n }\n }, {\n key: \"updateMarkerList\",\n value: function updateMarkerList(list) {\n if (list.length == 0) return;\n //移除marker\n this.markerList.map(function (a) {\n a.remove();\n });\n this.markerList = [];\n var pointList = [];\n for (var j in list) {\n var en = list[j];\n for (var i in this.config) {\n if (!en.hasOwnProperty(i) && this.config[i] != null) {\n throw new Error(i + ' property is needed');\n }\n var config = Object.assign({}, this.config, en);\n var position = (0,_utils_util__WEBPACK_IMPORTED_MODULE_1__.transform)(config.position);\n var marker = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Marker().setLngLat(position);\n if (config.popup) {\n marker.setPopup(config.popup);\n }\n marker.addTo(config.map);\n this.markerList.push(marker);\n pointList.push(position);\n }\n }\n list[0].map.fitBounds((0,_utils_util__WEBPACK_IMPORTED_MODULE_1__.getBBox)(pointList), {\n padding: {\n top: 25,\n bottom: 25,\n left: 15,\n right: 15\n }\n });\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/EasyMapMarker.js?");
4983
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ EasyMapMarker)\n/* harmony export */ });\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\n/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../utils/util */ \"./src/utils/util.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\nvar EasyMapMarker = /*#__PURE__*/function () {\n function EasyMapMarker(_config) {\n _classCallCheck(this, EasyMapMarker);\n _defineProperty(this, \"marker\", void 0);\n _defineProperty(this, \"config\", {\n id: '',\n position: [117.2, 22.4],\n popup: null,\n map: {},\n event: null\n });\n _defineProperty(this, \"markerList\", []);\n if (_config) {\n if (_config instanceof Array) {\n var pointList = [];\n for (var j in _config) {\n var en = _config[j];\n for (var i in this.config) {\n if (!en.hasOwnProperty(i) && this.config[i] != null) {\n throw new Error(i + ' property is needed');\n }\n }\n var config = Object.assign({}, this.config, en);\n var position = (0,_utils_util__WEBPACK_IMPORTED_MODULE_1__.transform)(config.position);\n var marker = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Marker().setLngLat(position);\n if (config.popup) {\n marker.setPopup(config.popup);\n }\n marker.addTo(config.map);\n this.markerList.push(marker);\n pointList.push(position);\n }\n _config[0].map.fitBounds((0,_utils_util__WEBPACK_IMPORTED_MODULE_1__.getBBox)(pointList), {\n padding: {\n top: 35,\n bottom: 25,\n left: 15,\n right: 15\n }\n });\n } else {\n for (var _i in this.config) {\n if (!_config.hasOwnProperty(_i) && this.config[_i] != null) {\n throw new Error(_i + ' property is needed');\n }\n }\n this.config = Object.assign({}, this.config, _config);\n this.marker = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Marker().setLngLat((0,_utils_util__WEBPACK_IMPORTED_MODULE_1__.transform)(this.config.position));\n if (this.config.popup) {\n this.marker.setPopup(this.config.popup);\n }\n this.marker.addTo(this.config.map);\n }\n } else {\n throw new Error('no config');\n }\n }\n return _createClass(EasyMapMarker, [{\n key: \"setMarkerPopup\",\n value: function setMarkerPopup(popup, _marker) {\n _marker = _marker ? _marker : this.marker;\n if (_marker) {\n _marker.setPopup(popup);\n }\n }\n }, {\n key: \"moveTo\",\n value: function moveTo(location) {\n var zoom = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 12.5;\n var _location = (0,_utils_util__WEBPACK_IMPORTED_MODULE_1__.transform)(location);\n this.marker.setLngLat(_location);\n var point = this.config.map.project(_location);\n var isOnsurface = this.config.map.isPointOnSurface(point);\n if (!isOnsurface) {\n this.config.map.jumpTo({\n center: _location,\n zoom: zoom\n });\n }\n }\n }, {\n key: \"updateMarkerList\",\n value: function updateMarkerList(list) {\n if (list.length == 0) return;\n //移除marker\n this.markerList.map(function (a) {\n a.remove();\n });\n this.markerList = [];\n var pointList = [];\n for (var j in list) {\n var en = list[j];\n for (var i in this.config) {\n if (!en.hasOwnProperty(i) && this.config[i] != null) {\n throw new Error(i + ' property is needed');\n }\n var config = Object.assign({}, this.config, en);\n var position = (0,_utils_util__WEBPACK_IMPORTED_MODULE_1__.transform)(config.position);\n var marker = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"].Marker().setLngLat(position);\n if (config.popup) {\n marker.setPopup(config.popup);\n }\n marker.addTo(config.map);\n this.markerList.push(marker);\n pointList.push(position);\n }\n }\n list[0].map.fitBounds((0,_utils_util__WEBPACK_IMPORTED_MODULE_1__.getBBox)(pointList), {\n padding: {\n top: 25,\n bottom: 25,\n left: 15,\n right: 15\n }\n });\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/EasyMapMarker.js?");
4984
4984
 
4985
4985
  /***/ }),
4986
4986
 
@@ -4991,7 +4991,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
4991
4991
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4992
4992
 
4993
4993
  "use strict";
4994
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ DrawBar)\n/* harmony export */ });\n/* harmony import */ var _mapbox_mapbox_gl_draw__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @mapbox/mapbox-gl-draw */ \"./node_modules/@mapbox/mapbox-gl-draw/index.js\");\n/* harmony import */ var _extendMode_rectmode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./extendMode/rectmode */ \"./src/components/control/extendMode/rectmode.js\");\n/* harmony import */ var _ExtendControlList_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ExtendControlList.js */ \"./src/components/control/ExtendControlList.js\");\n/* harmony import */ var _extendMode_simple_select_rect_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./extendMode/simple_select_rect.js */ \"./src/components/control/extendMode/simple_select_rect.js\");\n/* harmony import */ var _extendMode_direct_select_rect_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./extendMode/direct_select_rect.js */ \"./src/components/control/extendMode/direct_select_rect.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\nvar DrawBar = /*#__PURE__*/function () {\n function DrawBar(map, config) {\n var postion = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : \"bottom-right\";\n _classCallCheck(this, DrawBar);\n _defineProperty(this, \"drawEntity\", null);\n _defineProperty(this, \"drawing\", false);\n var draw = new _mapbox_mapbox_gl_draw__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({\n displayControlsDefault: false,\n // Select which mapbox-gl-draw control buttons to add to the map.\n // controls: {\n // // polygon: true,\n // trash: true\n // },\n // Set mapbox-gl-draw to draw by default.\n // The user does not have to click the polygon control button first.\n //defaultMode: 'draw_polygon'\n // defaultMode:\"none\",\n controls: {},\n modes: Object.assign({\n 'direct_select_rect': _extendMode_direct_select_rect_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n 'simple_select_rect': _extendMode_simple_select_rect_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n 'rect': _extendMode_rectmode__WEBPACK_IMPORTED_MODULE_1__[\"default\"]\n }, _mapbox_mapbox_gl_draw__WEBPACK_IMPORTED_MODULE_0__[\"default\"].modes)\n });\n var drawControl = new _ExtendControlList_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n draw: draw,\n buttons: [\n // {\n // on: 'click',\n // action: () => {\n // drawing = true;\n // draw.changeMode('draw_point');\n // },\n // classes: ['mapbox-gl-draw_ctrl-draw-btn', 'mapbox-gl-draw_point'],\n // title: 'Draw Point (m)'\n // },\n // {\n // on: 'click',\n // action: () => {\n // drawing = true;\n // draw.changeMode('draw_line_string');\n // },\n // classes: ['mapbox-gl-draw_ctrl-draw-btn', 'mapbox-gl-draw_line'],\n // title: 'Draw LineString (l)'\n // },\n // {\n // on: 'click',\n // action: () => {\n // drawing = true;\n // draw.changeMode('draw_polygon');\n // },\n // classes: ['mapbox-gl-draw_ctrl-draw-btn', 'mapbox-gl-draw_polygon'],\n // title: 'Draw Polygon (p)'\n // },\n {\n on: 'click',\n icon: \"<img style='margin:auto;width:100%;height:100%' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 20 20\\\" width=\\\"20\\\" height=\\\"20\\\">%3Cpath d=\\\"m15 12.3v-4.6c.6-.3 1-1 1-1.7 0-1.1-.9-2-2-2-.7 0-1.4.4-1.7 1h-4.6c-.3-.6-1-1-1.7-1-1.1 0-2 .9-2 2 0 .7.4 1.4 1 1.7v4.6c-.6.3-1 1-1 1.7 0 1.1.9 2 2 2 .7 0 1.4-.4 1.7-1h4.6c.3.6 1 1 1.7 1 1.1 0 2-.9 2-2 0-.7-.4-1.4-1-1.7zm-8-.3v-4l1-1h4l1 1v4l-1 1h-4z\\\"/>%3C/svg>'/>\",\n action: function action() {\n // this.drawing = true;\n draw.changeMode('rect');\n },\n classes: ['mapbox-gl-draw_ctrl-draw-btn', 'mapbox-gl-draw_rectangle'],\n title: '划区'\n }, {\n on: 'click',\n action: function action() {\n var selected = draw.getSelectedIds();\n if (selected.length > 0) {\n draw.changeMode('simple_select_rect', {\n featureIds: selected\n });\n draw.trash();\n }\n },\n icon: \"<img style='margin:auto;width:100%;height:100%' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"20\\\" height=\\\"20\\\">%3Cpath d=\\\"M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M9,8H11V17H9V8M13,8H15V17H13V8Z\\\"/>%3C/svg>'/>\",\n classes: ['mapbox-gl-draw_ctrl-draw-btn', 'mapbox-gl-draw_trash'],\n title: '删除'\n }]\n });\n map.addControl(drawControl, postion);\n this.drawEntity = draw;\n // map.on('draw.create', updateArea);\n // map.on('draw.delete', updateArea);\n // map.on('draw.update', updateArea);\n }\n return _createClass(DrawBar, [{\n key: \"getSelected\",\n value: function getSelected() {\n return this.drawEntity.getSelected();\n }\n }, {\n key: \"getAll\",\n value: function getAll() {\n return this.drawEntity.getAll();\n }\n }, {\n key: \"setBoxList\",\n value: function setBoxList(boxList) {\n var _this = this;\n if (boxList.length > 0) {\n boxList.forEach(function (box) {\n if (!box.id) {\n throw new Error('box no have id');\n }\n if (box.points.length < 4) {\n throw new Error('box points less');\n }\n var feature = {\n \"id\": box.id,\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"coordinates\": [box.points],\n \"type\": \"Polygon\"\n }\n };\n _this.drawEntity.add(feature);\n });\n var selected = draw.getSelectedIds();\n if (selected.length > 0) {\n draw.changeMode('simple_select_rect', {\n featureIds: selected\n });\n }\n }\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/control/DrawBar.js?");
4994
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ DrawBar)\n/* harmony export */ });\n/* harmony import */ var _mapbox_mapbox_gl_draw__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @mapbox/mapbox-gl-draw */ \"./node_modules/@mapbox/mapbox-gl-draw/index.js\");\n/* harmony import */ var _extendMode_rectmode__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./extendMode/rectmode */ \"./src/components/control/extendMode/rectmode.js\");\n/* harmony import */ var _ExtendControlList_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ExtendControlList.js */ \"./src/components/control/ExtendControlList.js\");\n/* harmony import */ var _extendMode_simple_select_rect_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./extendMode/simple_select_rect.js */ \"./src/components/control/extendMode/simple_select_rect.js\");\n/* harmony import */ var _extendMode_direct_select_rect_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./extendMode/direct_select_rect.js */ \"./src/components/control/extendMode/direct_select_rect.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\nvar DrawBar = /*#__PURE__*/function () {\n function DrawBar(map, config) {\n var postion = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : \"bottom-right\";\n _classCallCheck(this, DrawBar);\n _defineProperty(this, \"drawEntity\", null);\n _defineProperty(this, \"drawing\", false);\n var draw = new _mapbox_mapbox_gl_draw__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({\n displayControlsDefault: false,\n // Select which mapbox-gl-draw control buttons to add to the map.\n // controls: {\n // // polygon: true,\n // trash: true\n // },\n // Set mapbox-gl-draw to draw by default.\n // The user does not have to click the polygon control button first.\n //defaultMode: 'draw_polygon'\n // defaultMode:\"none\",\n controls: {},\n modes: Object.assign({\n 'direct_select_rect': _extendMode_direct_select_rect_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n 'simple_select_rect': _extendMode_simple_select_rect_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n 'rect': _extendMode_rectmode__WEBPACK_IMPORTED_MODULE_1__[\"default\"]\n }, _mapbox_mapbox_gl_draw__WEBPACK_IMPORTED_MODULE_0__[\"default\"].modes)\n });\n var drawControl = new _ExtendControlList_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n draw: draw,\n buttons: [\n // {\n // on: 'click',\n // action: () => {\n // drawing = true;\n // draw.changeMode('draw_point');\n // },\n // classes: ['mapbox-gl-draw_ctrl-draw-btn', 'mapbox-gl-draw_point'],\n // title: 'Draw Point (m)'\n // },\n // {\n // on: 'click',\n // action: () => {\n // drawing = true;\n // draw.changeMode('draw_line_string');\n // },\n // classes: ['mapbox-gl-draw_ctrl-draw-btn', 'mapbox-gl-draw_line'],\n // title: 'Draw LineString (l)'\n // },\n // {\n // on: 'click',\n // action: () => {\n // drawing = true;\n // draw.changeMode('draw_polygon');\n // },\n // classes: ['mapbox-gl-draw_ctrl-draw-btn', 'mapbox-gl-draw_polygon'],\n // title: 'Draw Polygon (p)'\n // },\n {\n on: 'click',\n icon: \"<img style='margin:auto;width:100%;height:100%' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 20 20\\\" width=\\\"20\\\" height=\\\"20\\\">%3Cpath d=\\\"m15 12.3v-4.6c.6-.3 1-1 1-1.7 0-1.1-.9-2-2-2-.7 0-1.4.4-1.7 1h-4.6c-.3-.6-1-1-1.7-1-1.1 0-2 .9-2 2 0 .7.4 1.4 1 1.7v4.6c-.6.3-1 1-1 1.7 0 1.1.9 2 2 2 .7 0 1.4-.4 1.7-1h4.6c.3.6 1 1 1.7 1 1.1 0 2-.9 2-2 0-.7-.4-1.4-1-1.7zm-8-.3v-4l1-1h4l1 1v4l-1 1h-4z\\\"/>%3C/svg>'/>\",\n action: function action() {\n // this.drawing = true;\n draw.changeMode('rect');\n },\n classes: ['mapbox-gl-draw_ctrl-draw-btn', 'mapbox-gl-draw_rectangle'],\n title: '划区'\n }, {\n on: 'click',\n action: function action() {\n var selected = draw.getSelectedIds();\n if (selected.length > 0) {\n draw.changeMode('simple_select_rect', {\n featureIds: selected\n });\n draw.trash();\n }\n },\n icon: \"<img style='margin:auto;width:100%;height:100%' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"20\\\" height=\\\"20\\\">%3Cpath d=\\\"M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M9,8H11V17H9V8M13,8H15V17H13V8Z\\\"/>%3C/svg>'/>\",\n classes: ['mapbox-gl-draw_ctrl-draw-btn', 'mapbox-gl-draw_trash'],\n title: '删除'\n }]\n });\n map.addControl(drawControl, postion);\n this.drawEntity = draw;\n // map.on('draw.create', updateArea);\n // map.on('draw.delete', updateArea);\n // map.on('draw.update', updateArea);\n }\n return _createClass(DrawBar, [{\n key: \"getSelected\",\n value: function getSelected() {\n return this.drawEntity.getSelected();\n }\n }, {\n key: \"getAll\",\n value: function getAll() {\n return this.drawEntity.getAll();\n }\n }, {\n key: \"setBoxList\",\n value: function setBoxList(boxList) {\n var _this = this;\n if (boxList.length > 0) {\n boxList.forEach(function (box) {\n if (!box.id) {\n throw new Error('box no have id');\n }\n if (box.points.length < 4) {\n throw new Error('box points less');\n }\n var feature = {\n \"id\": box.id,\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"coordinates\": [box.points],\n \"type\": \"Polygon\"\n }\n };\n _this.drawEntity.add(feature);\n });\n var selected = draw.getSelectedIds();\n if (selected.length > 0) {\n draw.changeMode('simple_select_rect', {\n featureIds: selected\n });\n }\n }\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n this.drawEntity = null;\n this.drawing = false;\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/control/DrawBar.js?");
4995
4995
 
4996
4996
  /***/ }),
4997
4997
 
@@ -5013,7 +5013,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
5013
5013
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5014
5014
 
5015
5015
  "use strict";
5016
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ TilesBar)\n/* harmony export */ });\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar TilesBar = /*#__PURE__*/function () {\n function TilesBar() {\n _classCallCheck(this, TilesBar);\n _defineProperty(this, \"_map\", void 0);\n _defineProperty(this, \"_container\", void 0);\n _defineProperty(this, \"config\", {\n btnClass: ''\n });\n }\n return _createClass(TilesBar, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n this._map = map;\n this._container = document.createElement('div');\n this._container.className = 'mapboxgl-ctrl mapboxgl-ctrl-group';\n this._container.innerHTML += \"<div aria-label=\\\"tilesbox\\\" class='mapboxgl-ctrl-tilesbox' style='display:flex;flex-direction:column;position:absolute;top:-100px;right:50px;' ></div>\";\n this._container.innerHTML += \"\\n <div class=\\\"\\\" style=\\\"position:relative\\\">\\n <button class=\\\" \".concat(this.config.btnClass, \" tileschange\\\" type=\\\"button\\\" aria-label=\\\"tiles\\\" aria-disabled=\\\"false\\\">\\n <span style='display:flex;align-item:center;' class=\\\"mapboxgl-ctrl-icon\\\" aria-hidden=\\\"true\\\" title=\\\"\\u56FE\\u5C42\\\">\\n <img style='margin:auto;' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 48 48\\\" width=\\\"24\\\" height=\\\"24\\\">%3Cpath d=\\\"m24 41.5-18-14 2.5-1.85L24 37.7l15.5-12.05L42 27.5Zm0-7.6-18-14 18-14 18 14Zm0-15.05Zm0 11.25 13.1-10.2L24 9.7 10.9 19.9Z\\\"/>%3C/svg>'/>\\n </span>\\n \\n </button>\\n <div class=\\\"mapboxgl-legend-list\\\" style='position:absolute;width:80px;background:#fff;margin:0 28px;top:0px;color:#000;display:none;'>\\n <div class=\\\"mapboxgl-btn-standard\\\" style='width:100%;display:flex;'>\\n <span style='display:flex;align-item:center;' class=\\\"mapboxgl-ctrl-icon\\\" aria-hidden=\\\"true\\\" title=\\\"\\u56FE\\u5C42\\\">\\n <img style='margin:auto;' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"24\\\" height=\\\"24\\\">%3Cpath d=\\\"M17.9,17.39C17.64,16.59 16.89,16 16,16H15V13A1,1 0 0,0 14,12H8V10H10A1,1 0 0,0 11,9V7H13A2,2 0 0,0 15,5V4.59C17.93,5.77 20,8.64 20,12C20,14.08 19.2,15.97 17.9,17.39M11,19.93C7.05,19.44 4,16.08 4,12C4,11.38 4.08,10.78 4.21,10.21L9,15V16A2,2 0 0,0 11,18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z\\\"/>%3C/svg>'/>\\n </span>\\n <button style='width:100%'>\\u6807\\u51C6</button>\\n </div>\\n <div class=\\\"mapboxgl-btn-satellite\\\" style='width:100%;display:flex;'>\\n <span style='display:flex;align-item:center;' class=\\\"mapboxgl-ctrl-icon\\\" aria-hidden=\\\"true\\\" title=\\\"\\u56FE\\u5C42\\\">\\n <img style='margin:auto;' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"24\\\" height=\\\"24\\\">%3Cpath d=\\\"M5,3C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H5M15.78,5H19V17.18C18.74,16.38 17.69,15.79 16.8,15.79H15.8V12.79A1,1 0 0,0 14.8,11.79H8.8V9.79H10.8A1,1 0 0,0 11.8,8.79V6.79H13.8C14.83,6.79 15.67,6 15.78,5M5,10.29L9.8,14.79V15.79C9.8,16.9 10.7,17.79 11.8,17.79V19H5V10.29Z\\\"/>%3C/svg>'/>\\n </span>\\n <button style='width:100%'>\\u536B\\u661F\\u56FE</button>\\n </div>\\n <div class=\\\"mapboxgl-btn-tiandi\\\" style='width:100%;display:flex;'>\\n <span style='display:flex;align-item:center;' class=\\\"mapboxgl-ctrl-icon\\\" aria-hidden=\\\"true\\\" title=\\\"\\u56FE\\u5C42\\\">\\n <img style='margin:auto;' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"24\\\" height=\\\"24\\\">%3Cpath d=\\\"M9,7V9H11V17H13V9H15V7H9M5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3Z\\\"/>%3C/svg>'/>\\n </span>\\n <button style='width:100%'>\\u5929\\u5730\\u56FE</button>\\n </div>\\n </div> \\n </div>\\n \");\n var btnStandard = this._container.getElementsByClassName('mapboxgl-btn-standard')[0];\n var btnSatellite = this._container.getElementsByClassName('mapboxgl-btn-satellite')[0];\n var btnTiandi = this._container.getElementsByClassName('mapboxgl-btn-tiandi')[0];\n var box = this._container.getElementsByClassName('mapboxgl-legend-list')[0];\n var btn = this._container.getElementsByClassName('tileschange')[0];\n btn.addEventListener('mouseenter', function () {\n box.style.display = 'block';\n });\n this._container.addEventListener('mouseleave', function () {\n box.style.display = 'none';\n });\n this.addEvent(btnStandard, 'standard');\n this.addEvent(btnSatellite, 'satellite');\n this.addEvent(btnTiandi, 'tiandi');\n return this._container;\n }\n }, {\n key: \"addEvent\",\n value: function addEvent(btn, key) {\n var _this = this;\n btn.addEventListener('click', function () {\n var currentFillLayerIndex = _this._map.style.stylesheet.layers.findIndex(function (a) {\n return a.type != 'fill' && a.type != 'background';\n });\n var beforeId = _this._map.style.stylesheet.layers[currentFillLayerIndex].id;\n if (key == 'standard') {\n if (_this._map.getLayer('yingxiang')) _this._map.removeLayer('yingxiang');\n if (_this._map.getLayer('tiandi')) _this._map.removeLayer('tiandi');\n }\n if (key == 'satellite') {\n if (_this._map.getLayer('tiandi')) _this._map.removeLayer('tiandi');\n if (!_this._map.getLayer('yingxiang')) {\n _this._map.addLayer({\n \"id\": \"yingxiang\",\n \"source\": \"yingxiang\",\n \"type\": \"raster\"\n }, beforeId);\n }\n ;\n }\n if (key == 'tiandi') {\n if (_this._map.getLayer('yingxiang')) _this._map.removeLayer('yingxiang');\n if (!_this._map.getLayer('tiandi')) {\n _this._map.addLayer({\n \"id\": \"tiandi\",\n \"source\": \"tianditu\",\n \"type\": \"raster\"\n }, beforeId);\n }\n ;\n }\n });\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/control/TilesBar.js?");
5016
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ TilesBar)\n/* harmony export */ });\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar TilesBar = /*#__PURE__*/function () {\n function TilesBar(openBtn) {\n _classCallCheck(this, TilesBar);\n _defineProperty(this, \"_map\", void 0);\n _defineProperty(this, \"_container\", void 0);\n _defineProperty(this, \"config\", {\n btnClass: ''\n });\n _defineProperty(this, \"openBtn\", ['standard', 'satellite', 'tiandi', 'gaode', 'arcgis']);\n this.openBtn = ['standard', 'satellite', 'tiandi'];\n }\n return _createClass(TilesBar, [{\n key: \"getBtnList\",\n value: function getBtnList() {\n var htmlStr = '';\n var _iterator = _createForOfIteratorHelper(this.openBtn),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var b = _step.value;\n if (b == 'standard') {\n htmlStr += \"<div class=\\\"mapboxgl-btn-standard\\\" style='width:100%;display:flex;'>\\n <span style='display:flex;align-item:center;' class=\\\"mapboxgl-ctrl-icon\\\" aria-hidden=\\\"true\\\" title=\\\"\\u56FE\\u5C42\\\">\\n <img style='margin:auto;' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"24\\\" height=\\\"24\\\">%3Cpath d=\\\"M17.9,17.39C17.64,16.59 16.89,16 16,16H15V13A1,1 0 0,0 14,12H8V10H10A1,1 0 0,0 11,9V7H13A2,2 0 0,0 15,5V4.59C17.93,5.77 20,8.64 20,12C20,14.08 19.2,15.97 17.9,17.39M11,19.93C7.05,19.44 4,16.08 4,12C4,11.38 4.08,10.78 4.21,10.21L9,15V16A2,2 0 0,0 11,18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z\\\"/>%3C/svg>'/>\\n </span>\\n <button style='width:100%'>\\u6807\\u51C6</button>\\n </div> \\n \";\n }\n if (b == 'satellite') {\n htmlStr += \" <div class=\\\"mapboxgl-btn-satellite\\\" style='width:100%;display:flex;'>\\n <span style='display:flex;align-item:center;' class=\\\"mapboxgl-ctrl-icon\\\" aria-hidden=\\\"true\\\" title=\\\"\\u56FE\\u5C42\\\">\\n <img style='margin:auto;' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"24\\\" height=\\\"24\\\">%3Cpath d=\\\"M5,3C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H5M15.78,5H19V17.18C18.74,16.38 17.69,15.79 16.8,15.79H15.8V12.79A1,1 0 0,0 14.8,11.79H8.8V9.79H10.8A1,1 0 0,0 11.8,8.79V6.79H13.8C14.83,6.79 15.67,6 15.78,5M5,10.29L9.8,14.79V15.79C9.8,16.9 10.7,17.79 11.8,17.79V19H5V10.29Z\\\"/>%3C/svg>'/>\\n </span>\\n <button style='width:100%'>\\u536B\\u661F\\u56FE</button>\\n </div>\";\n }\n if (b == 'tiandi') {\n htmlStr += \" <div class=\\\"mapboxgl-btn-tiandi\\\" style='width:100%;display:flex;'>\\n <span style='display:flex;align-item:center;' class=\\\"mapboxgl-ctrl-icon\\\" aria-hidden=\\\"true\\\" title=\\\"\\u56FE\\u5C42\\\">\\n <img style='margin:auto;' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"24\\\" height=\\\"24\\\">%3Cpath d=\\\"M9,7V9H11V17H13V9H15V7H9M5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3Z\\\"/>%3C/svg>'/>\\n </span>\\n <button style='width:100%'>\\u5929\\u5730\\u56FE</button>\\n </div>\";\n }\n if (b == 'gaode') {\n htmlStr += \" <div class=\\\"mapboxgl-btn-gaode\\\" style='width:100%;display:flex;'>\\n <span style='display:flex;align-item:center;' class=\\\"mapboxgl-ctrl-icon\\\" aria-hidden=\\\"true\\\" title=\\\"\\u56FE\\u5C42\\\">\\n <img style='margin:auto;' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"24\\\" height=\\\"24\\\">%3Cpath d=\\\"M9,7V9H11V17H13V9H15V7H9M5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3Z\\\"/>%3C/svg>'/>\\n </span>\\n <button style='width:100%'>\\u9AD8\\u5FB7\\u5730\\u56FE</button>\\n </div>\";\n }\n if (b == 'arcgis') {\n htmlStr += \" <div class=\\\"mapboxgl-btn-arcgis\\\" style='width:100%;display:flex;'>\\n <span style='display:flex;align-item:center;' class=\\\"mapboxgl-ctrl-icon\\\" aria-hidden=\\\"true\\\" title=\\\"\\u56FE\\u5C42\\\">\\n <img style='margin:auto;' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"24\\\" height=\\\"24\\\">%3Cpath d=\\\"M9,7V9H11V17H13V9H15V7H9M5,3H19A2,2 0 0,1 21,5V19A2,2 0 0,1 19,21H5A2,2 0 0,1 3,19V5A2,2 0 0,1 5,3Z\\\"/>%3C/svg>'/>\\n </span>\\n <button style='width:100%'>ArcGis</button>\\n </div>\";\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n return htmlStr;\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map) {\n this._map = map;\n this._container = document.createElement('div');\n this._container.className = 'mapboxgl-ctrl mapboxgl-ctrl-group';\n this._container.innerHTML += \"<div aria-label=\\\"tilesbox\\\" class='mapboxgl-ctrl-tilesbox' style='display:flex;flex-direction:column;position:absolute;top:-100px;right:50px;' ></div>\";\n this._container.innerHTML += \"\\n <div class=\\\"\\\" style=\\\"position:relative\\\">\\n <button class=\\\" \".concat(this.config.btnClass, \" tileschange\\\" type=\\\"button\\\" aria-label=\\\"tiles\\\" aria-disabled=\\\"false\\\">\\n <span style='display:flex;align-item:center;' class=\\\"mapboxgl-ctrl-icon\\\" aria-hidden=\\\"true\\\" title=\\\"\\u56FE\\u5C42\\\">\\n <img style='margin:auto;' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 48 48\\\" width=\\\"24\\\" height=\\\"24\\\">%3Cpath d=\\\"m24 41.5-18-14 2.5-1.85L24 37.7l15.5-12.05L42 27.5Zm0-7.6-18-14 18-14 18 14Zm0-15.05Zm0 11.25 13.1-10.2L24 9.7 10.9 19.9Z\\\"/>%3C/svg>'/>\\n </span>\\n \\n </button>\\n <div class=\\\"mapboxgl-legend-list\\\" style='position:absolute;width:80px;background:#fff;margin:0 28px;top:0px;color:#000;display:none;'>\\n \").concat(this.getBtnList(), \"\\n </div> \\n </div>\\n \");\n var btnStandard = this._container.getElementsByClassName('mapboxgl-btn-standard')[0];\n var btnSatellite = this._container.getElementsByClassName('mapboxgl-btn-satellite')[0];\n var btnTiandi = this._container.getElementsByClassName('mapboxgl-btn-tiandi')[0];\n var btnGaode = this._container.getElementsByClassName('mapboxgl-btn-gaode')[0];\n var btnArcgis = this._container.getElementsByClassName('mapboxgl-btn-arcgis')[0];\n var box = this._container.getElementsByClassName('mapboxgl-legend-list')[0];\n var btn = this._container.getElementsByClassName('tileschange')[0];\n btn.addEventListener('mouseenter', function () {\n box.style.display = 'block';\n var pos = box.getBoundingClientRect();\n if (pos.x > document.body.clientWidth / 2) {\n box.style.right = 0;\n box.style.left = '';\n } else {\n box.style.right = '';\n box.style.left = 0;\n }\n });\n this._container.addEventListener('mouseleave', function () {\n box.style.display = 'none';\n });\n btnStandard ? this.addEvent(btnStandard, 'standard') : '';\n btnSatellite ? this.addEvent(btnSatellite, 'satellite') : '';\n btnTiandi ? this.addEvent(btnTiandi, 'tiandi') : '';\n btnGaode ? this.addEvent(btnGaode, 'gaode') : '';\n btnArcgis ? this.addEvent(btnArcgis, 'arcgis') : '';\n return this._container;\n }\n }, {\n key: \"addEvent\",\n value: function addEvent(btn, key) {\n var _this = this;\n btn.addEventListener('click', function () {\n var currentFillLayerIndex = _this._map.style.stylesheet.layers.findIndex(function (a) {\n return a.type != 'fill' && a.type != 'background';\n });\n var beforeId = _this._map.style.stylesheet.layers[currentFillLayerIndex].id;\n if (key == 'standard') {\n if (_this._map.getLayer('yingxiang')) _this._map.removeLayer('yingxiang');\n if (_this._map.getLayer('tiandi')) _this._map.removeLayer('tiandi');\n if (_this._map.getLayer('gode')) _this._map.removeLayer('gode');\n if (_this._map.getLayer('arcgis')) _this._map.removeLayer('arcgis');\n if (_this._map.getLayer('zhuji')) _this._map.removeLayer('zhuji');\n }\n if (key == 'satellite') {\n if (_this._map.getLayer('tiandi')) _this._map.removeLayer('tiandi');\n if (_this._map.getLayer('zhuji')) _this._map.removeLayer('zhuji');\n if (_this._map.getLayer('gode')) _this._map.removeLayer('gode');\n if (_this._map.getLayer('arcgis')) _this._map.removeLayer('arcgis');\n if (!_this._map.getLayer('yingxiang')) {\n _this._map.addLayer({\n \"id\": \"yingxiang\",\n \"source\": \"yingxiang\",\n \"type\": \"raster\"\n });\n }\n ;\n }\n if (key == 'tiandi') {\n if (_this._map.getLayer('yingxiang')) _this._map.removeLayer('yingxiang');\n if (_this._map.getLayer('gode')) _this._map.removeLayer('gode');\n if (_this._map.getLayer('arcgis')) _this._map.removeLayer('arcgis');\n if (!_this._map.getLayer('tiandi')) {\n _this._map.addLayer({\n \"id\": \"tiandi\",\n \"source\": \"tianditu\",\n \"type\": \"raster\"\n });\n }\n ;\n if (!_this._map.getLayer('zhuji')) {\n _this._map.addLayer({\n \"id\": \"zhuji\",\n \"source\": \"zhuji\",\n \"type\": \"raster\"\n });\n }\n ;\n }\n if (key == 'gaode') {\n if (_this._map.getLayer('yingxiang')) _this._map.removeLayer('yingxiang');\n if (_this._map.getLayer('tiandi')) _this._map.removeLayer('tiandi');\n if (_this._map.getLayer('zhuji')) _this._map.removeLayer('zhuji');\n if (_this._map.getLayer('arcgis')) _this._map.removeLayer('arcgis');\n if (!_this._map.getLayer('gaode')) {\n _this._map.addLayer({\n \"id\": \"gaode\",\n \"source\": \"gaode\",\n \"type\": \"raster\"\n });\n }\n ;\n }\n if (key == 'arcgis') {\n if (_this._map.getLayer('yingxiang')) _this._map.removeLayer('yingxiang');\n if (_this._map.getLayer('tiandi')) _this._map.removeLayer('tiandi');\n if (_this._map.getLayer('zhuji')) _this._map.removeLayer('zhuji');\n if (_this._map.getLayer('gode')) _this._map.removeLayer('gode');\n if (!_this._map.getLayer('arcgis')) {\n _this._map.addLayer({\n \"id\": \"arcgis\",\n \"source\": \"arcgis\",\n \"type\": \"raster\"\n });\n }\n ;\n }\n });\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n this._container.parentNode.removeChild(this._container);\n this._map = undefined;\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/control/TilesBar.js?");
5017
5017
 
5018
5018
  /***/ }),
5019
5019
 
@@ -5024,7 +5024,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
5024
5024
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5025
5025
 
5026
5026
  "use strict";
5027
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Toobars)\n/* harmony export */ });\n/* harmony import */ var _turf_turf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/turf */ \"./node_modules/@turf/turf/dist/es/index.js\");\n/* harmony import */ var _src_utils_util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../src/utils/util.js */ \"./src/utils/util.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\nvar Toobars = /*#__PURE__*/function () {\n function Toobars(_config) {\n _classCallCheck(this, Toobars);\n _defineProperty(this, \"_map\", void 0);\n _defineProperty(this, \"_container\", void 0);\n _defineProperty(this, \"lineClicked\", false);\n _defineProperty(this, \"positionClicked\", false);\n _defineProperty(this, \"distance\", 0);\n _defineProperty(this, \"clickLineDisFun\", void 0);\n _defineProperty(this, \"mousemoveLineDisFun\", void 0);\n _defineProperty(this, \"mousemovePositionFun\", void 0);\n _defineProperty(this, \"config\", {\n line: {\n show: true,\n btnClass: '',\n messageClass: ''\n },\n location: {\n show: true,\n center: [117.11, 32.2],\n zoom: 10,\n pitch: 0,\n bearing: 0,\n btnClass: ''\n },\n position: {\n show: true,\n pointShow: false,\n btnClass: '',\n messageClass: ''\n }\n // rect:{\n // show:true,\n // btnClass:'',\n // }\n });\n _defineProperty(this, \"locationFun\", null);\n var _c = {};\n for (var i in this.config) {\n if (_config[i]) {\n var obj = Object.assign({}, this.config[i], _config[i]);\n _c[i] = obj;\n } else {\n _c[i] = this.config[i];\n }\n }\n this.config = _c;\n }\n return _createClass(Toobars, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n var _this$config$line, _this$config$location, _this$config$position, _this$config$line2, _this$config$location2, _this$config$position2;\n this._map = map;\n this._container = document.createElement('div');\n this._container.className = 'mapboxgl-ctrl mapboxgl-ctrl-group';\n this._container.innerHTML += \"<div aria-label=\\\"infobox\\\" class='mapboxgl-ctrl-infobox' style='display:flex;flex-direction:column;position:absolute;top:-100px;margin: 0 50px;width:140px' ></div>\";\n if ((_this$config$line = this.config.line) !== null && _this$config$line !== void 0 && _this$config$line.show) {\n this._container.getElementsByClassName('mapboxgl-ctrl-infobox')[0].innerHTML += \"\\n <div class='linedis-message-show \".concat(this.config.line.messageClass, \"' ></div>\");\n this._container.innerHTML += \"\\n <button class=\\\"mapboxgl-ctrl-linedis \".concat(this.config.line.btnClass, \"\\\" type=\\\"button\\\" aria-label=\\\"linedis\\\" aria-disabled=\\\"false\\\">\\n <span style='display:flex;align-item:center;' class=\\\"mapboxgl-ctrl-icon\\\" aria-hidden=\\\"true\\\" title=\\\"\\u5212\\u7EBF\\u6D4B\\u8DDD\\\">\\n <img style='margin:auto;' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"20\\\" height=\\\"20\\\">%3Cpath d=\\\"m13.5 3.5c-1.4 0-2.5 1.1-2.5 2.5 0 .3 0 .6.2.9l-3.8 3.8c-.3-.1-.6-.2-.9-.2-1.4 0-2.5 1.1-2.5 2.5s1.1 2.5 2.5 2.5 2.5-1.1 2.5-2.5c0-.3 0-.6-.2-.9l3.8-3.8c.3.1.6.2.9.2 1.4 0 2.5-1.1 2.5-2.5s-1.1-2.5-2.5-2.5z\\\"/>%3C/svg>'/>\\n </span>\\n </button>\\n \");\n }\n if ((_this$config$location = this.config.location) !== null && _this$config$location !== void 0 && _this$config$location.show) {\n this._container.innerHTML += \" \\n <button class=\\\"mapboxgl-ctrl-location \".concat(this.config.location.btnClass, \"\\\" type=\\\"button\\\" aria-label=\\\"location\\\" aria-disabled=\\\"false\\\">\\n <span style='display:flex;align-item:center;' class=\\\"mapboxgl-ctrl-icon\\\" aria-hidden=\\\"true\\\" title=\\\"\\u5B9A\\u4F4D\\\">\\n <img style='margin:auto;' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"20\\\" height=\\\"20\\\">%3Cpath d=\\\"M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8M3.05,13H1V11H3.05C3.5,6.83 6.83,3.5 11,3.05V1H13V3.05C17.17,3.5 20.5,6.83 20.95,11H23V13H20.95C20.5,17.17 17.17,20.5 13,20.95V23H11V20.95C6.83,20.5 3.5,17.17 3.05,13M12,5A7,7 0 0,0 5,12A7,7 0 0,0 12,19A7,7 0 0,0 19,12A7,7 0 0,0 12,5Z\\\"/>%3C/svg>'/>\\n </span>\\n </button>\\n \");\n }\n if ((_this$config$position = this.config.position) !== null && _this$config$position !== void 0 && _this$config$position.show) {\n this._container.getElementsByClassName('mapboxgl-ctrl-infobox')[0].innerHTML += \"\\n <div class='position-message-show \".concat(this.config.line.messageClass, \"' ></div>\");\n this._container.innerHTML += \" \\n <button class=\\\"mapboxgl-ctrl-position \".concat(this.config.position.btnClass, \"\\\" type=\\\"button\\\" aria-label=\\\"position\\\" aria-disabled=\\\"false\\\">\\n <span style='display:flex;align-item:center;' class=\\\"mapboxgl-ctrl-icon\\\" aria-hidden=\\\"true\\\" title=\\\"\\u663E\\u793A\\u7ECF\\u7EAC\\u5EA6\\\">\\n <img style='margin:auto;' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"20\\\" height=\\\"20\\\">%3Cpath d=\\\"M3.05 13H1V11H3.05C3.5 6.83 6.83 3.5 11 3.05V1H13V3.05C17.17 3.5 20.5 6.83 20.95 11H23V13H20.95C20.5 17.17 17.17 20.5 13 20.95V23H11V20.95C6.83 20.5 3.5 17.17 3.05 13M12 5C8.13 5 5 8.13 5 12S8.13 19 12 19 19 15.87 19 12 15.87 5 12 5M11.13 17.25H12.88V15.5H11.13V17.25M12 6.75C10.07 6.75 8.5 8.32 8.5 10.25H10.25C10.25 9.28 11.03 8.5 12 8.5S13.75 9.28 13.75 10.25C13.75 12 11.13 11.78 11.13 14.63H12.88C12.88 12.66 15.5 12.44 15.5 10.25C15.5 8.32 13.93 6.75 12 6.75Z\\\"/>%3C/svg>'/>\\n </span>\\n </button>\\n \");\n }\n // if(this.config.rect?.show){\n // this._container.innerHTML += ` \n // <button class=\"mapboxgl-ctrl-location ${this.config.rect.btnClass}\" type=\"button\" aria-label=\"rect\" aria-disabled=\"false\">\n // <span style='display:flex;align-item:center;' class=\"mapboxgl-ctrl-icon\" aria-hidden=\"true\" title=\"划区\">\n // <img style='margin:auto;' src='data:image/svg+xml;utf8,%3Csvg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" width=\"20\" height=\"20\">%3Cpath d=\"m15 12.3v-4.6c.6-.3 1-1 1-1.7 0-1.1-.9-2-2-2-.7 0-1.4.4-1.7 1h-4.6c-.3-.6-1-1-1.7-1-1.1 0-2 .9-2 2 0 .7.4 1.4 1 1.7v4.6c-.6.3-1 1-1 1.7 0 1.1.9 2 2 2 .7 0 1.4-.4 1.7-1h4.6c.3.6 1 1 1.7 1 1.1 0 2-.9 2-2 0-.7-.4-1.4-1-1.7zm-8-.3v-4l1-1h4l1 1v4l-1 1h-4z\"/>%3C/svg>'/>\n // </span>\n // </button>\n // `\n // }\n\n //绑定事件\n if ((_this$config$line2 = this.config.line) !== null && _this$config$line2 !== void 0 && _this$config$line2.show) {\n var btn = this._container.getElementsByClassName('mapboxgl-ctrl-linedis')[0];\n this.addLindDis(btn);\n }\n if ((_this$config$location2 = this.config.location) !== null && _this$config$location2 !== void 0 && _this$config$location2.show) {\n var _btn = this._container.getElementsByClassName('mapboxgl-ctrl-location')[0];\n this.addLocation(_btn);\n }\n if ((_this$config$position2 = this.config.position) !== null && _this$config$position2 !== void 0 && _this$config$position2.show) {\n var _btn2 = this._container.getElementsByClassName('mapboxgl-ctrl-position')[0];\n this.addPosition(_btn2);\n }\n // if(this.config.rect?.show){ \n // let btn = this._container.getElementsByClassName('mapboxgl-ctrl-rect')[0]\n // this.addRect(btn)\n // }\n return this._container;\n }\n }, {\n key: \"resetEvent\",\n value: function resetEvent() {\n var _this$config$location3;\n if ((_this$config$location3 = this.config.location) !== null && _this$config$location3 !== void 0 && _this$config$location3.show) {\n var btn = this._container.getElementsByClassName('mapboxgl-ctrl-location')[0];\n this.addLocation(btn);\n }\n }\n }, {\n key: \"addLindDis\",\n value: function addLindDis(btn) {\n var _this = this;\n var lineDis = {\n 'type': 'FeatureCollection',\n 'features': []\n };\n var linestring = {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': []\n }\n };\n btn.addEventListener('click', function () {\n lineDis = {\n 'type': 'FeatureCollection',\n 'features': []\n };\n linestring = {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': []\n }\n };\n if (!_this.clickLineDisFun) {\n _this.clickLineDisFun = function (e) {\n var features = _this._map.queryRenderedFeatures(e.point, {\n layers: ['measure-points']\n });\n // Remove the linestring from the group\n // so we can redraw it based on the points collection.\n if (lineDis.features.length > 1) lineDis.features.pop();\n // Clear the distance container to populate it with a new value.\n var distance = 0;\n // If a feature was clicked, remove it from the map.\n if (features.length) {\n var id = features[0].properties.id;\n lineDis.features = lineDis.features.filter(function (point) {\n return point.properties.id !== id;\n });\n } else {\n var point = {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': [e.lngLat.lng, e.lngLat.lat]\n },\n 'properties': {\n 'id': String(new Date().getTime())\n }\n };\n lineDis.features.push(point);\n }\n if (lineDis.features.length > 1) {\n linestring.geometry.coordinates = lineDis.features.map(function (point) {\n return point.geometry.coordinates;\n });\n lineDis.features.push(linestring);\n\n // Populate the distanceContainer with total distance \n var _distance = _turf_turf__WEBPACK_IMPORTED_MODULE_0__.length(linestring).toLocaleString();\n _this._container.getElementsByClassName('linedis-message-show')[0].innerHTML = \"\\u6D4B\\u91CF\\u8DDD\\u79BB\\uFF1A\".concat(_distance, \" km\");\n // status.value.distance = distance.toLocaleString()\n }\n _this._map.getSource('lineDis').setData(lineDis);\n };\n }\n if (!_this.mousemoveLineDisFun) {\n _this.mousemoveLineDisFun = function (e) {\n var features = _this._map.queryRenderedFeatures(e.point, {\n layers: ['measure-points']\n });\n // Change the cursor to a pointer when hovering over a point on the map.\n // Otherwise cursor is a crosshair.\n _this._map.getCanvas().style.cursor = features.length ? 'pointer' : 'crosshair';\n };\n }\n if (!_this.lineClicked) {\n _this.lineClicked = true;\n _this._container.getElementsByClassName('linedis-message-show')[0].innerHTML = \"\\u6D4B\\u91CF\\u8DDD\\u79BB\\uFF1A m\";\n _this._map.addSource('lineDis', {\n 'type': 'geojson',\n 'data': lineDis\n });\n\n // Add styles to the map\n _this._map.addLayer({\n id: 'measure-points',\n type: 'circle',\n source: 'lineDis',\n paint: {\n 'circle-radius': 5,\n 'circle-color': '#000'\n },\n filter: ['in', '$type', 'Point']\n });\n _this._map.addLayer({\n id: 'measure-lines',\n type: 'line',\n source: 'lineDis',\n layout: {\n 'line-cap': 'round',\n 'line-join': 'round'\n },\n paint: {\n 'line-color': '#000',\n 'line-width': 2.5\n },\n filter: ['in', '$type', 'LineString']\n });\n _this._map.on('click', _this.clickLineDisFun);\n _this._map.on('mousemove', _this.mousemoveLineDisFun);\n } else {\n _this.lineClicked = false;\n _this._container.getElementsByClassName('linedis-message-show')[0].innerHTML = '';\n _this._map.off('click', _this.clickLineDisFun);\n _this._map.off('mousemove', _this.mousemoveLineDisFun);\n // Add styles to the map\n var points = _this._map.getLayer('measure-points');\n if (points) {\n _this._map.removeLayer('measure-points');\n }\n if (_this._map.getLayer('measure-lines')) {\n _this._map.removeLayer('measure-lines');\n }\n _this._map.removeSource('lineDis');\n }\n });\n }\n }, {\n key: \"addRect\",\n value: function addRect() {}\n }, {\n key: \"addLocation\",\n value: function addLocation(btn) {\n var _this2 = this;\n if (!this.locationFun) {\n this.locationFun = function () {\n // jump with zoom, pitch, and bearing options\n _this2._map.jumpTo({\n center: (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_1__.transform)(_this2.config.location.center),\n zoom: _this2.config.location.zoom,\n pitch: _this2.config.location.pitch,\n bearing: _this2.config.location.bearing\n });\n };\n btn.addEventListener('click', this.locationFun);\n } else {\n btn.removeEventListener('click', this.locationFun);\n this.locationFun = function () {\n // jump with zoom, pitch, and bearing options\n _this2._map.jumpTo({\n center: (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_1__.transform)(_this2.config.location.center),\n zoom: _this2.config.location.zoom,\n pitch: _this2.config.location.pitch,\n bearing: _this2.config.location.bearing\n });\n };\n btn.addEventListener('click', this.locationFun);\n }\n }\n }, {\n key: \"addPosition\",\n value: function addPosition(btn) {\n var _this3 = this;\n if (!this.mousemovePositionFun) {\n this.mousemovePositionFun = function (e) {\n var lngLat = (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_1__.transform)([e.lngLat.lng, e.lngLat.lat], true);\n _this3._container.getElementsByClassName('position-message-show')[0].innerHTML = _this3.config.position.pointShow ? \"\\u7ECF\\u5EA6\\uFF1A\".concat(lngLat[0].toFixed(6), \"<br/>\\u7EAC\\u5EA6\\uFF1A\").concat(lngLat[1].toFixed(6), \"<br/>x:\").concat(e.point.x, \",y:\").concat(e.point.y) : \"\\u7ECF\\u5EA6\\uFF1A\".concat(lngLat[0].toFixed(6), \"<br/>\\u7EAC\\u5EA6\\uFF1A\").concat(lngLat[1].toFixed(6));\n };\n }\n btn.addEventListener('click', function () {\n // jump with zoom, pitch, and bearing options\n if (!_this3.positionClicked) {\n _this3.positionClicked = true;\n _this3._map.on('mousemove', _this3.mousemovePositionFun);\n } else {\n _this3.positionClicked = false;\n _this3._container.getElementsByClassName('position-message-show')[0].innerHTML = \"\";\n _this3._map.off('mousemove', _this3.mousemovePositionFun);\n }\n });\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n this._container.parentNode.removeChild(this._container);\n this._map = undefined;\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/control/Toobars.js?");
5027
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Toobars)\n/* harmony export */ });\n/* harmony import */ var _turf_turf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/turf */ \"./node_modules/@turf/turf/dist/es/index.js\");\n/* harmony import */ var _src_utils_util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../src/utils/util.js */ \"./src/utils/util.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\nvar Toobars = /*#__PURE__*/function () {\n function Toobars(_config) {\n _classCallCheck(this, Toobars);\n _defineProperty(this, \"_map\", void 0);\n _defineProperty(this, \"_container\", void 0);\n _defineProperty(this, \"lineClicked\", false);\n _defineProperty(this, \"positionClicked\", false);\n _defineProperty(this, \"distance\", 0);\n _defineProperty(this, \"clickLineDisFun\", void 0);\n _defineProperty(this, \"mousemoveLineDisFun\", void 0);\n _defineProperty(this, \"mousemovePositionFun\", void 0);\n _defineProperty(this, \"config\", {\n line: {\n show: true,\n btnClass: '',\n messageClass: ''\n },\n location: {\n show: true,\n center: [117.11, 32.2],\n zoom: 10,\n pitch: 0,\n bearing: 0,\n btnClass: ''\n },\n position: {\n show: true,\n pointShow: false,\n btnClass: '',\n messageClass: ''\n }\n // rect:{\n // show:true,\n // btnClass:'',\n // }\n });\n _defineProperty(this, \"locationFun\", null);\n var _c = {};\n for (var i in this.config) {\n if (_config[i]) {\n var obj = Object.assign({}, this.config[i], _config[i]);\n _c[i] = obj;\n } else {\n _c[i] = this.config[i];\n }\n }\n this.config = _c;\n }\n return _createClass(Toobars, [{\n key: \"onAdd\",\n value: function onAdd(map) {\n var _this$config$line, _this$config$location, _this$config$position, _this$config$line2, _this$config$location2, _this$config$position2;\n this._map = map;\n this._container = document.createElement('div');\n this._container.className = 'mapboxgl-ctrl mapboxgl-ctrl-group';\n this._container.innerHTML += \"<div aria-label=\\\"infobox\\\" class='mapboxgl-ctrl-infobox' style='display:flex;flex-direction:column;position:absolute;top:-100px;margin: 0 50px;width:140px' ></div>\";\n if ((_this$config$line = this.config.line) !== null && _this$config$line !== void 0 && _this$config$line.show) {\n this._container.getElementsByClassName('mapboxgl-ctrl-infobox')[0].innerHTML += \"\\n <div class='linedis-message-show \".concat(this.config.line.messageClass, \"' ></div>\");\n this._container.innerHTML += \"\\n <button class=\\\"mapboxgl-ctrl-linedis \".concat(this.config.line.btnClass, \"\\\" type=\\\"button\\\" aria-label=\\\"linedis\\\" aria-disabled=\\\"false\\\">\\n <span style='display:flex;align-item:center;' class=\\\"mapboxgl-ctrl-icon\\\" aria-hidden=\\\"true\\\" title=\\\"\\u5212\\u7EBF\\u6D4B\\u8DDD\\\">\\n <img style='margin:auto;' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" width=\\\"20\\\" height=\\\"20\\\">%3Cpath d=\\\"m13.5 3.5c-1.4 0-2.5 1.1-2.5 2.5 0 .3 0 .6.2.9l-3.8 3.8c-.3-.1-.6-.2-.9-.2-1.4 0-2.5 1.1-2.5 2.5s1.1 2.5 2.5 2.5 2.5-1.1 2.5-2.5c0-.3 0-.6-.2-.9l3.8-3.8c.3.1.6.2.9.2 1.4 0 2.5-1.1 2.5-2.5s-1.1-2.5-2.5-2.5z\\\"/>%3C/svg>'/>\\n </span>\\n </button>\\n \");\n }\n if ((_this$config$location = this.config.location) !== null && _this$config$location !== void 0 && _this$config$location.show) {\n this._container.innerHTML += \" \\n <button class=\\\"mapboxgl-ctrl-location \".concat(this.config.location.btnClass, \"\\\" type=\\\"button\\\" aria-label=\\\"location\\\" aria-disabled=\\\"false\\\">\\n <span style='display:flex;align-item:center;' class=\\\"mapboxgl-ctrl-icon\\\" aria-hidden=\\\"true\\\" title=\\\"\\u5B9A\\u4F4D\\\">\\n <img style='margin:auto;' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"20\\\" height=\\\"20\\\">%3Cpath d=\\\"M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8M3.05,13H1V11H3.05C3.5,6.83 6.83,3.5 11,3.05V1H13V3.05C17.17,3.5 20.5,6.83 20.95,11H23V13H20.95C20.5,17.17 17.17,20.5 13,20.95V23H11V20.95C6.83,20.5 3.5,17.17 3.05,13M12,5A7,7 0 0,0 5,12A7,7 0 0,0 12,19A7,7 0 0,0 19,12A7,7 0 0,0 12,5Z\\\"/>%3C/svg>'/>\\n </span>\\n </button>\\n \");\n }\n if ((_this$config$position = this.config.position) !== null && _this$config$position !== void 0 && _this$config$position.show) {\n this._container.getElementsByClassName('mapboxgl-ctrl-infobox')[0].innerHTML += \"\\n <div class='position-message-show \".concat(this.config.line.messageClass, \"' ></div>\");\n this._container.innerHTML += \" \\n <button class=\\\"mapboxgl-ctrl-position \".concat(this.config.position.btnClass, \"\\\" type=\\\"button\\\" aria-label=\\\"position\\\" aria-disabled=\\\"false\\\">\\n <span style='display:flex;align-item:center;' class=\\\"mapboxgl-ctrl-icon\\\" aria-hidden=\\\"true\\\" title=\\\"\\u663E\\u793A\\u7ECF\\u7EAC\\u5EA6\\\">\\n <img style='margin:auto;' src='data:image/svg+xml;utf8,%3Csvg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 24 24\\\" width=\\\"20\\\" height=\\\"20\\\">%3Cpath d=\\\"M3.05 13H1V11H3.05C3.5 6.83 6.83 3.5 11 3.05V1H13V3.05C17.17 3.5 20.5 6.83 20.95 11H23V13H20.95C20.5 17.17 17.17 20.5 13 20.95V23H11V20.95C6.83 20.5 3.5 17.17 3.05 13M12 5C8.13 5 5 8.13 5 12S8.13 19 12 19 19 15.87 19 12 15.87 5 12 5M11.13 17.25H12.88V15.5H11.13V17.25M12 6.75C10.07 6.75 8.5 8.32 8.5 10.25H10.25C10.25 9.28 11.03 8.5 12 8.5S13.75 9.28 13.75 10.25C13.75 12 11.13 11.78 11.13 14.63H12.88C12.88 12.66 15.5 12.44 15.5 10.25C15.5 8.32 13.93 6.75 12 6.75Z\\\"/>%3C/svg>'/>\\n </span>\\n </button>\\n \");\n }\n // if(this.config.rect?.show){\n // this._container.innerHTML += ` \n // <button class=\"mapboxgl-ctrl-location ${this.config.rect.btnClass}\" type=\"button\" aria-label=\"rect\" aria-disabled=\"false\">\n // <span style='display:flex;align-item:center;' class=\"mapboxgl-ctrl-icon\" aria-hidden=\"true\" title=\"划区\">\n // <img style='margin:auto;' src='data:image/svg+xml;utf8,%3Csvg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\" width=\"20\" height=\"20\">%3Cpath d=\"m15 12.3v-4.6c.6-.3 1-1 1-1.7 0-1.1-.9-2-2-2-.7 0-1.4.4-1.7 1h-4.6c-.3-.6-1-1-1.7-1-1.1 0-2 .9-2 2 0 .7.4 1.4 1 1.7v4.6c-.6.3-1 1-1 1.7 0 1.1.9 2 2 2 .7 0 1.4-.4 1.7-1h4.6c.3.6 1 1 1.7 1 1.1 0 2-.9 2-2 0-.7-.4-1.4-1-1.7zm-8-.3v-4l1-1h4l1 1v4l-1 1h-4z\"/>%3C/svg>'/>\n // </span>\n // </button>\n // `\n // }\n\n //绑定事件\n if ((_this$config$line2 = this.config.line) !== null && _this$config$line2 !== void 0 && _this$config$line2.show) {\n var btn = this._container.getElementsByClassName('mapboxgl-ctrl-linedis')[0];\n this.addLindDis(btn);\n }\n if ((_this$config$location2 = this.config.location) !== null && _this$config$location2 !== void 0 && _this$config$location2.show) {\n var _btn = this._container.getElementsByClassName('mapboxgl-ctrl-location')[0];\n this.addLocation(_btn);\n }\n if ((_this$config$position2 = this.config.position) !== null && _this$config$position2 !== void 0 && _this$config$position2.show) {\n var _btn2 = this._container.getElementsByClassName('mapboxgl-ctrl-position')[0];\n this.addPosition(_btn2);\n }\n // if(this.config.rect?.show){ \n // let btn = this._container.getElementsByClassName('mapboxgl-ctrl-rect')[0]\n // this.addRect(btn)\n // }\n return this._container;\n }\n }, {\n key: \"resetEvent\",\n value: function resetEvent() {\n var _this$config$location3;\n if ((_this$config$location3 = this.config.location) !== null && _this$config$location3 !== void 0 && _this$config$location3.show) {\n var btn = this._container.getElementsByClassName('mapboxgl-ctrl-location')[0];\n this.addLocation(btn);\n }\n }\n }, {\n key: \"addLindDis\",\n value: function addLindDis(btn) {\n var _this = this;\n var lineDis = {\n 'type': 'FeatureCollection',\n 'features': []\n };\n var linestring = {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': []\n }\n };\n btn.addEventListener('click', function () {\n var box = _this._container.getElementsByClassName('linedis-message-show')[0].parentNode;\n var pos = box.getBoundingClientRect();\n if (pos.x > document.body.clientWidth / 2) {\n box.style.right = 0;\n box.style.left = '';\n } else {\n box.style.right = '';\n box.style.left = 0;\n }\n lineDis = {\n 'type': 'FeatureCollection',\n 'features': []\n };\n linestring = {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'LineString',\n 'coordinates': []\n }\n };\n if (!_this.clickLineDisFun) {\n _this.clickLineDisFun = function (e) {\n var features = _this._map.queryRenderedFeatures(e.point, {\n layers: ['measure-points']\n });\n // Remove the linestring from the group\n // so we can redraw it based on the points collection.\n if (lineDis.features.length > 1) lineDis.features.pop();\n // Clear the distance container to populate it with a new value.\n var distance = 0;\n // If a feature was clicked, remove it from the map.\n if (features.length) {\n var id = features[0].properties.id;\n lineDis.features = lineDis.features.filter(function (point) {\n return point.properties.id !== id;\n });\n } else {\n var point = {\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': [e.lngLat.lng, e.lngLat.lat]\n },\n 'properties': {\n 'id': String(new Date().getTime())\n }\n };\n lineDis.features.push(point);\n }\n if (lineDis.features.length > 1) {\n linestring.geometry.coordinates = lineDis.features.map(function (point) {\n return point.geometry.coordinates;\n });\n lineDis.features.push(linestring);\n\n // Populate the distanceContainer with total distance \n var _distance = _turf_turf__WEBPACK_IMPORTED_MODULE_0__.length(linestring).toLocaleString();\n _this._container.getElementsByClassName('linedis-message-show')[0].innerHTML = \"\\u6D4B\\u91CF\\u8DDD\\u79BB\\uFF1A\".concat(_distance, \" km\");\n // status.value.distance = distance.toLocaleString()\n }\n _this._map.getSource('lineDis').setData(lineDis);\n };\n }\n if (!_this.mousemoveLineDisFun) {\n _this.mousemoveLineDisFun = function (e) {\n var features = _this._map.queryRenderedFeatures(e.point, {\n layers: ['measure-points']\n });\n // Change the cursor to a pointer when hovering over a point on the map.\n // Otherwise cursor is a crosshair.\n _this._map.getCanvas().style.cursor = features.length ? 'pointer' : 'crosshair';\n };\n }\n if (!_this.lineClicked) {\n _this.lineClicked = true;\n _this._container.getElementsByClassName('linedis-message-show')[0].innerHTML = \"\\u6D4B\\u91CF\\u8DDD\\u79BB\\uFF1A m\";\n _this._map.addSource('lineDis', {\n 'type': 'geojson',\n 'data': lineDis\n });\n\n // Add styles to the map\n _this._map.addLayer({\n id: 'measure-points',\n type: 'circle',\n source: 'lineDis',\n paint: {\n 'circle-radius': 5,\n 'circle-color': '#000'\n },\n filter: ['in', '$type', 'Point']\n });\n _this._map.addLayer({\n id: 'measure-lines',\n type: 'line',\n source: 'lineDis',\n layout: {\n 'line-cap': 'round',\n 'line-join': 'round'\n },\n paint: {\n 'line-color': '#000',\n 'line-width': 2.5\n },\n filter: ['in', '$type', 'LineString']\n });\n _this._map.on('click', _this.clickLineDisFun);\n _this._map.on('mousemove', _this.mousemoveLineDisFun);\n } else {\n _this.lineClicked = false;\n _this._container.getElementsByClassName('linedis-message-show')[0].innerHTML = '';\n _this._map.off('click', _this.clickLineDisFun);\n _this._map.off('mousemove', _this.mousemoveLineDisFun);\n // Add styles to the map\n var points = _this._map.getLayer('measure-points');\n if (points) {\n _this._map.removeLayer('measure-points');\n }\n if (_this._map.getLayer('measure-lines')) {\n _this._map.removeLayer('measure-lines');\n }\n _this._map.removeSource('lineDis');\n }\n });\n }\n }, {\n key: \"addRect\",\n value: function addRect() {}\n }, {\n key: \"addLocation\",\n value: function addLocation(btn) {\n var _this2 = this;\n if (!this.locationFun) {\n this.locationFun = function () {\n // jump with zoom, pitch, and bearing options\n _this2._map.jumpTo({\n center: (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_1__.transform)(_this2.config.location.center),\n zoom: _this2.config.location.zoom,\n pitch: _this2.config.location.pitch,\n bearing: _this2.config.location.bearing\n });\n };\n btn.addEventListener('click', this.locationFun);\n } else {\n btn.removeEventListener('click', this.locationFun);\n this.locationFun = function () {\n // jump with zoom, pitch, and bearing options\n _this2._map.jumpTo({\n center: (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_1__.transform)(_this2.config.location.center),\n zoom: _this2.config.location.zoom,\n pitch: _this2.config.location.pitch,\n bearing: _this2.config.location.bearing\n });\n };\n btn.addEventListener('click', this.locationFun);\n }\n }\n }, {\n key: \"addPosition\",\n value: function addPosition(btn) {\n var _this3 = this;\n if (!this.mousemovePositionFun) {\n this.mousemovePositionFun = function (e) {\n var lngLat = (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_1__.transform)([e.lngLat.lng, e.lngLat.lat], true);\n _this3._container.getElementsByClassName('position-message-show')[0].innerHTML = _this3.config.position.pointShow ? \"\\u7ECF\\u5EA6\\uFF1A\".concat(lngLat[0].toFixed(6), \"<br/>\\u7EAC\\u5EA6\\uFF1A\").concat(lngLat[1].toFixed(6), \"<br/>x:\").concat(e.point.x, \",y:\").concat(e.point.y) : \"\\u7ECF\\u5EA6\\uFF1A\".concat(lngLat[0].toFixed(6), \"<br/>\\u7EAC\\u5EA6\\uFF1A\").concat(lngLat[1].toFixed(6));\n };\n }\n btn.addEventListener('click', function () {\n var box = _this3._container.getElementsByClassName('position-message-show')[0].parentNode;\n var pos = box.getBoundingClientRect();\n if (pos.x > document.body.clientWidth / 2) {\n box.style.right = 0;\n box.style.left = '';\n } else {\n box.style.right = '';\n box.style.left = 0;\n }\n // jump with zoom, pitch, and bearing options\n if (!_this3.positionClicked) {\n _this3.positionClicked = true;\n _this3._map.on('mousemove', _this3.mousemovePositionFun);\n } else {\n _this3.positionClicked = false;\n _this3._container.getElementsByClassName('position-message-show')[0].innerHTML = \"\";\n _this3._map.off('mousemove', _this3.mousemovePositionFun);\n }\n });\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n this._container.parentNode.removeChild(this._container);\n this._map = undefined;\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/control/Toobars.js?");
5028
5028
 
5029
5029
  /***/ }),
5030
5030
 
@@ -5167,7 +5167,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
5167
5167
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5168
5168
 
5169
5169
  "use strict";
5170
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ AlarmLayer)\n/* harmony export */ });\n/* harmony import */ var _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../lib/threebox-plugin */ \"./lib/threebox-plugin/main.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/util */ \"./src/utils/util.js\");\n/* harmony import */ var _utils_Pulses_Pulse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/Pulses/Pulse */ \"./src/utils/Pulses/Pulse.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\n\nvar tb = {};\nvar AlarmLayer = /*#__PURE__*/function () {\n function AlarmLayer(id) {\n var alarmList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var html = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n var visible = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n _classCallCheck(this, AlarmLayer);\n _defineProperty(this, \"alarmList\", []);\n _defineProperty(this, \"scale\", 0.01);\n _defineProperty(this, \"iconHtml\", void 0);\n _defineProperty(this, \"pulse\", void 0);\n _defineProperty(this, \"visible\", true);\n _defineProperty(this, \"popup\", void 0);\n this.id = id;\n this.visible = visible;\n this.type = 'custom';\n this.renderingMode = '3d';\n this.pulse = new _utils_Pulses_Pulse__WEBPACK_IMPORTED_MODULE_2__[\"default\"](300, 1000, true);\n this.alarmList = alarmList;\n this.iconHtml = this.createElement(html);\n }\n return _createClass(AlarmLayer, [{\n key: \"updatePoint\",\n value: function updatePoint(alarmList) {\n var _this = this;\n this.alarmList.forEach(function (a) {\n return _this.remove(a);\n });\n this.alarmList = alarmList;\n this.alarmList.forEach(function (a) {\n return _this.drawPoint(a);\n });\n }\n\n // modelAsMercatorCoordinate = mapboxgl.MercatorCoordinate.fromLngLat(\n // modelOrigin,\n // modelAltitude\n // );\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n var _this2 = this;\n this.map = map;\n tb = new _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_0__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true\n });\n this.alarmList.forEach(function (a) {\n return _this2.drawPoint(a);\n });\n this.popup = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].Popup({\n className: 'alarmpoint-popup',\n closeButton: false\n });\n // this.iconHtml = this.createElement()\n }\n }, {\n key: \"createElement\",\n value: function createElement(html) {\n var labelElement = document.createElement(\"div\");\n labelElement.innerHTML = \"<svg class='alarmpoint' xmlns=\\\"http://www.w3.org/2000/svg\\\" xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\" viewBox=\\\"0 0 55 55\\\" style=\\\"width:30px;height:30px;border-radius:50%;\\\">\\n <defs>\\n <style> \\n .cls-1,.cls-2,.cls-3{stroke:#fb8c00;stroke-miterlimit:10;stroke-width:5px;}\\n .cls-1{fill:#fb8c00}\\n .cls-2{fill:none;animation: breathe 1s infinite ease-in-out;animation-delay:0.8s;} \\n .cls-3{fill:none;animation: breathe 1s infinite ease-in-out;}\\n @keyframes breathe{\\n from{\\n transform-origin: 50% 50%;\\n }\\n to{\\n transform: scale(3);\\n transform-origin: 50% 50%;\\n }\\n }\\n </style>\\n \\n </defs>\\n <use width=\\\"55\\\" height=\\\"55\\\" />\\n <circle fill=\\\"#FF8656\\\" style=\\\"stroke:#FF8656;stroke-miterlimit:10;stroke-width:5px;\\\" cx=\\\"28\\\" cy=\\\"27\\\" r=\\\"12\\\"/>\\n <circle fill=\\\"none\\\" fill-opacity=\\\"0\\\" style=\\\"stroke:#FFDC8A7d;stroke-miterlimit:10;stroke-width:5px;animation: breathe 1s infinite ease-in-out;animation-delay:0.8s;\\\" cx=\\\"27.5\\\" cy=\\\"27.5\\\" r=\\\"25\\\"/> \\n <circle fill=\\\"none\\\" fill-opacity=\\\"0\\\" style=\\\"stroke:#FFDC8A7d;stroke-miterlimit:10;stroke-width:5px;animation: breathe 1s infinite ease-in-out;animation-delay:0.8s;\\\" cx=\\\"27.75\\\" cy=\\\"27.5\\\" r=\\\"15\\\"/>\\n </svg>\\n \";\n labelElement.style.width = \"30px\";\n labelElement.style.height = \"30px\";\n labelElement.style.left = '-15px';\n labelElement.style.bottom = '-15px';\n labelElement.style.position = 'absolute';\n labelElement.style.cursor = 'pointer';\n //labelElement.textContent = \"T1航站楼\";\n // labelElement.style.backgroundColor = \"rgba(255, 255, 255, 0.8)\";\n // labelElement.style.padding = \"5px\";\n // labelElement.style.borderRadius = \"5px\";\n // labelElement.style.color = \"black\";\n // labelElement.style.fontSize = \"14px\";\n // labelElement.style.fontWeight = 500;\n return labelElement;\n }\n }, {\n key: \"remove\",\n value: function remove(point) {\n point.circle.removeLabel();\n point.circle.remove();\n //console.log(point)\n }\n }, {\n key: \"drawPoint\",\n value: function drawPoint(point) {\n var _this3 = this;\n var lng = point.lng;\n var lat = point.lat;\n // const scale = 320;\n // const options = {\n // obj: 'https://docs.mapbox.com/mapbox-gl-js/assets/metlife-building.gltf',\n // type: 'gltf',\n // scale: { x: scale, y: scale, z: 2.7 },\n // units: 'meters',\n // rotation: { x: 90, y: -90, z: 0 }\n // };\n // tb.loadObj(options, (model) => {\n // model.setCoords(transform([lng,lat]));\n // model.setRotation({ x: 0, y: 0, z: 241 });\n // tb.add(model);\n // });\n var center = (0,_utils_util__WEBPACK_IMPORTED_MODULE_1__.transform)([lng, lat]);\n var geometry = new three__WEBPACK_IMPORTED_MODULE_4__.CircleGeometry(0);\n var circle = new three__WEBPACK_IMPORTED_MODULE_4__.Mesh(geometry, new three__WEBPACK_IMPORTED_MODULE_4__.MeshPhongMaterial({\n color: 0x660000\n }));\n circle = tb.Object3D({\n obj: circle,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n circle.addLabel = function (HTMLElement, visible, center, height, ev) {\n if (HTMLElement) {\n var label = circle.drawLabelHTML(HTMLElement, visible, center, height);\n //console.log(label)\n if (!_this3.visible) {\n var _this3$popup;\n label.element.children[0].style.display = 'none';\n (_this3$popup = _this3.popup) === null || _this3$popup === void 0 || _this3$popup.remove();\n }\n label.element.onclick = ev;\n }\n };\n circle.setCoords(center);\n //circle.addEventListener('ObjectMouseOver', (e)=>{console.log(111,e)}, false) \n // let pulseObj = tb\n // .Object3D({ obj: this.pulse, units: \"meters\" ,anchor:'center'})\n // .setCoords(center);\n // tb.add(pulseObj)\n tb.add(circle);\n point.circle = circle;\n if (point.iconHtml) {\n circle.addLabel(point.iconHtml, true, circle.anchor, 0.5);\n } else {\n var el = this.iconHtml.cloneNode(true);\n // for(let i in point){\n // el.setAttribute('data-'+i,point[i]) \n // }\n circle.addLabel(el, true, circle.anchor, 0, function () {\n setTimeout(function () {\n _this3.popup.setLngLat(center).setHTML(\"<div class='alarmpoint-popup-card'>\\n <div class='alarmpoint-popup-title'>\".concat(point.title, \"</div>\\n \").concat(point.items.map(function (a) {\n return \"<div class='alarmpoint-popup-item'>\\n <div class='alarmpoint-popup-item-label'>\".concat(a.label, \"</div>:\\n \").concat(a.text, \"\\n </div>\");\n }).join(''), \"\\n </div>\")).addTo(_this3.map);\n }, 300);\n });\n }\n\n // let circle = new THREE.CircleGeometry(500)\n // let material = new THREE.MeshBasicMaterial({color: 0xffff00,transparent:true})\n // let mesh = new THREE.Mesh(circle,material)\n // let cube = tb.Object3D({obj:mesh,units:'meters'})\n // cube.setCoords(transform([lng,lat]))\n // tb.add(mesh);\n }\n }, {\n key: \"setPopup\",\n value: function setPopup(point) {\n var lng = point.lng;\n var lat = point.lat;\n var center = (0,_utils_util__WEBPACK_IMPORTED_MODULE_1__.transform)([lng, lat]);\n for (var i in this.alarmList) {\n var a = this.alarmList[i];\n if (a.lng == lng && a.lat == lat) {\n if (!this.visible && a.circle.label.element.children[0].style.display == '') {\n a.circle.label.element.children[0].style.display = 'none';\n this.popup.remove();\n } else {\n a.circle.label.element.children[0].style.display = '';\n this.popup.setLngLat(center).setHTML(\"<div class='alarmpoint-popup-card'>\\n <div class='alarmpoint-popup-title'>\".concat(point.title, \"</div>\\n \").concat(point.items.map(function (b) {\n return \"<div class='alarmpoint-popup-item'>\\n <div class='alarmpoint-popup-item-label'>\".concat(b.label, \"</div>:\\n \").concat(b.text, \"\\n </div>\");\n }).join(''), \"\\n </div>\")).addTo(this.map);\n }\n } else {\n if (!this.visible) {\n a.circle.label.element.children[0].style.display = 'none';\n }\n }\n }\n }\n\n // animate=async ()=>{\n // this.scale = this.scale + 0.01 > 0.03 ? 0.01 :this.scale + 0.01\n // console.log(this.scale)\n // this.alarmList.forEach(a => {\n // a?.circle?.set({ scale:this.scale,duration:600})\n // });\n // await sleep(600)\n // tb.update(); \n // requestAnimationFrame(this.animate);\n // }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n // const rotationX = new THREE.Matrix4().makeRotationAxis(\n // new THREE.Vector3(1, 0, 0),\n // modelTransform.rotateX\n // );\n // const rotationY = new THREE.Matrix4().makeRotationAxis(\n // new THREE.Vector3(0, 1, 0),\n // modelTransform.rotateY\n // );\n // const rotationZ = new THREE.Matrix4().makeRotationAxis(\n // new THREE.Vector3(0, 0, 1),\n // modelTransform.rotateZ\n // );\n\n // const m = new THREE.Matrix4().fromArray(matrix);\n // const l = new THREE.Matrix4()\n // .makeTranslation(\n // modelTransform.translateX,\n // modelTransform.translateY,\n // modelTransform.translateZ\n // )\n // .scale(\n // new THREE.Vector3(\n // modelTransform.scale,\n // -modelTransform.scale,\n // modelTransform.scale\n // )\n // )\n // .multiply(rotationX)\n // .multiply(rotationY)\n // .multiply(rotationZ);\n\n // this.camera.projectionMatrix = m.multiply(l); \n //this.pulse.update(); \n tb.update();\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/AlarmLayer.js?");
5170
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ AlarmLayer)\n/* harmony export */ });\n/* harmony import */ var _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../lib/threebox-plugin */ \"./lib/threebox-plugin/main.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/util */ \"./src/utils/util.js\");\n/* harmony import */ var _utils_Pulses_Pulse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/Pulses/Pulse */ \"./src/utils/Pulses/Pulse.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\n\nvar AlarmLayer = /*#__PURE__*/function () {\n function AlarmLayer(id) {\n var alarmList = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];\n var html = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';\n var visible = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n _classCallCheck(this, AlarmLayer);\n _defineProperty(this, \"tb\", {});\n _defineProperty(this, \"alarmList\", []);\n _defineProperty(this, \"scale\", 0.01);\n _defineProperty(this, \"iconHtml\", void 0);\n _defineProperty(this, \"pulse\", void 0);\n _defineProperty(this, \"visible\", true);\n _defineProperty(this, \"popup\", void 0);\n this.id = id;\n this.visible = visible;\n this.type = 'custom';\n this.renderingMode = '3d';\n this.pulse = new _utils_Pulses_Pulse__WEBPACK_IMPORTED_MODULE_2__[\"default\"](300, 1000, true);\n this.alarmList = alarmList;\n this.iconHtml = this.createElement(html);\n }\n return _createClass(AlarmLayer, [{\n key: \"updatePoint\",\n value: function updatePoint(alarmList) {\n var _this = this;\n this.alarmList.forEach(function (a) {\n return _this.remove(a);\n });\n this.alarmList = alarmList;\n this.alarmList.forEach(function (a) {\n return _this.drawPoint(a);\n });\n }\n\n // modelAsMercatorCoordinate = mapboxgl.MercatorCoordinate.fromLngLat(\n // modelOrigin,\n // modelAltitude\n // );\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n var _this2 = this;\n this.map = map;\n this.tb = new _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_0__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true\n });\n this.alarmList.forEach(function (a) {\n return _this2.drawPoint(a);\n });\n this.popup = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"].Popup({\n className: 'alarmpoint-popup',\n closeButton: false\n });\n // this.iconHtml = this.createElement()\n }\n }, {\n key: \"createElement\",\n value: function createElement(html) {\n var labelElement = document.createElement(\"div\");\n labelElement.innerHTML = \"<svg class='alarmpoint' xmlns=\\\"http://www.w3.org/2000/svg\\\" xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\" viewBox=\\\"0 0 55 55\\\" style=\\\"width:30px;height:30px;border-radius:50%;\\\">\\n <defs>\\n <style> \\n .cls-1,.cls-2,.cls-3{stroke:#fb8c00;stroke-miterlimit:10;stroke-width:5px;}\\n .cls-1{fill:#fb8c00}\\n .cls-2{fill:none;animation: breathe 1s infinite ease-in-out;animation-delay:0.8s;} \\n .cls-3{fill:none;animation: breathe 1s infinite ease-in-out;}\\n @keyframes breathe{\\n from{\\n transform-origin: 50% 50%;\\n }\\n to{\\n transform: scale(3);\\n transform-origin: 50% 50%;\\n }\\n }\\n </style>\\n \\n </defs>\\n <use width=\\\"55\\\" height=\\\"55\\\" />\\n <circle fill=\\\"#FF8656\\\" style=\\\"stroke:#FF8656;stroke-miterlimit:10;stroke-width:5px;\\\" cx=\\\"28\\\" cy=\\\"27\\\" r=\\\"12\\\"/>\\n <circle fill=\\\"none\\\" fill-opacity=\\\"0\\\" style=\\\"stroke:#FFDC8A7d;stroke-miterlimit:10;stroke-width:5px;animation: breathe 1s infinite ease-in-out;animation-delay:0.8s;\\\" cx=\\\"27.5\\\" cy=\\\"27.5\\\" r=\\\"25\\\"/> \\n <circle fill=\\\"none\\\" fill-opacity=\\\"0\\\" style=\\\"stroke:#FFDC8A7d;stroke-miterlimit:10;stroke-width:5px;animation: breathe 1s infinite ease-in-out;animation-delay:0.8s;\\\" cx=\\\"27.75\\\" cy=\\\"27.5\\\" r=\\\"15\\\"/>\\n </svg>\\n \";\n labelElement.style.width = \"30px\";\n labelElement.style.height = \"30px\";\n labelElement.style.left = '-15px';\n labelElement.style.bottom = '-15px';\n labelElement.style.position = 'absolute';\n labelElement.style.cursor = 'pointer';\n //labelElement.textContent = \"T1航站楼\";\n // labelElement.style.backgroundColor = \"rgba(255, 255, 255, 0.8)\";\n // labelElement.style.padding = \"5px\";\n // labelElement.style.borderRadius = \"5px\";\n // labelElement.style.color = \"black\";\n // labelElement.style.fontSize = \"14px\";\n // labelElement.style.fontWeight = 500;\n return labelElement;\n }\n }, {\n key: \"remove\",\n value: function remove(point) {\n point.circle.removeLabel();\n point.circle.remove();\n //console.log(point)\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n var _this3 = this;\n this.alarmList.forEach(function (a) {\n return _this3.remove(a);\n });\n }\n }, {\n key: \"drawPoint\",\n value: function drawPoint(point) {\n var _this4 = this;\n var lng = point.lng;\n var lat = point.lat;\n // const scale = 320;\n // const options = {\n // obj: 'https://docs.mapbox.com/mapbox-gl-js/assets/metlife-building.gltf',\n // type: 'gltf',\n // scale: { x: scale, y: scale, z: 2.7 },\n // units: 'meters',\n // rotation: { x: 90, y: -90, z: 0 }\n // };\n // this.tb.loadObj(options, (model) => {\n // model.setCoords(transform([lng,lat]));\n // model.setRotation({ x: 0, y: 0, z: 241 });\n // this.tb.add(model);\n // });\n var center = (0,_utils_util__WEBPACK_IMPORTED_MODULE_1__.transform)([lng, lat]);\n var geometry = new three__WEBPACK_IMPORTED_MODULE_4__.CircleGeometry(0);\n var circle = new three__WEBPACK_IMPORTED_MODULE_4__.Mesh(geometry, new three__WEBPACK_IMPORTED_MODULE_4__.MeshPhongMaterial({\n color: 0x660000\n }));\n circle = this.tb.Object3D({\n obj: circle,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n circle.addLabel = function (HTMLElement, visible, center, height, ev) {\n if (HTMLElement) {\n var label = circle.drawLabelHTML(HTMLElement, visible, center, height);\n //console.log(label)\n if (!_this4.visible) {\n var _this4$popup;\n label.element.children[0].style.display = 'none';\n (_this4$popup = _this4.popup) === null || _this4$popup === void 0 || _this4$popup.remove();\n }\n label.element.onclick = ev;\n }\n };\n circle.setCoords(center);\n //circle.addEventListener('ObjectMouseOver', (e)=>{console.log(111,e)}, false) \n // let pulseObj = this.tb\n // .Object3D({ obj: this.pulse, units: \"meters\" ,anchor:'center'})\n // .setCoords(center);\n // this.tb.add(pulseObj)\n this.tb.add(circle);\n point.circle = circle;\n if (point.iconHtml) {\n circle.addLabel(point.iconHtml, true, circle.anchor, 0.5);\n } else {\n var el = this.iconHtml.cloneNode(true);\n // for(let i in point){\n // el.setAttribute('data-'+i,point[i]) \n // }\n circle.addLabel(el, true, circle.anchor, 0, function () {\n setTimeout(function () {\n _this4.popup.setLngLat(center).setHTML(\"<div class='alarmpoint-popup-card'>\\n <div class='alarmpoint-popup-title'>\".concat(point.title, \"</div>\\n \").concat(point.items.map(function (a) {\n return \"<div class='alarmpoint-popup-item'>\\n <div class='alarmpoint-popup-item-label'>\".concat(a.label, \"</div>:\\n \").concat(a.text, \"\\n </div>\");\n }).join(''), \"\\n </div>\")).addTo(_this4.map);\n }, 300);\n });\n }\n\n // let circle = new THREE.CircleGeometry(500)\n // let material = new THREE.MeshBasicMaterial({color: 0xffff00,transparent:true})\n // let mesh = new THREE.Mesh(circle,material)\n // let cube = this.tb.Object3D({obj:mesh,units:'meters'})\n // cube.setCoords(transform([lng,lat]))\n // this.tb.add(mesh);\n }\n }, {\n key: \"setPopup\",\n value: function setPopup(point) {\n var lng = point.lng;\n var lat = point.lat;\n var center = (0,_utils_util__WEBPACK_IMPORTED_MODULE_1__.transform)([lng, lat]);\n for (var i in this.alarmList) {\n var a = this.alarmList[i];\n if (a.lng == lng && a.lat == lat) {\n if (!this.visible && a.circle.label.element.children[0].style.display == '') {\n a.circle.label.element.children[0].style.display = 'none';\n this.popup.remove();\n } else {\n a.circle.label.element.children[0].style.display = '';\n this.popup.setLngLat(center).setHTML(\"<div class='alarmpoint-popup-card'>\\n <div class='alarmpoint-popup-title'>\".concat(point.title, \"</div>\\n \").concat(point.items.map(function (b) {\n return \"<div class='alarmpoint-popup-item'>\\n <div class='alarmpoint-popup-item-label'>\".concat(b.label, \"</div>:\\n \").concat(b.text, \"\\n </div>\");\n }).join(''), \"\\n </div>\")).addTo(this.map);\n }\n } else {\n if (!this.visible) {\n a.circle.label.element.children[0].style.display = 'none';\n }\n }\n }\n }\n\n // animate=async ()=>{\n // this.scale = this.scale + 0.01 > 0.03 ? 0.01 :this.scale + 0.01\n // console.log(this.scale)\n // this.alarmList.forEach(a => {\n // a?.circle?.set({ scale:this.scale,duration:600})\n // });\n // await sleep(600)\n // this.tb.update(); \n // requestAnimationFrame(this.animate);\n // }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n // const rotationX = new THREE.Matrix4().makeRotationAxis(\n // new THREE.Vector3(1, 0, 0),\n // modelTransform.rotateX\n // );\n // const rotationY = new THREE.Matrix4().makeRotationAxis(\n // new THREE.Vector3(0, 1, 0),\n // modelTransform.rotateY\n // );\n // const rotationZ = new THREE.Matrix4().makeRotationAxis(\n // new THREE.Vector3(0, 0, 1),\n // modelTransform.rotateZ\n // );\n\n // const m = new THREE.Matrix4().fromArray(matrix);\n // const l = new THREE.Matrix4()\n // .makeTranslation(\n // modelTransform.translateX,\n // modelTransform.translateY,\n // modelTransform.translateZ\n // )\n // .scale(\n // new THREE.Vector3(\n // modelTransform.scale,\n // -modelTransform.scale,\n // modelTransform.scale\n // )\n // )\n // .multiply(rotationX)\n // .multiply(rotationY)\n // .multiply(rotationZ);\n\n // this.camera.projectionMatrix = m.multiply(l); \n //this.pulse.update(); \n this.tb.update();\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/AlarmLayer.js?");
5171
5171
 
5172
5172
  /***/ }),
5173
5173
 
@@ -5178,7 +5178,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
5178
5178
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5179
5179
 
5180
5180
  "use strict";
5181
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ AnimationLayer)\n/* harmony export */ });\n/* harmony import */ var _utils_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/util.js */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\n/* harmony import */ var _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../lib/threebox-plugin */ \"./lib/threebox-plugin/main.js\");\n/* harmony import */ var _utils_barbsHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/barbsHelper.js */ \"./src/utils/barbsHelper.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\n\n\nvar tb = {};\nvar actionStatus = {\n Play: 0,\n Stop: 1,\n Pause: 2\n};\nvar AnimationLayer = /*#__PURE__*/function () {\n function AnimationLayer(id, config) {\n var _this = this;\n _classCallCheck(this, AnimationLayer);\n //当前帧率\n _defineProperty(this, \"timerId\", void 0);\n _defineProperty(this, \"speed\", 1);\n //帧\n _defineProperty(this, \"itemList\", []);\n _defineProperty(this, \"barbsList\", []);\n _defineProperty(this, \"opacity\", 0.8);\n _defineProperty(this, \"meshList\", {});\n _defineProperty(this, \"status\", actionStatus.Pause);\n _defineProperty(this, \"current\", 0);\n _defineProperty(this, \"textClass\", '');\n _defineProperty(this, \"progress\", {\n value: 0\n });\n _defineProperty(this, \"getProgress\", function () {});\n _defineProperty(this, \"setProgress\", function () {});\n var _config = {\n speed: 1,\n item: {},\n opacity: 0.8,\n getProgress: this.getProgress,\n setProgress: this.setProgress(),\n textClass: ''\n };\n config = Object.assign({}, _config, config);\n this.id = id;\n this.type = 'custom';\n this.renderingMode = '2d';\n this.speed = config.speed;\n this.opacity = config.opacity;\n this.getProgress = config.getProgress;\n this.setProgress = config.setProgress;\n this.progress = new Proxy(this.progress, {\n set: function set(target, property, value) {\n target[property] = value;\n _this.setCurrent(Math.floor(_this.itemList.length * value));\n return true;\n },\n get: function get(target, prop) {\n target[prop] = !isNaN(_this.current / _this.itemList.length) ? _this.current / (_this.itemList.length - 1) : 0;\n return target[prop];\n }\n });\n this.createBarbsMesh();\n // this.timerId = setInterval(()=>this.getTick(),1000)\n }\n return _createClass(AnimationLayer, [{\n key: \"destory\",\n value: function destory() {\n delete this;\n }\n }, {\n key: \"createBarbsMesh\",\n value: function createBarbsMesh() {\n for (var i = 0; i < 12; i++) {\n var pathBarbs = (0,_utils_barbsHelper_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(i);\n this.barbsList[i] = {\n color: pathBarbs.color,\n shape: new three__WEBPACK_IMPORTED_MODULE_4__.ShapePath()\n };\n for (var j in pathBarbs.path) {\n if (j == 0) {\n var _this$barbsList$i$sha;\n (_this$barbsList$i$sha = this.barbsList[i].shape).moveTo.apply(_this$barbsList$i$sha, _toConsumableArray(pathBarbs.path[j]));\n } else {\n var _this$barbsList$i$sha2;\n (_this$barbsList$i$sha2 = this.barbsList[i].shape).lineTo.apply(_this$barbsList$i$sha2, _toConsumableArray(pathBarbs.path[j]));\n }\n // let x = 0 ,y = 0; \n // this.barbsList[i].shape.moveTo( x + 5, y + 5 );\n // this.barbsList[i].shape.bezierCurveTo( x + 5, y + 5, x + 4, y, x, y );\n // this.barbsList[i].shape.bezierCurveTo( x - 6, y, x - 6, y + 7,x - 6, y + 7 );\n // this.barbsList[i].shape.bezierCurveTo( x - 6, y + 11, x - 3, y + 15.4, x + 5, y + 19 );\n // this.barbsList[i].shape.bezierCurveTo( x + 12, y + 15.4, x + 16, y + 11, x + 16, y + 7 );\n // this.barbsList[i].shape.bezierCurveTo( x + 16, y + 7, x + 16, y, x + 10, y );\n // this.barbsList[i].shape.bezierCurveTo( x + 7, y, x + 5, y + 5, x + 5, y + 5 );\n }\n }\n }\n\n //创建图片纹理\n }, {\n key: \"init\",\n value: function init(list) {\n this.remove();\n //重置状态\n this.current = 0;\n this.actionStatus = 0;\n this.itemList = list;\n // item.imageList.forEach(async _item => {\n // let texture = new THREE.TextureLoader().load(\n // _item.image);\n // texture.encoding = THREE.sRGBEncoding;\n // texture.flipY = false;\n // this.itemList.push({\n // texture:texture,\n // item:_item\n // }) \n // })\n if (this.itemList.length == 0) {\n return;\n }\n //this.obj = this.loadMesh()\n }\n }, {\n key: \"remove\",\n value: function remove() {\n for (var i in this.meshList) {\n this.tb.remove(this.meshList[i]);\n delete this.meshList[i];\n }\n }\n }, {\n key: \"createMesh\",\n value: function createMesh(id, center) {\n // 创建几何体\n var geometry = new three__WEBPACK_IMPORTED_MODULE_4__.ShapeGeometry();\n // 创建材质\n var material = new three__WEBPACK_IMPORTED_MODULE_4__.MeshBasicMaterial({\n color: 0xffffff\n });\n // 创建网格\n var mesh = new three__WEBPACK_IMPORTED_MODULE_4__.Mesh(geometry, material);\n mesh = tb.Object3D({\n obj: mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n // 将网格添加到场景中\n // scene.add(mesh);\n mesh.setCoords((0,_utils_util_js__WEBPACK_IMPORTED_MODULE_0__.transform)(center));\n tb.renderer.outputEncoding = three__WEBPACK_IMPORTED_MODULE_4__.sRGBEncoding;\n tb.add(mesh);\n this.meshList[id] = mesh;\n // let texture = this.itemList[0].texture\n // let _item = this.itemList[0].item;\n // let geometry = new THREE.PlaneGeometry(_item.width *20,_item.width*20); \n // //geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));\n // let material = new THREE.MeshPhongMaterial({ \n // map:texture, \n // opacity:this.opacity, \n // transparent: true,\n // });\n // material.color.convertSRGBToLinear();\n // let mesh = new THREE.Mesh(geometry, material);\n // mesh.name = 'scanimg'\n // mesh = tb.Object3D({ obj: mesh, units: 'meters',fixedZoom :15 ,anchor:'center'});\n // mesh.setCoords( transform(_item.center));\n // tb.renderer.outputEncoding = THREE.sRGBEncoding;\n // tb.add(mesh); \n // let dom =document.createElement('div') \n // mesh.addLabel(dom,true,{x:mesh.anchor.x,y:mesh.anchor.y+_item.distance *1200,z:mesh.anchor.z},0)\n // mesh.label.element.className += ('' +this.textClass)\n // mesh.label.element.style.fontSize = '24px' \n // return mesh;\n }\n }, {\n key: \"pause\",\n value: function pause() {\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.status = actionStatus.Stop;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"setCurrent\",\n value: function setCurrent(index) {\n if (index < this.itemList.length) {\n this.current = index;\n this.animate();\n } else {\n return;\n }\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"next\",\n value: function next() {\n if (this.current + 1 >= this.itemList.length) {\n return 0;\n }\n this.status = actionStatus.Pause;\n this.current++;\n this.animate();\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"previous\",\n value: function previous() {\n if (this.current - 1 < 0) {\n return 0;\n }\n this.status = actionStatus.Pause;\n this.current--;\n this.animate();\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"createInterval\",\n value: function createInterval() {\n var _this2 = this;\n if (this.timerId) {\n clearInterval(this.timerId);\n }\n this.timerId = setInterval(function () {\n if (_this2.status == actionStatus.Play && _this2.itemList.length > 0) {\n if (_this2.current >= _this2.itemList.length) {\n _this2.current = 0;\n _this2.animate();\n _this2.status = actionStatus.Pause;\n _this2.getProgress(_this2.progress.value, _this2.status, _this2.itemList[_this2.current].time);\n } else {\n _this2.animate();\n _this2.getProgress(_this2.progress.value, _this2.status, _this2.itemList[_this2.current].time);\n _this2.current++;\n }\n }\n }, 1000 / this.speed);\n }\n }, {\n key: \"replay\",\n value: function replay() {\n this.current = 0;\n this.status = actionStatus.Play;\n if (this.itemList.length == 0) {\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n return 0;\n }\n }\n }, {\n key: \"play\",\n value: function play() {\n //获取帧率\n //await this.getTick();\n //this.starttime = new Date().getTime() \n this.status = actionStatus.Play;\n if (this.itemList.length == 0) {\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n return 0;\n }\n }\n }, {\n key: \"getLevel\",\n value: function getLevel(speed) {\n speed = Math.round(speed);\n speed = speed > 24 ? 24 : speed;\n var level = 0;\n // if(speed <= 1 ){\n // color = '#bd1084'\n // }else \n speed = speed < 2 ? 2 : speed;\n if (speed <= 3) {} else if (speed > 3 && speed <= 5) {\n level = 1;\n } else if (speed > 5 && speed <= 7) {\n level = 2;\n } else if (speed > 7 && speed <= 9) {\n level = 3;\n } else if (speed > 9 && speed <= 11) {\n level = 4;\n } else if (speed > 11 && speed <= 13) {\n level = 5;\n } else if (speed > 13 && speed <= 15) {\n level = 6;\n } else if (speed > 15 && speed <= 17) {\n level = 7;\n } else if (speed > 17 && speed <= 19) {\n level = 8;\n } else if (speed > 19 && speed <= 21) {\n level = 9;\n } else if (speed > 21 && speed <= 23) {\n level = 10;\n } else if (speed > 23) {\n level = 11;\n }\n return level;\n }\n }, {\n key: \"animate\",\n value: function animate() {\n // this.obj.model.material.map = this.itemList[this.current].texture\n var _item = this.itemList[this.current];\n for (var i in _item.data) {\n if (!this.meshList[_item.data[i].id]) {\n this.createMesh(_item.data[i].id, _item.data[i].center);\n }\n if (_item.data[i].speed) {\n var color = new three__WEBPACK_IMPORTED_MODULE_4__.Color();\n var level = this.getLevel(_item.data[i].speed);\n var shapeItemInfo = this.barbsList[level];\n var _color = color.set(shapeItemInfo.color);\n var mesh = new three__WEBPACK_IMPORTED_MODULE_4__.Mesh(new three__WEBPACK_IMPORTED_MODULE_4__.ShapeGeometry(shapeItemInfo.shape.toShapes()[0]), this.meshList[_item.data[i].id].model.material);\n mesh = tb.Object3D({\n obj: mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n mesh.setCoords((0,_utils_util_js__WEBPACK_IMPORTED_MODULE_0__.transform)(_item.data[i].center));\n this.meshList[_item.data[i].id].model.geometry = mesh.model.geometry;\n this.meshList[_item.data[i].id].model.material.color = _color;\n tb.update();\n this.map.triggerRepaint();\n }\n //console.log(this.meshList[_item.data[i].id].model.geometry,mesh) \n // console.log(this.meshList[_item.data[i].id].model.material.color)\n //console.log(this.meshList[_item.data[i].id].model) \n }\n // this.obj.label.element.innerHTML = _item.text\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n if (this.timerId) {\n clearInterval(this.timerId);\n }\n this.destory();\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n tb = new _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true,\n passiveRendering: false\n });\n this.createInterval();\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n tb.update();\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/AnimationBarbsLayer.js?");
5181
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ AnimationLayer)\n/* harmony export */ });\n/* harmony import */ var _utils_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/util.js */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\n/* harmony import */ var _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../lib/threebox-plugin */ \"./lib/threebox-plugin/main.js\");\n/* harmony import */ var _utils_barbsHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/barbsHelper.js */ \"./src/utils/barbsHelper.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\n\n\nvar actionStatus = {\n Play: 0,\n Stop: 1,\n Pause: 2\n};\nvar AnimationLayer = /*#__PURE__*/function () {\n function AnimationLayer(id, config) {\n var _this = this;\n _classCallCheck(this, AnimationLayer);\n _defineProperty(this, \"tb\", {});\n //当前帧率\n _defineProperty(this, \"timerId\", void 0);\n _defineProperty(this, \"speed\", 1);\n //帧\n _defineProperty(this, \"itemList\", []);\n _defineProperty(this, \"barbsList\", []);\n _defineProperty(this, \"opacity\", 0.8);\n _defineProperty(this, \"meshList\", {});\n _defineProperty(this, \"status\", actionStatus.Pause);\n _defineProperty(this, \"current\", 0);\n _defineProperty(this, \"textClass\", '');\n _defineProperty(this, \"progress\", {\n value: 0\n });\n _defineProperty(this, \"getProgress\", function () {});\n _defineProperty(this, \"setProgress\", function () {});\n var _config = {\n speed: 1,\n item: {},\n opacity: 0.8,\n getProgress: this.getProgress,\n setProgress: this.setProgress(),\n textClass: ''\n };\n config = Object.assign({}, _config, config);\n this.id = id;\n this.type = 'custom';\n this.renderingMode = '2d';\n this.speed = config.speed;\n this.opacity = config.opacity;\n this.getProgress = config.getProgress;\n this.setProgress = config.setProgress;\n this.progress = new Proxy(this.progress, {\n set: function set(target, property, value) {\n target[property] = value;\n _this.setCurrent(Math.floor(_this.itemList.length * value));\n return true;\n },\n get: function get(target, prop) {\n target[prop] = !isNaN(_this.current / _this.itemList.length) ? _this.current / (_this.itemList.length - 1) : 0;\n return target[prop];\n }\n });\n this.createBarbsMesh();\n // this.timerId = setInterval(()=>this.getTick(),1000)\n }\n return _createClass(AnimationLayer, [{\n key: \"destory\",\n value: function destory() {\n delete this;\n }\n }, {\n key: \"createBarbsMesh\",\n value: function createBarbsMesh() {\n for (var i = 0; i < 12; i++) {\n var pathBarbs = (0,_utils_barbsHelper_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(i);\n this.barbsList[i] = {\n color: pathBarbs.color,\n shape: new three__WEBPACK_IMPORTED_MODULE_4__.ShapePath()\n };\n for (var j in pathBarbs.path) {\n if (j == 0) {\n var _this$barbsList$i$sha;\n (_this$barbsList$i$sha = this.barbsList[i].shape).moveTo.apply(_this$barbsList$i$sha, _toConsumableArray(pathBarbs.path[j]));\n } else {\n var _this$barbsList$i$sha2;\n (_this$barbsList$i$sha2 = this.barbsList[i].shape).lineTo.apply(_this$barbsList$i$sha2, _toConsumableArray(pathBarbs.path[j]));\n }\n // let x = 0 ,y = 0; \n // this.barbsList[i].shape.moveTo( x + 5, y + 5 );\n // this.barbsList[i].shape.bezierCurveTo( x + 5, y + 5, x + 4, y, x, y );\n // this.barbsList[i].shape.bezierCurveTo( x - 6, y, x - 6, y + 7,x - 6, y + 7 );\n // this.barbsList[i].shape.bezierCurveTo( x - 6, y + 11, x - 3, y + 15.4, x + 5, y + 19 );\n // this.barbsList[i].shape.bezierCurveTo( x + 12, y + 15.4, x + 16, y + 11, x + 16, y + 7 );\n // this.barbsList[i].shape.bezierCurveTo( x + 16, y + 7, x + 16, y, x + 10, y );\n // this.barbsList[i].shape.bezierCurveTo( x + 7, y, x + 5, y + 5, x + 5, y + 5 );\n }\n }\n }\n\n //创建图片纹理\n }, {\n key: \"init\",\n value: function init(list) {\n this.remove();\n //重置状态\n this.current = 0;\n this.status = 0;\n this.itemList = list;\n // item.imageList.forEach(async _item => {\n // let texture = new THREE.TextureLoader().load(\n // _item.image);\n // texture.encoding = THREE.sRGBEncoding;\n // texture.flipY = false;\n // this.itemList.push({\n // texture:texture,\n // item:_item\n // }) \n // })\n if (this.itemList.length == 0) {\n return;\n }\n //this.obj = this.loadMesh()\n }\n }, {\n key: \"remove\",\n value: function remove() {\n for (var i in this.meshList) {\n this[\"this\"].tb.remove(this.meshList[i]);\n delete this.meshList[i];\n }\n }\n }, {\n key: \"createMesh\",\n value: function createMesh(id, center) {\n // 创建几何体\n var geometry = new three__WEBPACK_IMPORTED_MODULE_4__.ShapeGeometry();\n // 创建材质\n var material = new three__WEBPACK_IMPORTED_MODULE_4__.MeshBasicMaterial({\n color: 0xffffff\n });\n // 创建网格\n var mesh = new three__WEBPACK_IMPORTED_MODULE_4__.Mesh(geometry, material);\n mesh = this.tb.Object3D({\n obj: mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n // 将网格添加到场景中\n // scene.add(mesh);\n mesh.setCoords((0,_utils_util_js__WEBPACK_IMPORTED_MODULE_0__.transform)(center));\n this.tb.renderer.outputEncoding = three__WEBPACK_IMPORTED_MODULE_4__.sRGBEncoding;\n this.tb.add(mesh);\n this.meshList[id] = mesh;\n // let texture = this.itemList[0].texture\n // let _item = this.itemList[0].item;\n // let geometry = new THREE.PlaneGeometry(_item.width *20,_item.width*20); \n // //geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));\n // let material = new THREE.MeshPhongMaterial({ \n // map:texture, \n // opacity:this.opacity, \n // transparent: true,\n // });\n // material.color.convertSRGBToLinear();\n // let mesh = new THREE.Mesh(geometry, material);\n // mesh.name = 'scanimg'\n // mesh = this.tb.Object3D({ obj: mesh, units: 'meters',fixedZoom :15 ,anchor:'center'});\n // mesh.setCoords( transform(_item.center));\n // this.tb.renderer.outputEncoding = THREE.sRGBEncoding;\n // this.tb.add(mesh); \n // let dom =document.createElement('div') \n // mesh.addLabel(dom,true,{x:mesh.anchor.x,y:mesh.anchor.y+_item.distance *1200,z:mesh.anchor.z},0)\n // mesh.label.element.className += ('' +this.textClass)\n // mesh.label.element.style.fontSize = '24px' \n // return mesh;\n }\n }, {\n key: \"pause\",\n value: function pause() {\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.status = actionStatus.Stop;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"setCurrent\",\n value: function setCurrent(index) {\n if (index < this.itemList.length) {\n this.current = index;\n this.animate();\n } else {\n return;\n }\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"next\",\n value: function next() {\n if (this.current + 1 >= this.itemList.length) {\n return 0;\n }\n this.status = actionStatus.Pause;\n this.current++;\n this.animate();\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"previous\",\n value: function previous() {\n if (this.current - 1 < 0) {\n return 0;\n }\n this.status = actionStatus.Pause;\n this.current--;\n this.animate();\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"createInterval\",\n value: function createInterval() {\n var _this2 = this;\n if (this.timerId) {\n clearInterval(this.timerId);\n }\n this.timerId = setInterval(function () {\n if (_this2.status == actionStatus.Play && _this2.itemList.length > 0) {\n if (_this2.current >= _this2.itemList.length) {\n _this2.current = 0;\n _this2.animate();\n _this2.status = actionStatus.Pause;\n _this2.getProgress(_this2.progress.value, _this2.status, _this2.itemList[_this2.current].time);\n } else {\n _this2.animate();\n _this2.getProgress(_this2.progress.value, _this2.status, _this2.itemList[_this2.current].time);\n _this2.current++;\n }\n }\n }, 1000 / this.speed);\n }\n }, {\n key: \"replay\",\n value: function replay() {\n this.current = 0;\n this.status = actionStatus.Play;\n if (this.itemList.length == 0) {\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n return 0;\n }\n }\n }, {\n key: \"play\",\n value: function play() {\n //获取帧率\n //await this.getTick();\n //this.starttime = new Date().getTime() \n this.status = actionStatus.Play;\n if (this.itemList.length == 0) {\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n return 0;\n }\n }\n }, {\n key: \"getLevel\",\n value: function getLevel(speed) {\n speed = Math.round(speed);\n speed = speed > 24 ? 24 : speed;\n var level = 0;\n // if(speed <= 1 ){\n // color = '#bd1084'\n // }else \n speed = speed < 2 ? 2 : speed;\n if (speed <= 3) {} else if (speed > 3 && speed <= 5) {\n level = 1;\n } else if (speed > 5 && speed <= 7) {\n level = 2;\n } else if (speed > 7 && speed <= 9) {\n level = 3;\n } else if (speed > 9 && speed <= 11) {\n level = 4;\n } else if (speed > 11 && speed <= 13) {\n level = 5;\n } else if (speed > 13 && speed <= 15) {\n level = 6;\n } else if (speed > 15 && speed <= 17) {\n level = 7;\n } else if (speed > 17 && speed <= 19) {\n level = 8;\n } else if (speed > 19 && speed <= 21) {\n level = 9;\n } else if (speed > 21 && speed <= 23) {\n level = 10;\n } else if (speed > 23) {\n level = 11;\n }\n return level;\n }\n }, {\n key: \"animate\",\n value: function animate() {\n // this.obj.model.material.map = this.itemList[this.current].texture\n var _item = this.itemList[this.current];\n for (var i in _item.data) {\n if (!this.meshList[_item.data[i].id]) {\n this.createMesh(_item.data[i].id, _item.data[i].center);\n }\n if (_item.data[i].speed) {\n var color = new three__WEBPACK_IMPORTED_MODULE_4__.Color();\n var level = this.getLevel(_item.data[i].speed);\n var shapeItemInfo = this.barbsList[level];\n var _color = color.set(shapeItemInfo.color);\n var mesh = new three__WEBPACK_IMPORTED_MODULE_4__.Mesh(new three__WEBPACK_IMPORTED_MODULE_4__.ShapeGeometry(shapeItemInfo.shape.toShapes()[0]), this.meshList[_item.data[i].id].model.material);\n mesh = this.tb.Object3D({\n obj: mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n mesh.setCoords((0,_utils_util_js__WEBPACK_IMPORTED_MODULE_0__.transform)(_item.data[i].center));\n this.meshList[_item.data[i].id].model.geometry = mesh.model.geometry;\n this.meshList[_item.data[i].id].model.material.color = _color;\n this.tb.update();\n this.map.triggerRepaint();\n }\n //console.log(this.meshList[_item.data[i].id].model.geometry,mesh) \n // console.log(this.meshList[_item.data[i].id].model.material.color)\n //console.log(this.meshList[_item.data[i].id].model) \n }\n // this.obj.label.element.innerHTML = _item.text\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n if (this.timerId) {\n clearInterval(this.timerId);\n }\n this.destory();\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n this.tb = new _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true,\n passiveRendering: false\n });\n this.createInterval();\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n this.tb.update();\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/AnimationBarbsLayer.js?");
5182
5182
 
5183
5183
  /***/ }),
5184
5184
 
@@ -5189,7 +5189,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
5189
5189
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5190
5190
 
5191
5191
  "use strict";
5192
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ AnimationLayer)\n/* harmony export */ });\n/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/util */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\n/* harmony import */ var _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../lib/threebox-plugin */ \"./lib/threebox-plugin/main.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\nvar tb = {};\nvar actionStatus = {\n Play: 0,\n Stop: 1,\n Pause: 2\n};\nvar AnimationLayer = /*#__PURE__*/function () {\n function AnimationLayer(id, config) {\n var _this = this;\n _classCallCheck(this, AnimationLayer);\n //当前帧率\n _defineProperty(this, \"timerId\", void 0);\n _defineProperty(this, \"speed\", 1);\n //帧\n _defineProperty(this, \"itemList\", []);\n _defineProperty(this, \"opacity\", 0.8);\n _defineProperty(this, \"obj\", {});\n _defineProperty(this, \"status\", actionStatus.Pause);\n _defineProperty(this, \"current\", 0);\n _defineProperty(this, \"textClass\", '');\n _defineProperty(this, \"progress\", {\n value: 0\n });\n _defineProperty(this, \"getProgress\", function () {});\n _defineProperty(this, \"setProgress\", function () {});\n var _config = {\n speed: 1,\n item: {},\n opacity: 0.8,\n getProgress: this.getProgress,\n setProgress: this.setProgress(),\n textClass: ''\n };\n config = Object.assign({}, _config, config);\n this.id = id;\n this.type = 'custom';\n this.renderingMode = '2d';\n this.speed = config.speed;\n this.opacity = config.opacity;\n this.getProgress = config.getProgress;\n this.setProgress = config.setProgress;\n this.textClass = config.textClass;\n this.progress = new Proxy(this.progress, {\n set: function set(target, property, value) {\n target[property] = value;\n _this.setCurrent(Math.floor(_this.itemList.length * value));\n return true;\n },\n get: function get(target, prop) {\n target[prop] = !isNaN(_this.current / _this.itemList.length) ? _this.current / (_this.itemList.length - 1) : 0;\n return target[prop];\n }\n });\n // this.timerId = setInterval(()=>this.getTick(),1000)\n }\n\n //创建图片纹理\n return _createClass(AnimationLayer, [{\n key: \"destory\",\n value: function destory() {\n delete this;\n }\n }, {\n key: \"createTexture\",\n value: function createTexture(item) {\n var _this2 = this;\n this.remove();\n //重置状态\n this.current = 0;\n this.actionStatus = 0;\n this.itemList = [];\n item.imageList.forEach( /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_item) {\n var texture;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n texture = new three__WEBPACK_IMPORTED_MODULE_3__.TextureLoader().load(_item.image);\n texture.encoding = three__WEBPACK_IMPORTED_MODULE_3__.sRGBEncoding;\n texture.flipY = false;\n _this2.itemList.push({\n texture: texture,\n item: _item\n });\n case 4:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }());\n if (this.itemList.length == 0) {\n return;\n }\n this.obj = this.loadMesh();\n }\n }, {\n key: \"remove\",\n value: function remove() {\n if (this.obj.label) {\n this.obj.label.element.remove();\n tb.remove(this.obj);\n }\n }\n }, {\n key: \"loadMesh\",\n value: function loadMesh() {\n var texture = this.itemList[0].texture;\n var _item = this.itemList[0].item;\n var geometry = new three__WEBPACK_IMPORTED_MODULE_3__.PlaneGeometry(_item.width * 20, _item.width * 20);\n //geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));\n var material = new three__WEBPACK_IMPORTED_MODULE_3__.MeshPhongMaterial({\n map: texture,\n opacity: this.opacity,\n transparent: true\n });\n material.color.convertSRGBToLinear();\n var mesh = new three__WEBPACK_IMPORTED_MODULE_3__.Mesh(geometry, material);\n mesh.name = 'scanimg';\n mesh = tb.Object3D({\n obj: mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n mesh.setCoords((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(_item.center));\n tb.renderer.outputEncoding = three__WEBPACK_IMPORTED_MODULE_3__.sRGBEncoding;\n tb.add(mesh);\n var dom = document.createElement('div');\n mesh.addLabel(dom, true, {\n x: mesh.anchor.x,\n y: mesh.anchor.y + _item.distance * 1200,\n z: mesh.anchor.z\n }, 0);\n mesh.label.element.className += '' + this.textClass;\n mesh.label.element.style.fontSize = '24px';\n return mesh;\n }\n }, {\n key: \"pause\",\n value: function pause() {\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status);\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.status = actionStatus.Stop;\n this.getProgress(this.progress.value, this.status);\n }\n }, {\n key: \"setCurrent\",\n value: function setCurrent(index) {\n if (index < this.itemList.length) {\n this.current = index;\n this.animate();\n } else {\n return;\n }\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status);\n }\n }, {\n key: \"next\",\n value: function next() {\n if (this.current + 1 >= this.itemList.length) {\n return 0;\n }\n this.status = actionStatus.Pause;\n this.current++;\n this.animate();\n this.getProgress(this.progress.value, this.status);\n }\n }, {\n key: \"previous\",\n value: function previous() {\n if (this.current - 1 < 0) {\n return 0;\n }\n this.status = actionStatus.Pause;\n this.current--;\n this.animate();\n this.getProgress(this.progress.value, this.status);\n }\n }, {\n key: \"createInterval\",\n value: function createInterval() {\n var _this3 = this;\n if (this.timerId) {\n clearInterval(this.timerId);\n }\n this.timerId = setInterval(function () {\n if (_this3.status == actionStatus.Play && _this3.itemList.length > 0) {\n if (_this3.current >= _this3.itemList.length) {\n _this3.current = 0;\n _this3.animate();\n _this3.status = actionStatus.Pause;\n _this3.getProgress(_this3.progress.value, _this3.status);\n } else {\n _this3.animate();\n _this3.getProgress(_this3.progress.value, _this3.status);\n _this3.current++;\n }\n }\n }, 1000 / this.speed);\n }\n }, {\n key: \"replay\",\n value: function replay() {\n this.current = 0;\n this.status = actionStatus.Play;\n if (this.itemList.length == 0) {\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status);\n return 0;\n }\n }\n }, {\n key: \"play\",\n value: function play() {\n //获取帧率\n //await this.getTick();\n //this.starttime = new Date().getTime() \n this.status = actionStatus.Play;\n if (this.itemList.length == 0) {\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status);\n return 0;\n }\n }\n }, {\n key: \"animate\",\n value: function animate() {\n this.obj.model.material.map = this.itemList[this.current].texture;\n var _item = this.itemList[this.current].item;\n this.obj.label.element.innerHTML = _item.text;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n if (this.timerId) {\n clearInterval(this.timerId);\n }\n this.destory();\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n tb = new _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true,\n passiveRendering: false\n });\n this.createInterval();\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n tb.update();\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/AnimationLayer.js?");
5192
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ AnimationLayer)\n/* harmony export */ });\n/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/util */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\n/* harmony import */ var _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../lib/threebox-plugin */ \"./lib/threebox-plugin/main.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\nvar actionStatus = {\n Play: 0,\n Stop: 1,\n Pause: 2\n};\nvar AnimationLayer = /*#__PURE__*/function () {\n function AnimationLayer(id, config) {\n var _this = this;\n _classCallCheck(this, AnimationLayer);\n _defineProperty(this, \"tb\", {});\n //当前帧率\n _defineProperty(this, \"timerId\", void 0);\n _defineProperty(this, \"speed\", 1);\n //帧\n _defineProperty(this, \"itemList\", []);\n _defineProperty(this, \"opacity\", 0.8);\n _defineProperty(this, \"obj\", {});\n _defineProperty(this, \"status\", actionStatus.Pause);\n _defineProperty(this, \"current\", 0);\n _defineProperty(this, \"textClass\", '');\n _defineProperty(this, \"progress\", {\n value: 0\n });\n _defineProperty(this, \"getProgress\", function () {});\n _defineProperty(this, \"setProgress\", function () {});\n var _config = {\n speed: 1,\n item: {},\n opacity: 0.8,\n getProgress: this.getProgress,\n setProgress: this.setProgress(),\n textClass: ''\n };\n config = Object.assign({}, _config, config);\n this.id = id;\n this.type = 'custom';\n this.renderingMode = '2d';\n this.speed = config.speed;\n this.opacity = config.opacity;\n this.getProgress = config.getProgress;\n this.setProgress = config.setProgress;\n this.textClass = config.textClass;\n this.progress = new Proxy(this.progress, {\n set: function set(target, property, value) {\n target[property] = value;\n _this.setCurrent(Math.floor(_this.itemList.length * value));\n return true;\n },\n get: function get(target, prop) {\n target[prop] = !isNaN(_this.current / _this.itemList.length) ? _this.current / (_this.itemList.length - 1) : 0;\n return target[prop];\n }\n });\n // this.timerId = setInterval(()=>this.getTick(),1000)\n }\n\n //创建图片纹理\n return _createClass(AnimationLayer, [{\n key: \"destory\",\n value: function destory() {\n delete this;\n }\n }, {\n key: \"createTexture\",\n value: function createTexture(item) {\n var _this2 = this;\n this.remove();\n //重置状态\n this.current = 0;\n this.status = 0;\n this.itemList = [];\n item.imageList.forEach( /*#__PURE__*/function () {\n var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_item) {\n var texture;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n texture = new three__WEBPACK_IMPORTED_MODULE_3__.TextureLoader().load(_item.image);\n texture.encoding = three__WEBPACK_IMPORTED_MODULE_3__.sRGBEncoding;\n //texture.flipY = false;\n texture.center.set(0.5, 0.5);\n texture.rotation = -Math.PI;\n texture.colorSpace = three__WEBPACK_IMPORTED_MODULE_3__.SRGBColorSpace;\n _this2.itemList.push({\n texture: texture,\n item: _item\n });\n case 6:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }());\n if (this.itemList.length == 0) {\n return;\n }\n this.obj = this.loadMesh();\n }\n }, {\n key: \"remove\",\n value: function remove() {\n if (this.obj.label) {\n this.obj.label.element.remove();\n }\n this.tb.remove(this.obj);\n }\n }, {\n key: \"loadMesh\",\n value: function loadMesh() {\n var texture = this.itemList[0].texture;\n var _item = this.itemList[0].item;\n var geometry = new three__WEBPACK_IMPORTED_MODULE_3__.PlaneGeometry(_item.width * 20, _item.width * 20);\n //geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));\n var material = new three__WEBPACK_IMPORTED_MODULE_3__.MeshBasicMaterial({\n map: texture,\n opacity: this.opacity,\n transparent: true\n });\n material.color.convertSRGBToLinear();\n var mesh = new three__WEBPACK_IMPORTED_MODULE_3__.Mesh(geometry, material);\n mesh.name = 'scanimg';\n mesh = this.tb.Object3D({\n obj: mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n mesh.setCoords((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(_item.center));\n this.tb.renderer.outputEncoding = three__WEBPACK_IMPORTED_MODULE_3__.sRGBEncoding;\n this.tb.add(mesh);\n var dom = document.createElement('div');\n mesh.addLabel(dom, true, {\n x: mesh.anchor.x,\n y: mesh.anchor.y + _item.distance * 1200,\n z: mesh.anchor.z\n }, 0);\n mesh.label.element.className += '' + this.textClass;\n mesh.label.element.style.fontSize = '24px';\n return mesh;\n }\n }, {\n key: \"setOpacity\",\n value: function setOpacity(opacity) {\n this.opacity = opacity;\n this.obj.model.material.opacity = this.opacity;\n this.tb.update();\n this.map.triggerRepaint();\n }\n }, {\n key: \"pause\",\n value: function pause() {\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status);\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.status = actionStatus.Stop;\n this.getProgress(this.progress.value, this.status);\n }\n }, {\n key: \"setCurrent\",\n value: function setCurrent(index) {\n if (index < this.itemList.length) {\n this.current = index;\n this.animate();\n } else {\n return;\n }\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status);\n }\n }, {\n key: \"next\",\n value: function next() {\n if (this.current + 1 >= this.itemList.length) {\n return 0;\n }\n this.status = actionStatus.Pause;\n this.current++;\n this.animate();\n this.getProgress(this.progress.value, this.status);\n }\n }, {\n key: \"previous\",\n value: function previous() {\n if (this.current - 1 < 0) {\n return 0;\n }\n this.status = actionStatus.Pause;\n this.current--;\n this.animate();\n this.getProgress(this.progress.value, this.status);\n }\n }, {\n key: \"createInterval\",\n value: function createInterval() {\n var _this3 = this;\n if (this.timerId) {\n clearInterval(this.timerId);\n }\n this.timerId = setInterval(function () {\n if (_this3.status == actionStatus.Play && _this3.itemList.length > 0) {\n if (_this3.current >= _this3.itemList.length) {\n _this3.current = 0;\n _this3.animate();\n _this3.status = actionStatus.Pause;\n _this3.getProgress(_this3.progress.value, _this3.status);\n } else {\n _this3.animate();\n _this3.getProgress(_this3.progress.value, _this3.status);\n _this3.current++;\n }\n }\n }, 1000 / this.speed);\n }\n }, {\n key: \"replay\",\n value: function replay() {\n this.current = 0;\n this.status = actionStatus.Play;\n if (this.itemList.length == 0) {\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status);\n return 0;\n }\n }\n }, {\n key: \"play\",\n value: function play() {\n //获取帧率\n //await this.getTick();\n //this.starttime = new Date().getTime() \n this.status = actionStatus.Play;\n if (this.itemList.length == 0) {\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status);\n return 0;\n }\n }\n }, {\n key: \"animate\",\n value: function animate() {\n this.obj.model.material.map = this.itemList[this.current].texture;\n var _item = this.itemList[this.current].item;\n this.obj.label.element.innerHTML = _item.text;\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n if (this.timerId) {\n clearInterval(this.timerId);\n }\n this.remove();\n this.destory();\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n this.tb = new _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true,\n passiveRendering: false\n });\n this.createInterval();\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n this.tb.update();\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/AnimationLayer.js?");
5193
5193
 
5194
5194
  /***/ }),
5195
5195
 
@@ -5200,7 +5200,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
5200
5200
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5201
5201
 
5202
5202
  "use strict";
5203
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ CustomIconLayer)\n/* harmony export */ });\n/* harmony import */ var _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../lib/threebox-plugin */ \"./lib/threebox-plugin/main.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _utils_util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/util.js */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\nvar tb = {};\nvar CustomIconLayer = /*#__PURE__*/function () {\n function CustomIconLayer(id) {\n var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n _classCallCheck(this, CustomIconLayer);\n _defineProperty(this, \"iconList\", []);\n _defineProperty(this, \"scale\", 0.01);\n _defineProperty(this, \"iconHtml\", void 0);\n _defineProperty(this, \"visible\", true);\n _defineProperty(this, \"popup\", void 0);\n _defineProperty(this, \"legend\", []);\n _defineProperty(this, \"updateLegend\", null);\n this.id = id;\n this.visible = visible;\n this.type = 'custom';\n this.renderingMode = '2d';\n //this.iconList = iconList\n this.iconHtml = this.createElement();\n }\n\n // modelAsMercatorCoordinate = mapboxgl.MercatorCoordinate.fromLngLat(\n // modelOrigin,\n // modelAltitude\n // );\n return _createClass(CustomIconLayer, [{\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n tb = new _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_0__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true\n });\n this.popup = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].Popup({\n className: 'monitorpoint-popup',\n closeButton: false\n });\n // this.iconHtml = this.createElement()\n }\n }, {\n key: \"createElement\",\n value: function createElement() {\n var labelElement = document.createElement(\"div\");\n labelElement.innerHTML = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" \\n xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\" \\n fill=\\\"none\\\" version=\\\"1.1\\\" width=\\\"20\\\" height=\\\"60\\\" viewBox=\\\"0 0 20 60\\\">\\n <defs>\\n <linearGradient x1=\\\"0.9103034138679504\\\" y1=\\\"1\\\" x2=\\\"0.9103034138679504\\\" y2=\\\"0.17939318716526031\\\" id=\\\"master_svg0_169_14309\\\">\\n <stop offset=\\\"0%\\\" stop-color=\\\"#FFFFFF\\\" stop-opacity=\\\"0.00009999999747378752\\\"/>\\n <stop offset=\\\"100%\\\" stop-color=\\\"#FF8A2B\\\" stop-opacity=\\\"1\\\"/>\\n </linearGradient>\\n <linearGradient x1=\\\"0.9103034138679504\\\" y1=\\\"1\\\" x2=\\\"0.9103034138679504\\\" y2=\\\"0.17939318716526031\\\" id=\\\"master_svg1_169_14304\\\">\\n <stop offset=\\\"0%\\\" stop-color=\\\"#FF8253\\\" stop-opacity=\\\"0.00009999999747378752\\\"/>\\n <stop offset=\\\"100%\\\" stop-color=\\\"#FF8A2B\\\" stop-opacity=\\\"1\\\"/>\\n </linearGradient>\\n <linearGradient x1=\\\"0.9103034138679504\\\" y1=\\\"1\\\" x2=\\\"0.9103034138679504\\\" y2=\\\"0.17939318716526031\\\" id=\\\"master_svg2_169_14304\\\">\\n <stop offset=\\\"0%\\\" stop-color=\\\"#FF8253\\\" stop-opacity=\\\"0.00009999999747378752\\\"/>\\n <stop offset=\\\"100%\\\" stop-color=\\\"#FF8A2B\\\" stop-opacity=\\\"1\\\"/></linearGradient>\\n <linearGradient x1=\\\"0.9103034138679504\\\" y1=\\\"1\\\" x2=\\\"0.9103034138679504\\\" y2=\\\"0.17939318716526031\\\" id=\\\"master_svg3_169_14304\\\">\\n <stop offset=\\\"0%\\\" stop-color=\\\"#FF8253\\\" stop-opacity=\\\"0.00009999999747378752\\\"/>\\n <stop offset=\\\"100%\\\" stop-color=\\\"#FF8A2B\\\" stop-opacity=\\\"1\\\"/>\\n </linearGradient><linearGradient x1=\\\"0.9103034138679504\\\" y1=\\\"1\\\" x2=\\\"0.9103034138679504\\\" y2=\\\"0.17939318716526031\\\" id=\\\"master_svg4_169_14304\\\">\\n <stop offset=\\\"0%\\\" stop-color=\\\"#FF8253\\\" stop-opacity=\\\"0.00009999999747378752\\\"/>\\n <stop offset=\\\"100%\\\" stop-color=\\\"#FF8A2B\\\" stop-opacity=\\\"1\\\"/></linearGradient>\\n <filter id=\\\"master_svg5_169_14339\\\" filterUnits=\\\"objectBoundingBox\\\" color-interpolation-filters=\\\"sRGB\\\" x=\\\"0\\\" y=\\\"0\\\" width=\\\"1\\\" height=\\\"1\\\">\\n <feFlood flood-opacity=\\\"0\\\" result=\\\"BackgroundImageFix\\\"/>\\n <feBlend mode=\\\"normal\\\" in=\\\"SourceGraphic\\\" in2=\\\"BackgroundImageFix\\\" result=\\\"shape\\\"/>\\n <feColorMatrix in=\\\"SourceAlpha\\\" type=\\\"matrix\\\" result=\\\"hardAlpha\\\" values=\\\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\\\"/>\\n <feOffset dy=\\\"0\\\" dx=\\\"0\\\"/><feGaussianBlur stdDeviation=\\\"5\\\"/>\\n <feComposite in2=\\\"hardAlpha\\\" operator=\\\"arithmetic\\\" k2=\\\"-1\\\" k3=\\\"1\\\"/>\\n <feColorMatrix type=\\\"matrix\\\" values=\\\"0 0 0 0 1 0 0 0 0 0.4474431872367859 0 0 0 0 0 0 0 0 0.5 0\\\"/>\\n <feBlend mode=\\\"normal\\\" in2=\\\"shape\\\" result=\\\"effect1_innerShadow\\\"/>\\n </filter><filter id=\\\"master_svg6_169_14338\\\" filterUnits=\\\"objectBoundingBox\\\" color-interpolation-filters=\\\"sRGB\\\" x=\\\"0\\\" y=\\\"0\\\" width=\\\"1\\\" height=\\\"1\\\">\\n <feFlood flood-opacity=\\\"0\\\" result=\\\"BackgroundImageFix\\\"/>\\n <feBlend mode=\\\"normal\\\" in=\\\"SourceGraphic\\\" in2=\\\"BackgroundImageFix\\\" result=\\\"shape\\\"/>\\n <feColorMatrix in=\\\"SourceAlpha\\\" type=\\\"matrix\\\" result=\\\"hardAlpha\\\" values=\\\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\\\"/>\\n <feOffset dy=\\\"0\\\" dx=\\\"0\\\"/><feGaussianBlur stdDeviation=\\\"5\\\"/>\\n <feComposite in2=\\\"hardAlpha\\\" operator=\\\"arithmetic\\\" k2=\\\"-1\\\" k3=\\\"1\\\"/>\\n <feColorMatrix type=\\\"matrix\\\" values=\\\"0 0 0 0 1 0 0 0 0 0.4474431872367859 0 0 0 0 0 0 0 0 0.5 0\\\"/>\\n <feBlend mode=\\\"normal\\\" in2=\\\"shape\\\" result=\\\"effect1_innerShadow\\\"/>\\n </filter>\\n <linearGradient x1=\\\"0.40567007660865784\\\" y1=\\\"-0.664190948009491\\\" x2=\\\"-0.5453921556472777\\\" y2=\\\"0.5244689583778382\\\" id=\\\"master_svg7_169_14291\\\">\\n <stop offset=\\\"0%\\\" stop-color=\\\"#FFBE56\\\" stop-opacity=\\\"1\\\"/>\\n <stop offset=\\\"100%\\\" stop-color=\\\"#FF8A2B\\\" stop-opacity=\\\"1\\\"/>\\n </linearGradient><filter id=\\\"master_svg8_169_14337\\\" filterUnits=\\\"objectBoundingBox\\\" color-interpolation-filters=\\\"sRGB\\\" x=\\\"0\\\" y=\\\"0\\\" width=\\\"1\\\" height=\\\"1\\\"><feFlood flood-opacity=\\\"0\\\" result=\\\"BackgroundImageFix\\\"/><feBlend mode=\\\"normal\\\" in=\\\"SourceGraphic\\\" in2=\\\"BackgroundImageFix\\\" result=\\\"shape\\\"/><feColorMatrix in=\\\"SourceAlpha\\\" type=\\\"matrix\\\" result=\\\"hardAlpha\\\" values=\\\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\\\"/><feOffset dy=\\\"0\\\" dx=\\\"0\\\"/><feGaussianBlur stdDeviation=\\\"5\\\"/><feComposite in2=\\\"hardAlpha\\\" operator=\\\"arithmetic\\\" k2=\\\"-1\\\" k3=\\\"1\\\"/><feColorMatrix type=\\\"matrix\\\" values=\\\"0 0 0 0 1 0 0 0 0 0.4474431872367859 0 0 0 0 0 0 0 0 0.5 0\\\"/><feBlend mode=\\\"normal\\\" in2=\\\"shape\\\" result=\\\"effect1_innerShadow\\\"/></filter><filter id=\\\"master_svg9_169_14336\\\" filterUnits=\\\"objectBoundingBox\\\" color-interpolation-filters=\\\"sRGB\\\" x=\\\"0\\\" y=\\\"0\\\" width=\\\"1\\\" height=\\\"1\\\"><feFlood flood-opacity=\\\"0\\\" result=\\\"BackgroundImageFix\\\"/><feBlend mode=\\\"normal\\\" in=\\\"SourceGraphic\\\" in2=\\\"BackgroundImageFix\\\" result=\\\"shape\\\"/><feColorMatrix in=\\\"SourceAlpha\\\" type=\\\"matrix\\\" result=\\\"hardAlpha\\\" values=\\\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\\\"/><feOffset dy=\\\"0\\\" dx=\\\"0\\\"/><feGaussianBlur stdDeviation=\\\"5\\\"/><feComposite in2=\\\"hardAlpha\\\" operator=\\\"arithmetic\\\" k2=\\\"-1\\\" k3=\\\"1\\\"/><feColorMatrix type=\\\"matrix\\\" values=\\\"0 0 0 0 1 0 0 0 0 0.4474431872367859 0 0 0 0 0 0 0 0 0.5 0\\\"/><feBlend mode=\\\"normal\\\" in2=\\\"shape\\\" result=\\\"effect1_innerShadow\\\"/></filter><linearGradient x1=\\\"0.40567007660865784\\\" y1=\\\"-0.664190948009491\\\" x2=\\\"-0.5453921556472778\\\" y2=\\\"0.5244689583778381\\\" id=\\\"master_svga_169_14291\\\"><stop offset=\\\"0%\\\" stop-color=\\\"#FFBE56\\\" stop-opacity=\\\"1\\\"/><stop offset=\\\"100%\\\" stop-color=\\\"#FF8A2B\\\" stop-opacity=\\\"1\\\"/></linearGradient><filter id=\\\"master_svgb_169_14335\\\" filterUnits=\\\"objectBoundingBox\\\" color-interpolation-filters=\\\"sRGB\\\" x=\\\"0\\\" y=\\\"0\\\" width=\\\"1\\\" height=\\\"1\\\"><feFlood flood-opacity=\\\"0\\\" result=\\\"BackgroundImageFix\\\"/><feBlend mode=\\\"normal\\\" in=\\\"SourceGraphic\\\" in2=\\\"BackgroundImageFix\\\" result=\\\"shape\\\"/><feColorMatrix in=\\\"SourceAlpha\\\" type=\\\"matrix\\\" result=\\\"hardAlpha\\\" values=\\\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\\\"/><feOffset dy=\\\"0\\\" dx=\\\"0\\\"/><feGaussianBlur stdDeviation=\\\"2\\\"/><feComposite in2=\\\"hardAlpha\\\" operator=\\\"arithmetic\\\" k2=\\\"-1\\\" k3=\\\"1\\\"/><feColorMatrix type=\\\"matrix\\\" values=\\\"0 0 0 0 1 0 0 0 0 0.47676610946655273 0 0 0 0 0.21103277802467346 0 0 0 0.5 0\\\"/><feBlend mode=\\\"normal\\\" in2=\\\"shape\\\" result=\\\"effect1_innerShadow\\\"/></filter><filter id=\\\"master_svgc_169_14334\\\" filterUnits=\\\"objectBoundingBox\\\" color-interpolation-filters=\\\"sRGB\\\" x=\\\"0\\\" y=\\\"0\\\" width=\\\"1\\\" height=\\\"1\\\"><feFlood flood-opacity=\\\"0\\\" result=\\\"BackgroundImageFix\\\"/><feBlend mode=\\\"normal\\\" in=\\\"SourceGraphic\\\" in2=\\\"BackgroundImageFix\\\" result=\\\"shape\\\"/><feColorMatrix in=\\\"SourceAlpha\\\" type=\\\"matrix\\\" result=\\\"hardAlpha\\\" values=\\\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\\\"/><feOffset dy=\\\"0\\\" dx=\\\"0\\\"/><feGaussianBlur stdDeviation=\\\"2\\\"/><feComposite in2=\\\"hardAlpha\\\" operator=\\\"arithmetic\\\" k2=\\\"-1\\\" k3=\\\"1\\\"/><feColorMatrix type=\\\"matrix\\\" values=\\\"0 0 0 0 1 0 0 0 0 0.47676610946655273 0 0 0 0 0.21103277802467346 0 0 0 0.5 0\\\"/><feBlend mode=\\\"normal\\\" in2=\\\"shape\\\" result=\\\"effect1_innerShadow\\\"/></filter><filter id=\\\"master_svgd_169_14333\\\" filterUnits=\\\"objectBoundingBox\\\" color-interpolation-filters=\\\"sRGB\\\" x=\\\"-9.701101864207292\\\" y=\\\"-0.38207080479466976\\\" width=\\\"20.402203728414584\\\" height=\\\"1.7641416095893394\\\"><feFlood flood-opacity=\\\"0\\\" result=\\\"BackgroundImageFix\\\"/><feBlend mode=\\\"normal\\\" in=\\\"SourceGraphic\\\" in2=\\\"BackgroundImageFix\\\" result=\\\"shape\\\"/><feGaussianBlur stdDeviation=\\\"2.7182817459106445\\\" result=\\\"effect1_foregroundBlur\\\"/></filter><linearGradient x1=\\\"0.9103034138679504\\\" y1=\\\"1\\\" x2=\\\"0.9103034138679504\\\" y2=\\\"0.17939318716526031\\\" id=\\\"master_svge_169_14313\\\"><stop offset=\\\"0%\\\" stop-color=\\\"#FF9440\\\" stop-opacity=\\\"0.00009999999747378752\\\"/><stop offset=\\\"100%\\\" stop-color=\\\"#FF8A2B\\\" stop-opacity=\\\"1\\\"/></linearGradient></defs><g><g style=\\\"opacity:0.9200232625007629;\\\"><path d=\\\"M10.617879358825684,48.293071997070314C10.617879358825684,48.30647199707031,10.613109358825684,48.36347199707031,10.606019358825684,48.420271997070316L10.606019358825684,48.56037199707031L10.603539358825683,48.56037199707031C10.572139358825684,49.92517199707031,10.337331358825683,50.98567199707031,10.052137358825684,50.98567199707031C9.778652358825683,50.98567199707031,9.532135958825684,49.92517199707031,9.500755558825684,48.56037199707031L9.498253528825684,48.56037199707031L9.498253528825684,48.420271997070316C9.497546844825683,48.36347199707031,9.497069358825684,48.30647199707031,9.497069358825684,48.293071997070314C9.497069358825684,48.19127199707032,9.497546844825683,48.13407199707031,9.498253528825684,48.07747199707031L9.498253528825684,18.485671997070312L9.999998358825684,19.35359299707031L10.606019358825684,18.485671997070312L10.606019358825684,48.07747199707031C10.613109358825684,48.13407199707031,10.617879358825684,48.19127199707032,10.617879358825684,48.293071997070314Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"url(#master_svg0_169_14309)\\\" fill-opacity=\\\"1\\\"/></g><g style=\\\"opacity:0.3800920844078064;\\\"><path d=\\\"M15.497690702392578,37.82866581054687C15.497690702392578,37.83694581054687,15.495559702392578,37.872005810546874,15.492398702392578,37.906975810546875L15.492398702392578,37.993185810546876C15.477281702392578,38.833035810546875,15.372521702392579,39.48567581054687,15.245282702392577,39.48567581054687C15.123267702392578,39.48567581054687,15.013283702392577,38.833035810546875,14.999283302392579,37.993185810546876L14.998167019392579,37.906975810546875C14.997851733392578,37.872005810546874,14.997638702392578,37.83694581054687,14.997638702392578,37.82866581054687C14.997638702392578,37.76602581054688,14.997851733392578,37.730865810546874,14.998167019392579,37.695995810546876L14.998167019392579,31.47970581054692L15.492398702392578,31.47970581054692L15.492398702392578,37.695995810546876C15.495559702392578,37.730865810546874,15.497690702392578,37.76602581054688,15.497690702392578,37.82866581054687Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"url(#master_svg1_169_14304)\\\" fill-opacity=\\\"1\\\"/></g><g style=\\\"opacity:0.9200232625007629;\\\"><path d=\\\"M18.998055005981445,25.328627168273925C18.998055005981445,25.336927168273924,18.995924005981447,25.372027168273924,18.992763005981445,25.407027168273927L18.992763005981445,25.493227168273926C18.977646005981445,26.333027168273926,18.872886005981446,26.985627168273925,18.745647005981446,26.985627168273925C18.623632005981445,26.985627168273925,18.513648005981445,26.333027168273926,18.499647605981444,25.493227168273926L18.498531322981446,25.407027168273927C18.498216036981447,25.372027168273924,18.498003005981445,25.336927168273924,18.498003005981445,25.328627168273925C18.498003005981445,25.266027168273926,18.498216036981447,25.230827168273926,18.498531322981446,25.196027168273925L18.498531322981446,14.67452716827393L18.992763005981445,14.67452716827393L18.992763005981445,25.196027168273925C18.995924005981447,25.230827168273926,18.998055005981445,25.266027168273926,18.998055005981445,25.328627168273925Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"url(#master_svg2_169_14304)\\\" fill-opacity=\\\"1\\\"/></g><g style=\\\"opacity:0.6218145489692688;\\\"><path d=\\\"M3.9965009936828615,47.32870689453125C3.9965009936828615,47.33698689453125,3.994369993682861,47.37205689453125,3.991208993682861,47.40702689453125L3.991208993682861,47.49322689453125C3.976091993682861,48.33311689453125,3.8713319936828614,48.98571689453125,3.7440929936828615,48.98571689453125C3.6220779936828613,48.98571689453125,3.5120939936828615,48.33311689453125,3.4980935936828614,47.49322689453125L3.4969773106828614,47.40702689453125C3.4966620246828612,47.37205689453125,3.4964489936828613,47.33698689453125,3.4964489936828613,47.32870689453125C3.4964489936828613,47.26607689453125,3.4966620246828612,47.23090689453125,3.4969773106828614,47.19603689453125L3.4969773106828614,37.62481689453124L3.991208993682861,37.62481689453124L3.991208993682861,47.19603689453125C3.994369993682861,47.23090689453125,3.9965009936828615,47.26607689453125,3.9965009936828615,47.32870689453125Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"url(#master_svg3_169_14304)\\\" fill-opacity=\\\"1\\\"/></g><g style=\\\"opacity:0.3800920844078064;\\\"><path d=\\\"M1.496242130710602,18.34302883720398C1.496242130710602,18.35122883720398,1.4941111307106019,18.38632883720398,1.4909501307106017,18.42132883720398L1.4909501307106017,18.507528837203978C1.4758331307106018,19.34732883720398,1.3710731307106019,20.00002883720398,1.2438341307106018,20.00002883720398C1.1218191307106018,20.00002883720398,1.0118351307106017,19.34732883720398,0.9978347307106018,18.507528837203978L0.9967184477106018,18.42132883720398C0.9964031617106018,18.38632883720398,0.9961901307106018,18.35122883720398,0.9961901307106018,18.34302883720398C0.9961901307106018,18.28032883720398,0.9964031617106018,18.24522883720398,0.9967184477106018,18.21032883720398L0.9967184477106018,3.1745288372039835L1.4909501307106017,3.1745288372039835L1.4909501307106017,18.21032883720398C1.4941111307106019,18.24522883720398,1.496242130710602,18.28032883720398,1.496242130710602,18.34302883720398Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"url(#master_svg4_169_14304)\\\" fill-opacity=\\\"1\\\"/></g><g transform=\\\"matrix(0.7071067690849304,-0.7071067690849304,0.7071067690849304,0.7071067690849304,-7.071067016499735,2.928932029825954)\\\" filter=\\\"url(#master_svg5_169_14339)\\\"><path d=\\\"M0.006496830000014211,10.006495876325683L14.142100000000013,9.999999046325684L14.135600000000014,24.135599046325684L1.3858798715202003e-14,24.142099046325683L0.006496830000014211,10.006495876325683Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"#FF8A2B\\\" fill-opacity=\\\"0.5068290829658508\\\"/></g><g transform=\\\"matrix(0.7071067690849304,-0.7071067690849304,0.7071067690849304,0.7071067690849304,-7.071067016499735,2.928932029825954)\\\" filter=\\\"url(#master_svg6_169_14338)\\\"><path d=\\\"M13.357700000000014,10.000359559325684L14.142100000000013,9.999999046325684L14.141800000000014,10.784394046325684L14.135600000000014,24.135599046325684L0.7843950000000142,24.141799046325684L1.4210854715202004e-14,24.142099046325683L0.0003605130000142109,23.357699046325685L0.006496830000014211,10.006495876325683L13.357700000000014,10.000359559325684ZM0.7905310000000142,10.790530046325683L0.7847560000000142,23.357399046325682L13.351600000000014,23.35159904632568L13.357400000000014,10.784755046325683L0.7905310000000142,10.790530046325683Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"url(#master_svg7_169_14291)\\\" fill-opacity=\\\"1\\\"/></g><g transform=\\\"matrix(0.7071067690849304,-0.7071067690849304,0.7071067690849304,0.7071067690849304,-6.152542907700379,4.9748735395406385)\\\" style=\\\"opacity:0.3131277859210968;\\\" filter=\\\"url(#master_svg8_169_14337)\\\"><path d=\\\"M2.933525901522827,9.918807130541992L12.928931951522827,9.914213180541992L12.924341951522827,19.909623180541992L2.928931951522827,19.914213180541992L2.933525901522827,9.918807130541992Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"#FF8A2B\\\" fill-opacity=\\\"0.5068290829658508\\\"/></g><g transform=\\\"matrix(0.7071067690849304,-0.7071067690849304,0.7071067690849304,0.7071067690849304,-6.152542907700379,4.9748735395406385)\\\" style=\\\"opacity:0.3131277859210968;\\\" filter=\\\"url(#master_svg9_169_14336)\\\"><path d=\\\"M12.144531951522827,9.914573693541993L12.928931951522827,9.914213180541992L12.928571951522827,10.698608180541992L12.924341951522827,19.908803180541994L12.924341951522827,19.909623180541992L12.923521951522828,19.909623180541992L3.713326951522827,19.91385318054199L2.928931951522827,19.914213180541992L2.929292464522827,19.129813180541994L2.933525901522827,9.918807130541992L12.144531951522827,9.914573693541993ZM3.7175609515228274,10.702842180541992L3.713687951522827,19.129453180541994L12.140301951522828,19.125583180541994L12.144171951522827,10.698969180541992L3.7175609515228274,10.702842180541992Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"url(#master_svga_169_14291)\\\" fill-opacity=\\\"1\\\"/></g><g filter=\\\"url(#master_svgb_169_14335)\\\"><path d=\\\"M11.169635151672363,7.1724288786315915L9.999975151672363,6.004092059701592L8.829125151672363,7.173628878631591L7.174185151672363,7.174478878631592L7.173345151672363,8.827548878631593L5.999566076172363,9.999998878631592L7.172145151672363,11.17125887863159L7.171295151672363,12.82843887863159L8.830345151672363,12.827588878631591L9.999975151672363,13.995908878631592L11.170815151672365,12.826388878631592L12.825845151672365,12.825548878631592L12.826685151672363,11.172388878631592L14.000395151672363,9.999998878631592L12.827885151672362,8.828818878631592L12.828735151672364,7.171588878631592L11.169635151672363,7.1724288786315915Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"#FFFFFF\\\" fill-opacity=\\\"1\\\"/></g><g filter=\\\"url(#master_svgc_169_14334)\\\"><path d=\\\"M9.999975151672363,6.004092059701592L11.169635151672363,7.1724288786315915L12.436535151672363,7.171788878631592L12.828735151672364,7.171588878631592L12.828535151672362,7.563778878631592L12.827885151672362,8.828818878631592L13.722915151672364,9.722828878631592L14.000395151672363,9.999998878631592L13.722915151672364,10.277168878631592L12.826685151672363,11.172388878631592L12.825845151672365,12.825548878631592L11.170815151672365,12.826388878631592L9.999975151672363,13.995908878631592L8.830345151672363,12.827588878631591L7.563495151672363,12.828238878631591L7.171295151672363,12.82843887863159L7.171495151672364,12.436238878631592L7.172145151672363,11.17125887863159L6.277048151672363,10.277168878631592L5.999566076172363,9.999998878631592L6.277048151672363,9.722828878631592L7.173345151672363,8.827548878631593L7.174185151672363,7.174478878631592L8.829125151672363,7.173628878631591L9.999975151672363,6.004092059701592ZM11.007395151672362,7.564708878631592L12.436335151672363,7.563978878631592L12.435605151672362,8.991318878631592L13.445435151672363,9.999998878631592L12.434575151672362,11.009718878631592L12.433845151672363,12.43354887863159L11.008415151672363,12.434278878631591L9.999975151672363,13.441578878631592L8.992585151672364,12.435308878631592L7.563695151672363,12.436038878631592L7.5644251516723635,11.008758878631593L6.554529151672363,9.999998878631592L7.565455151672364,8.990218878631591L7.5661851516723635,7.566468878631592L8.991535151672363,7.565748878631592L9.999975151672363,6.558430878631592L10.892465151672363,7.449918878631592L11.007395151672362,7.564708878631592Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"#FFAC4B\\\" fill-opacity=\\\"1\\\"/></g><g style=\\\"opacity:0.5446661114692688;\\\" filter=\\\"url(#master_svgd_169_14333)\\\"><path d=\\\"M10.617879358825684,48.627859826660156C10.617879358825684,48.63965982666016,10.613109358825684,48.68955982666016,10.606019358825684,48.739359826660156L10.606019358825684,48.861959826660154L10.603539358825683,48.861959826660154C10.572139358825684,50.05705982666016,10.337331358825683,50.985659826660154,10.052137358825684,50.985659826660154C9.778652358825683,50.985659826660154,9.532135958825684,50.05705982666016,9.500755558825684,48.861959826660154L9.498253528825684,48.861959826660154L9.498253528825684,48.739359826660156C9.497546844825683,48.68955982666016,9.497069358825684,48.63965982666016,9.497069358825684,48.627859826660156C9.497069358825684,48.538759826660154,9.497546844825683,48.48875982666016,9.498253528825684,48.439059826660156L9.498253528825684,22.527259826660156L9.999998358825684,23.287248826660157L10.606019358825684,22.527259826660156L10.606019358825684,48.439059826660156C10.613109358825684,48.48875982666016,10.617879358825684,48.538759826660154,10.617879358825684,48.627859826660156Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"url(#master_svge_169_14313)\\\" fill-opacity=\\\"1\\\"/></g></g></svg>\\n \";\n labelElement.style.width = \"20px\";\n labelElement.style.height = \"60px\";\n labelElement.style.left = '-10px';\n labelElement.style.bottom = '-60px';\n labelElement.style.position = 'absolute';\n labelElement.style.cursor = 'pointer';\n return labelElement;\n }\n }, {\n key: \"setMapIcon\",\n value: function setMapIcon(_item) {\n for (var i in this.legend) {\n if (this.legend[i].type == _item.type) {\n if (_item.visible) {\n this.iconList.forEach(function (a) {\n if (a.type == _item.type && a.circle) {\n a.circle.label.element.children[0].style.display = 'none';\n }\n if (a.type == _item.type && a.marker) {\n a.marker.getElement().style.display = 'none';\n }\n });\n //this.legend[i].obj.label.element.children[0].style.display = 'none'\n this.legend[i].visible = false;\n } else {\n this.iconList.forEach(function (a) {\n if (a.type == _item.type && a.circle) {\n a.circle.label.element.children[0].style.display = '';\n }\n if (a.type == _item.type && a.marker) {\n a.marker.getElement().style.display = '';\n }\n });\n //this.legend[i].obj.label.element.children[0].style.display = ''\n this.legend[i].visible = true;\n }\n }\n }\n if (this.updateLegend) {\n this.updateLegend(this.legend);\n }\n }\n }, {\n key: \"addToMap\",\n value: function addToMap(list) {\n var _this = this;\n var _loop = function _loop(i) {\n _this.drawPointByMarker(list[i]);\n var _legend = _this.legend.find(function (a) {\n return a.type == list[i].type;\n });\n if (!_legend) {\n _this.legend.push({\n type: list[i].type,\n name: list[i].name,\n icon: list[i].icon,\n visible: true\n });\n }\n };\n for (var i in list) {\n _loop(i);\n }\n this.iconList = list;\n if (this.updateLegend) {\n this.updateLegend(this.legend);\n }\n }\n }, {\n key: \"drawPointByMarker\",\n value: function drawPointByMarker(point) {\n var lng = point.lng;\n var lat = point.lat;\n var center = (0,_utils_util_js__WEBPACK_IMPORTED_MODULE_1__.transform)([lng, lat]);\n var el;\n el = point.icon ? point.icon : this.iconHtml.cloneNode(true);\n var marker = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].Marker({\n element: el,\n anchor: 'center'\n }).setLngLat(center).setPopup(new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].Popup({\n className: 'monitorpoint-popup',\n closeButton: false,\n anchor: 'bottom',\n offset: [-10, -20]\n }).setLngLat(center).setHTML(\"<div class='monitorpoint-popup-card'>\\n <div class='monitorpoint-popup-title'>\".concat(point.title, \"</div>\\n \").concat(point.items.map(function (a) {\n return \"<div class='monitorpoint-popup-item'>\\n <div class='monitorpoint-popup-item-label'>\".concat(a.label, \"</div>:\\n \").concat(a.text, \"\\n </div>\");\n }).join(''), \"\\n </div>\"))).addTo(this.map);\n point.marker = marker;\n }\n }, {\n key: \"drawPoint\",\n value: function drawPoint(point) {\n var _this2 = this;\n var lng = point.lng;\n var lat = point.lat;\n var center = (0,_utils_util_js__WEBPACK_IMPORTED_MODULE_1__.transform)([lng, lat]);\n var geometry = new three__WEBPACK_IMPORTED_MODULE_3__.CircleGeometry(0);\n var circle = new three__WEBPACK_IMPORTED_MODULE_3__.Mesh(geometry, new three__WEBPACK_IMPORTED_MODULE_3__.MeshPhongMaterial({\n color: 0x660000\n }));\n circle = tb.Object3D({\n obj: circle,\n units: 'meters',\n anchor: 'center'\n });\n circle.addLabel = function (HTMLElement, visible, center, height, ev) {\n if (HTMLElement) {\n var label = circle.drawLabelHTML(HTMLElement, visible, center, height);\n //console.log(label)\n if (!_this2.visible) {\n label.element.children[0].style.display = 'none';\n }\n label.element.onclick = ev;\n }\n };\n circle.setCoords(center);\n tb.add(circle);\n point.circle = circle;\n if (point.icon) {\n circle.addLabel(point.icon, true, circle.anchor, 0, function () {\n setTimeout(function () {\n _this2.popup.setLngLat(center).setHTML(\"<div class='monitorpoint-popup-card'>\\n <div class='monitorpoint-popup-title'>\".concat(point.title, \"</div>\\n \").concat(point.items.map(function (a) {\n return \"<div class='monitorpoint-popup-item'>\\n <div class='monitorpoint-popup-item-label'>\".concat(a.label, \"</div>:\\n \").concat(a.text, \"\\n </div>\");\n }).join(''), \"\\n </div>\")).addTo(_this2.map);\n }, 300);\n });\n } else {\n var el = this.iconHtml.cloneNode(true);\n circle.addLabel(el, true, circle.anchor, 0, function () {\n setTimeout(function () {\n _this2.popup.setLngLat(center).setHTML(\"<div class='monitorpoint-popup-card'>\\n <div class='monitorpoint-popup-title'>\".concat(point.title, \"</div>\\n \").concat(point.items.map(function (a) {\n return \"<div class='monitorpoint-popup-item'>\\n <div class='monitorpoint-popup-item-label'>\".concat(a.label, \"</div>:\\n \").concat(a.text, \"\\n </div>\");\n }).join(''), \"\\n </div>\")).addTo(_this2.map);\n }, 300);\n });\n }\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n tb.update();\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/CustomIconLayer.js?");
5203
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ CustomIconLayer)\n/* harmony export */ });\n/* harmony import */ var _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../lib/threebox-plugin */ \"./lib/threebox-plugin/main.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _utils_util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/util.js */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\nvar CustomIconLayer = /*#__PURE__*/function () {\n function CustomIconLayer(id) {\n var visible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n _classCallCheck(this, CustomIconLayer);\n _defineProperty(this, \"tb\", {});\n _defineProperty(this, \"iconList\", []);\n _defineProperty(this, \"scale\", 0.01);\n _defineProperty(this, \"iconHtml\", void 0);\n _defineProperty(this, \"visible\", true);\n _defineProperty(this, \"popup\", void 0);\n _defineProperty(this, \"legend\", []);\n _defineProperty(this, \"updateLegend\", null);\n this.id = id;\n this.visible = visible;\n this.type = 'custom';\n this.renderingMode = '2d';\n //this.iconList = iconList\n this.iconHtml = this.createElement();\n }\n\n // modelAsMercatorCoordinate = mapboxgl.MercatorCoordinate.fromLngLat(\n // modelOrigin,\n // modelAltitude\n // );\n return _createClass(CustomIconLayer, [{\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n this.tb = new _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_0__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true\n });\n this.popup = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].Popup({\n className: 'monitorpoint-popup',\n closeButton: false\n });\n // this.iconHtml = this.createElement()\n }\n }, {\n key: \"createElement\",\n value: function createElement() {\n var labelElement = document.createElement(\"div\");\n labelElement.innerHTML = \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" \\n xmlns:xlink=\\\"http://www.w3.org/1999/xlink\\\" \\n fill=\\\"none\\\" version=\\\"1.1\\\" width=\\\"20\\\" height=\\\"60\\\" viewBox=\\\"0 0 20 60\\\">\\n <defs>\\n <linearGradient x1=\\\"0.9103034138679504\\\" y1=\\\"1\\\" x2=\\\"0.9103034138679504\\\" y2=\\\"0.17939318716526031\\\" id=\\\"master_svg0_169_14309\\\">\\n <stop offset=\\\"0%\\\" stop-color=\\\"#FFFFFF\\\" stop-opacity=\\\"0.00009999999747378752\\\"/>\\n <stop offset=\\\"100%\\\" stop-color=\\\"#FF8A2B\\\" stop-opacity=\\\"1\\\"/>\\n </linearGradient>\\n <linearGradient x1=\\\"0.9103034138679504\\\" y1=\\\"1\\\" x2=\\\"0.9103034138679504\\\" y2=\\\"0.17939318716526031\\\" id=\\\"master_svg1_169_14304\\\">\\n <stop offset=\\\"0%\\\" stop-color=\\\"#FF8253\\\" stop-opacity=\\\"0.00009999999747378752\\\"/>\\n <stop offset=\\\"100%\\\" stop-color=\\\"#FF8A2B\\\" stop-opacity=\\\"1\\\"/>\\n </linearGradient>\\n <linearGradient x1=\\\"0.9103034138679504\\\" y1=\\\"1\\\" x2=\\\"0.9103034138679504\\\" y2=\\\"0.17939318716526031\\\" id=\\\"master_svg2_169_14304\\\">\\n <stop offset=\\\"0%\\\" stop-color=\\\"#FF8253\\\" stop-opacity=\\\"0.00009999999747378752\\\"/>\\n <stop offset=\\\"100%\\\" stop-color=\\\"#FF8A2B\\\" stop-opacity=\\\"1\\\"/></linearGradient>\\n <linearGradient x1=\\\"0.9103034138679504\\\" y1=\\\"1\\\" x2=\\\"0.9103034138679504\\\" y2=\\\"0.17939318716526031\\\" id=\\\"master_svg3_169_14304\\\">\\n <stop offset=\\\"0%\\\" stop-color=\\\"#FF8253\\\" stop-opacity=\\\"0.00009999999747378752\\\"/>\\n <stop offset=\\\"100%\\\" stop-color=\\\"#FF8A2B\\\" stop-opacity=\\\"1\\\"/>\\n </linearGradient><linearGradient x1=\\\"0.9103034138679504\\\" y1=\\\"1\\\" x2=\\\"0.9103034138679504\\\" y2=\\\"0.17939318716526031\\\" id=\\\"master_svg4_169_14304\\\">\\n <stop offset=\\\"0%\\\" stop-color=\\\"#FF8253\\\" stop-opacity=\\\"0.00009999999747378752\\\"/>\\n <stop offset=\\\"100%\\\" stop-color=\\\"#FF8A2B\\\" stop-opacity=\\\"1\\\"/></linearGradient>\\n <filter id=\\\"master_svg5_169_14339\\\" filterUnits=\\\"objectBoundingBox\\\" color-interpolation-filters=\\\"sRGB\\\" x=\\\"0\\\" y=\\\"0\\\" width=\\\"1\\\" height=\\\"1\\\">\\n <feFlood flood-opacity=\\\"0\\\" result=\\\"BackgroundImageFix\\\"/>\\n <feBlend mode=\\\"normal\\\" in=\\\"SourceGraphic\\\" in2=\\\"BackgroundImageFix\\\" result=\\\"shape\\\"/>\\n <feColorMatrix in=\\\"SourceAlpha\\\" type=\\\"matrix\\\" result=\\\"hardAlpha\\\" values=\\\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\\\"/>\\n <feOffset dy=\\\"0\\\" dx=\\\"0\\\"/><feGaussianBlur stdDeviation=\\\"5\\\"/>\\n <feComposite in2=\\\"hardAlpha\\\" operator=\\\"arithmetic\\\" k2=\\\"-1\\\" k3=\\\"1\\\"/>\\n <feColorMatrix type=\\\"matrix\\\" values=\\\"0 0 0 0 1 0 0 0 0 0.4474431872367859 0 0 0 0 0 0 0 0 0.5 0\\\"/>\\n <feBlend mode=\\\"normal\\\" in2=\\\"shape\\\" result=\\\"effect1_innerShadow\\\"/>\\n </filter><filter id=\\\"master_svg6_169_14338\\\" filterUnits=\\\"objectBoundingBox\\\" color-interpolation-filters=\\\"sRGB\\\" x=\\\"0\\\" y=\\\"0\\\" width=\\\"1\\\" height=\\\"1\\\">\\n <feFlood flood-opacity=\\\"0\\\" result=\\\"BackgroundImageFix\\\"/>\\n <feBlend mode=\\\"normal\\\" in=\\\"SourceGraphic\\\" in2=\\\"BackgroundImageFix\\\" result=\\\"shape\\\"/>\\n <feColorMatrix in=\\\"SourceAlpha\\\" type=\\\"matrix\\\" result=\\\"hardAlpha\\\" values=\\\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\\\"/>\\n <feOffset dy=\\\"0\\\" dx=\\\"0\\\"/><feGaussianBlur stdDeviation=\\\"5\\\"/>\\n <feComposite in2=\\\"hardAlpha\\\" operator=\\\"arithmetic\\\" k2=\\\"-1\\\" k3=\\\"1\\\"/>\\n <feColorMatrix type=\\\"matrix\\\" values=\\\"0 0 0 0 1 0 0 0 0 0.4474431872367859 0 0 0 0 0 0 0 0 0.5 0\\\"/>\\n <feBlend mode=\\\"normal\\\" in2=\\\"shape\\\" result=\\\"effect1_innerShadow\\\"/>\\n </filter>\\n <linearGradient x1=\\\"0.40567007660865784\\\" y1=\\\"-0.664190948009491\\\" x2=\\\"-0.5453921556472777\\\" y2=\\\"0.5244689583778382\\\" id=\\\"master_svg7_169_14291\\\">\\n <stop offset=\\\"0%\\\" stop-color=\\\"#FFBE56\\\" stop-opacity=\\\"1\\\"/>\\n <stop offset=\\\"100%\\\" stop-color=\\\"#FF8A2B\\\" stop-opacity=\\\"1\\\"/>\\n </linearGradient><filter id=\\\"master_svg8_169_14337\\\" filterUnits=\\\"objectBoundingBox\\\" color-interpolation-filters=\\\"sRGB\\\" x=\\\"0\\\" y=\\\"0\\\" width=\\\"1\\\" height=\\\"1\\\"><feFlood flood-opacity=\\\"0\\\" result=\\\"BackgroundImageFix\\\"/><feBlend mode=\\\"normal\\\" in=\\\"SourceGraphic\\\" in2=\\\"BackgroundImageFix\\\" result=\\\"shape\\\"/><feColorMatrix in=\\\"SourceAlpha\\\" type=\\\"matrix\\\" result=\\\"hardAlpha\\\" values=\\\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\\\"/><feOffset dy=\\\"0\\\" dx=\\\"0\\\"/><feGaussianBlur stdDeviation=\\\"5\\\"/><feComposite in2=\\\"hardAlpha\\\" operator=\\\"arithmetic\\\" k2=\\\"-1\\\" k3=\\\"1\\\"/><feColorMatrix type=\\\"matrix\\\" values=\\\"0 0 0 0 1 0 0 0 0 0.4474431872367859 0 0 0 0 0 0 0 0 0.5 0\\\"/><feBlend mode=\\\"normal\\\" in2=\\\"shape\\\" result=\\\"effect1_innerShadow\\\"/></filter><filter id=\\\"master_svg9_169_14336\\\" filterUnits=\\\"objectBoundingBox\\\" color-interpolation-filters=\\\"sRGB\\\" x=\\\"0\\\" y=\\\"0\\\" width=\\\"1\\\" height=\\\"1\\\"><feFlood flood-opacity=\\\"0\\\" result=\\\"BackgroundImageFix\\\"/><feBlend mode=\\\"normal\\\" in=\\\"SourceGraphic\\\" in2=\\\"BackgroundImageFix\\\" result=\\\"shape\\\"/><feColorMatrix in=\\\"SourceAlpha\\\" type=\\\"matrix\\\" result=\\\"hardAlpha\\\" values=\\\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\\\"/><feOffset dy=\\\"0\\\" dx=\\\"0\\\"/><feGaussianBlur stdDeviation=\\\"5\\\"/><feComposite in2=\\\"hardAlpha\\\" operator=\\\"arithmetic\\\" k2=\\\"-1\\\" k3=\\\"1\\\"/><feColorMatrix type=\\\"matrix\\\" values=\\\"0 0 0 0 1 0 0 0 0 0.4474431872367859 0 0 0 0 0 0 0 0 0.5 0\\\"/><feBlend mode=\\\"normal\\\" in2=\\\"shape\\\" result=\\\"effect1_innerShadow\\\"/></filter><linearGradient x1=\\\"0.40567007660865784\\\" y1=\\\"-0.664190948009491\\\" x2=\\\"-0.5453921556472778\\\" y2=\\\"0.5244689583778381\\\" id=\\\"master_svga_169_14291\\\"><stop offset=\\\"0%\\\" stop-color=\\\"#FFBE56\\\" stop-opacity=\\\"1\\\"/><stop offset=\\\"100%\\\" stop-color=\\\"#FF8A2B\\\" stop-opacity=\\\"1\\\"/></linearGradient><filter id=\\\"master_svgb_169_14335\\\" filterUnits=\\\"objectBoundingBox\\\" color-interpolation-filters=\\\"sRGB\\\" x=\\\"0\\\" y=\\\"0\\\" width=\\\"1\\\" height=\\\"1\\\"><feFlood flood-opacity=\\\"0\\\" result=\\\"BackgroundImageFix\\\"/><feBlend mode=\\\"normal\\\" in=\\\"SourceGraphic\\\" in2=\\\"BackgroundImageFix\\\" result=\\\"shape\\\"/><feColorMatrix in=\\\"SourceAlpha\\\" type=\\\"matrix\\\" result=\\\"hardAlpha\\\" values=\\\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\\\"/><feOffset dy=\\\"0\\\" dx=\\\"0\\\"/><feGaussianBlur stdDeviation=\\\"2\\\"/><feComposite in2=\\\"hardAlpha\\\" operator=\\\"arithmetic\\\" k2=\\\"-1\\\" k3=\\\"1\\\"/><feColorMatrix type=\\\"matrix\\\" values=\\\"0 0 0 0 1 0 0 0 0 0.47676610946655273 0 0 0 0 0.21103277802467346 0 0 0 0.5 0\\\"/><feBlend mode=\\\"normal\\\" in2=\\\"shape\\\" result=\\\"effect1_innerShadow\\\"/></filter><filter id=\\\"master_svgc_169_14334\\\" filterUnits=\\\"objectBoundingBox\\\" color-interpolation-filters=\\\"sRGB\\\" x=\\\"0\\\" y=\\\"0\\\" width=\\\"1\\\" height=\\\"1\\\"><feFlood flood-opacity=\\\"0\\\" result=\\\"BackgroundImageFix\\\"/><feBlend mode=\\\"normal\\\" in=\\\"SourceGraphic\\\" in2=\\\"BackgroundImageFix\\\" result=\\\"shape\\\"/><feColorMatrix in=\\\"SourceAlpha\\\" type=\\\"matrix\\\" result=\\\"hardAlpha\\\" values=\\\"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0\\\"/><feOffset dy=\\\"0\\\" dx=\\\"0\\\"/><feGaussianBlur stdDeviation=\\\"2\\\"/><feComposite in2=\\\"hardAlpha\\\" operator=\\\"arithmetic\\\" k2=\\\"-1\\\" k3=\\\"1\\\"/><feColorMatrix type=\\\"matrix\\\" values=\\\"0 0 0 0 1 0 0 0 0 0.47676610946655273 0 0 0 0 0.21103277802467346 0 0 0 0.5 0\\\"/><feBlend mode=\\\"normal\\\" in2=\\\"shape\\\" result=\\\"effect1_innerShadow\\\"/></filter><filter id=\\\"master_svgd_169_14333\\\" filterUnits=\\\"objectBoundingBox\\\" color-interpolation-filters=\\\"sRGB\\\" x=\\\"-9.701101864207292\\\" y=\\\"-0.38207080479466976\\\" width=\\\"20.402203728414584\\\" height=\\\"1.7641416095893394\\\"><feFlood flood-opacity=\\\"0\\\" result=\\\"BackgroundImageFix\\\"/><feBlend mode=\\\"normal\\\" in=\\\"SourceGraphic\\\" in2=\\\"BackgroundImageFix\\\" result=\\\"shape\\\"/><feGaussianBlur stdDeviation=\\\"2.7182817459106445\\\" result=\\\"effect1_foregroundBlur\\\"/></filter><linearGradient x1=\\\"0.9103034138679504\\\" y1=\\\"1\\\" x2=\\\"0.9103034138679504\\\" y2=\\\"0.17939318716526031\\\" id=\\\"master_svge_169_14313\\\"><stop offset=\\\"0%\\\" stop-color=\\\"#FF9440\\\" stop-opacity=\\\"0.00009999999747378752\\\"/><stop offset=\\\"100%\\\" stop-color=\\\"#FF8A2B\\\" stop-opacity=\\\"1\\\"/></linearGradient></defs><g><g style=\\\"opacity:0.9200232625007629;\\\"><path d=\\\"M10.617879358825684,48.293071997070314C10.617879358825684,48.30647199707031,10.613109358825684,48.36347199707031,10.606019358825684,48.420271997070316L10.606019358825684,48.56037199707031L10.603539358825683,48.56037199707031C10.572139358825684,49.92517199707031,10.337331358825683,50.98567199707031,10.052137358825684,50.98567199707031C9.778652358825683,50.98567199707031,9.532135958825684,49.92517199707031,9.500755558825684,48.56037199707031L9.498253528825684,48.56037199707031L9.498253528825684,48.420271997070316C9.497546844825683,48.36347199707031,9.497069358825684,48.30647199707031,9.497069358825684,48.293071997070314C9.497069358825684,48.19127199707032,9.497546844825683,48.13407199707031,9.498253528825684,48.07747199707031L9.498253528825684,18.485671997070312L9.999998358825684,19.35359299707031L10.606019358825684,18.485671997070312L10.606019358825684,48.07747199707031C10.613109358825684,48.13407199707031,10.617879358825684,48.19127199707032,10.617879358825684,48.293071997070314Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"url(#master_svg0_169_14309)\\\" fill-opacity=\\\"1\\\"/></g><g style=\\\"opacity:0.3800920844078064;\\\"><path d=\\\"M15.497690702392578,37.82866581054687C15.497690702392578,37.83694581054687,15.495559702392578,37.872005810546874,15.492398702392578,37.906975810546875L15.492398702392578,37.993185810546876C15.477281702392578,38.833035810546875,15.372521702392579,39.48567581054687,15.245282702392577,39.48567581054687C15.123267702392578,39.48567581054687,15.013283702392577,38.833035810546875,14.999283302392579,37.993185810546876L14.998167019392579,37.906975810546875C14.997851733392578,37.872005810546874,14.997638702392578,37.83694581054687,14.997638702392578,37.82866581054687C14.997638702392578,37.76602581054688,14.997851733392578,37.730865810546874,14.998167019392579,37.695995810546876L14.998167019392579,31.47970581054692L15.492398702392578,31.47970581054692L15.492398702392578,37.695995810546876C15.495559702392578,37.730865810546874,15.497690702392578,37.76602581054688,15.497690702392578,37.82866581054687Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"url(#master_svg1_169_14304)\\\" fill-opacity=\\\"1\\\"/></g><g style=\\\"opacity:0.9200232625007629;\\\"><path d=\\\"M18.998055005981445,25.328627168273925C18.998055005981445,25.336927168273924,18.995924005981447,25.372027168273924,18.992763005981445,25.407027168273927L18.992763005981445,25.493227168273926C18.977646005981445,26.333027168273926,18.872886005981446,26.985627168273925,18.745647005981446,26.985627168273925C18.623632005981445,26.985627168273925,18.513648005981445,26.333027168273926,18.499647605981444,25.493227168273926L18.498531322981446,25.407027168273927C18.498216036981447,25.372027168273924,18.498003005981445,25.336927168273924,18.498003005981445,25.328627168273925C18.498003005981445,25.266027168273926,18.498216036981447,25.230827168273926,18.498531322981446,25.196027168273925L18.498531322981446,14.67452716827393L18.992763005981445,14.67452716827393L18.992763005981445,25.196027168273925C18.995924005981447,25.230827168273926,18.998055005981445,25.266027168273926,18.998055005981445,25.328627168273925Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"url(#master_svg2_169_14304)\\\" fill-opacity=\\\"1\\\"/></g><g style=\\\"opacity:0.6218145489692688;\\\"><path d=\\\"M3.9965009936828615,47.32870689453125C3.9965009936828615,47.33698689453125,3.994369993682861,47.37205689453125,3.991208993682861,47.40702689453125L3.991208993682861,47.49322689453125C3.976091993682861,48.33311689453125,3.8713319936828614,48.98571689453125,3.7440929936828615,48.98571689453125C3.6220779936828613,48.98571689453125,3.5120939936828615,48.33311689453125,3.4980935936828614,47.49322689453125L3.4969773106828614,47.40702689453125C3.4966620246828612,47.37205689453125,3.4964489936828613,47.33698689453125,3.4964489936828613,47.32870689453125C3.4964489936828613,47.26607689453125,3.4966620246828612,47.23090689453125,3.4969773106828614,47.19603689453125L3.4969773106828614,37.62481689453124L3.991208993682861,37.62481689453124L3.991208993682861,47.19603689453125C3.994369993682861,47.23090689453125,3.9965009936828615,47.26607689453125,3.9965009936828615,47.32870689453125Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"url(#master_svg3_169_14304)\\\" fill-opacity=\\\"1\\\"/></g><g style=\\\"opacity:0.3800920844078064;\\\"><path d=\\\"M1.496242130710602,18.34302883720398C1.496242130710602,18.35122883720398,1.4941111307106019,18.38632883720398,1.4909501307106017,18.42132883720398L1.4909501307106017,18.507528837203978C1.4758331307106018,19.34732883720398,1.3710731307106019,20.00002883720398,1.2438341307106018,20.00002883720398C1.1218191307106018,20.00002883720398,1.0118351307106017,19.34732883720398,0.9978347307106018,18.507528837203978L0.9967184477106018,18.42132883720398C0.9964031617106018,18.38632883720398,0.9961901307106018,18.35122883720398,0.9961901307106018,18.34302883720398C0.9961901307106018,18.28032883720398,0.9964031617106018,18.24522883720398,0.9967184477106018,18.21032883720398L0.9967184477106018,3.1745288372039835L1.4909501307106017,3.1745288372039835L1.4909501307106017,18.21032883720398C1.4941111307106019,18.24522883720398,1.496242130710602,18.28032883720398,1.496242130710602,18.34302883720398Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"url(#master_svg4_169_14304)\\\" fill-opacity=\\\"1\\\"/></g><g transform=\\\"matrix(0.7071067690849304,-0.7071067690849304,0.7071067690849304,0.7071067690849304,-7.071067016499735,2.928932029825954)\\\" filter=\\\"url(#master_svg5_169_14339)\\\"><path d=\\\"M0.006496830000014211,10.006495876325683L14.142100000000013,9.999999046325684L14.135600000000014,24.135599046325684L1.3858798715202003e-14,24.142099046325683L0.006496830000014211,10.006495876325683Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"#FF8A2B\\\" fill-opacity=\\\"0.5068290829658508\\\"/></g><g transform=\\\"matrix(0.7071067690849304,-0.7071067690849304,0.7071067690849304,0.7071067690849304,-7.071067016499735,2.928932029825954)\\\" filter=\\\"url(#master_svg6_169_14338)\\\"><path d=\\\"M13.357700000000014,10.000359559325684L14.142100000000013,9.999999046325684L14.141800000000014,10.784394046325684L14.135600000000014,24.135599046325684L0.7843950000000142,24.141799046325684L1.4210854715202004e-14,24.142099046325683L0.0003605130000142109,23.357699046325685L0.006496830000014211,10.006495876325683L13.357700000000014,10.000359559325684ZM0.7905310000000142,10.790530046325683L0.7847560000000142,23.357399046325682L13.351600000000014,23.35159904632568L13.357400000000014,10.784755046325683L0.7905310000000142,10.790530046325683Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"url(#master_svg7_169_14291)\\\" fill-opacity=\\\"1\\\"/></g><g transform=\\\"matrix(0.7071067690849304,-0.7071067690849304,0.7071067690849304,0.7071067690849304,-6.152542907700379,4.9748735395406385)\\\" style=\\\"opacity:0.3131277859210968;\\\" filter=\\\"url(#master_svg8_169_14337)\\\"><path d=\\\"M2.933525901522827,9.918807130541992L12.928931951522827,9.914213180541992L12.924341951522827,19.909623180541992L2.928931951522827,19.914213180541992L2.933525901522827,9.918807130541992Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"#FF8A2B\\\" fill-opacity=\\\"0.5068290829658508\\\"/></g><g transform=\\\"matrix(0.7071067690849304,-0.7071067690849304,0.7071067690849304,0.7071067690849304,-6.152542907700379,4.9748735395406385)\\\" style=\\\"opacity:0.3131277859210968;\\\" filter=\\\"url(#master_svg9_169_14336)\\\"><path d=\\\"M12.144531951522827,9.914573693541993L12.928931951522827,9.914213180541992L12.928571951522827,10.698608180541992L12.924341951522827,19.908803180541994L12.924341951522827,19.909623180541992L12.923521951522828,19.909623180541992L3.713326951522827,19.91385318054199L2.928931951522827,19.914213180541992L2.929292464522827,19.129813180541994L2.933525901522827,9.918807130541992L12.144531951522827,9.914573693541993ZM3.7175609515228274,10.702842180541992L3.713687951522827,19.129453180541994L12.140301951522828,19.125583180541994L12.144171951522827,10.698969180541992L3.7175609515228274,10.702842180541992Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"url(#master_svga_169_14291)\\\" fill-opacity=\\\"1\\\"/></g><g filter=\\\"url(#master_svgb_169_14335)\\\"><path d=\\\"M11.169635151672363,7.1724288786315915L9.999975151672363,6.004092059701592L8.829125151672363,7.173628878631591L7.174185151672363,7.174478878631592L7.173345151672363,8.827548878631593L5.999566076172363,9.999998878631592L7.172145151672363,11.17125887863159L7.171295151672363,12.82843887863159L8.830345151672363,12.827588878631591L9.999975151672363,13.995908878631592L11.170815151672365,12.826388878631592L12.825845151672365,12.825548878631592L12.826685151672363,11.172388878631592L14.000395151672363,9.999998878631592L12.827885151672362,8.828818878631592L12.828735151672364,7.171588878631592L11.169635151672363,7.1724288786315915Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"#FFFFFF\\\" fill-opacity=\\\"1\\\"/></g><g filter=\\\"url(#master_svgc_169_14334)\\\"><path d=\\\"M9.999975151672363,6.004092059701592L11.169635151672363,7.1724288786315915L12.436535151672363,7.171788878631592L12.828735151672364,7.171588878631592L12.828535151672362,7.563778878631592L12.827885151672362,8.828818878631592L13.722915151672364,9.722828878631592L14.000395151672363,9.999998878631592L13.722915151672364,10.277168878631592L12.826685151672363,11.172388878631592L12.825845151672365,12.825548878631592L11.170815151672365,12.826388878631592L9.999975151672363,13.995908878631592L8.830345151672363,12.827588878631591L7.563495151672363,12.828238878631591L7.171295151672363,12.82843887863159L7.171495151672364,12.436238878631592L7.172145151672363,11.17125887863159L6.277048151672363,10.277168878631592L5.999566076172363,9.999998878631592L6.277048151672363,9.722828878631592L7.173345151672363,8.827548878631593L7.174185151672363,7.174478878631592L8.829125151672363,7.173628878631591L9.999975151672363,6.004092059701592ZM11.007395151672362,7.564708878631592L12.436335151672363,7.563978878631592L12.435605151672362,8.991318878631592L13.445435151672363,9.999998878631592L12.434575151672362,11.009718878631592L12.433845151672363,12.43354887863159L11.008415151672363,12.434278878631591L9.999975151672363,13.441578878631592L8.992585151672364,12.435308878631592L7.563695151672363,12.436038878631592L7.5644251516723635,11.008758878631593L6.554529151672363,9.999998878631592L7.565455151672364,8.990218878631591L7.5661851516723635,7.566468878631592L8.991535151672363,7.565748878631592L9.999975151672363,6.558430878631592L10.892465151672363,7.449918878631592L11.007395151672362,7.564708878631592Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"#FFAC4B\\\" fill-opacity=\\\"1\\\"/></g><g style=\\\"opacity:0.5446661114692688;\\\" filter=\\\"url(#master_svgd_169_14333)\\\"><path d=\\\"M10.617879358825684,48.627859826660156C10.617879358825684,48.63965982666016,10.613109358825684,48.68955982666016,10.606019358825684,48.739359826660156L10.606019358825684,48.861959826660154L10.603539358825683,48.861959826660154C10.572139358825684,50.05705982666016,10.337331358825683,50.985659826660154,10.052137358825684,50.985659826660154C9.778652358825683,50.985659826660154,9.532135958825684,50.05705982666016,9.500755558825684,48.861959826660154L9.498253528825684,48.861959826660154L9.498253528825684,48.739359826660156C9.497546844825683,48.68955982666016,9.497069358825684,48.63965982666016,9.497069358825684,48.627859826660156C9.497069358825684,48.538759826660154,9.497546844825683,48.48875982666016,9.498253528825684,48.439059826660156L9.498253528825684,22.527259826660156L9.999998358825684,23.287248826660157L10.606019358825684,22.527259826660156L10.606019358825684,48.439059826660156C10.613109358825684,48.48875982666016,10.617879358825684,48.538759826660154,10.617879358825684,48.627859826660156Z\\\" fill-rule=\\\"evenodd\\\" fill=\\\"url(#master_svge_169_14313)\\\" fill-opacity=\\\"1\\\"/></g></g></svg>\\n \";\n labelElement.style.width = \"20px\";\n labelElement.style.height = \"60px\";\n labelElement.style.left = '-10px';\n labelElement.style.bottom = '-60px';\n labelElement.style.position = 'absolute';\n labelElement.style.cursor = 'pointer';\n return labelElement;\n }\n }, {\n key: \"setMapIcon\",\n value: function setMapIcon(_item) {\n for (var i in this.legend) {\n if (this.legend[i].type == _item.type) {\n if (_item.visible) {\n this.iconList.forEach(function (a) {\n if (a.type == _item.type && a.circle) {\n a.circle.label.element.children[0].style.display = 'none';\n }\n if (a.type == _item.type && a.marker) {\n a.marker.getElement().style.display = 'none';\n }\n });\n //this.legend[i].obj.label.element.children[0].style.display = 'none'\n this.legend[i].visible = false;\n } else {\n this.iconList.forEach(function (a) {\n if (a.type == _item.type && a.circle) {\n a.circle.label.element.children[0].style.display = '';\n }\n if (a.type == _item.type && a.marker) {\n a.marker.getElement().style.display = '';\n }\n });\n //this.legend[i].obj.label.element.children[0].style.display = ''\n this.legend[i].visible = true;\n }\n }\n }\n if (this.updateLegend) {\n this.updateLegend(this.legend);\n }\n }\n }, {\n key: \"addToMap\",\n value: function addToMap(list) {\n var _this = this;\n var _loop = function _loop(i) {\n _this.drawPointByMarker(list[i]);\n var _legend = _this.legend.find(function (a) {\n return a.type == list[i].type;\n });\n if (!_legend) {\n _this.legend.push({\n type: list[i].type,\n name: list[i].name,\n icon: list[i].icon,\n visible: true\n });\n }\n };\n for (var i in list) {\n _loop(i);\n }\n this.iconList = list;\n if (this.updateLegend) {\n this.updateLegend(this.legend);\n }\n }\n }, {\n key: \"drawPointByMarker\",\n value: function drawPointByMarker(point) {\n var lng = point.lng;\n var lat = point.lat;\n var center = (0,_utils_util_js__WEBPACK_IMPORTED_MODULE_1__.transform)([lng, lat]);\n var el;\n el = point.icon ? point.icon : this.iconHtml.cloneNode(true);\n var marker = new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].Marker({\n element: el,\n anchor: 'center'\n }).setLngLat(center).setPopup(new _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"].Popup({\n className: 'monitorpoint-popup',\n closeButton: false,\n anchor: 'bottom',\n offset: [-10, -20]\n }).setLngLat(center).setHTML(\"<div class='monitorpoint-popup-card'>\\n <div class='monitorpoint-popup-title'>\".concat(point.title, \"</div>\\n \").concat(point.items.map(function (a) {\n return \"<div class='monitorpoint-popup-item'>\\n <div class='monitorpoint-popup-item-label'>\".concat(a.label, \"</div>:\\n \").concat(a.text, \"\\n </div>\");\n }).join(''), \"\\n </div>\"))).addTo(this.map);\n point.marker = marker;\n }\n }, {\n key: \"drawPoint\",\n value: function drawPoint(point) {\n var _this2 = this;\n var lng = point.lng;\n var lat = point.lat;\n var center = (0,_utils_util_js__WEBPACK_IMPORTED_MODULE_1__.transform)([lng, lat]);\n var geometry = new three__WEBPACK_IMPORTED_MODULE_3__.CircleGeometry(0);\n var circle = new three__WEBPACK_IMPORTED_MODULE_3__.Mesh(geometry, new three__WEBPACK_IMPORTED_MODULE_3__.MeshPhongMaterial({\n color: 0x660000\n }));\n circle = this.tb.Object3D({\n obj: circle,\n units: 'meters',\n anchor: 'center'\n });\n circle.addLabel = function (HTMLElement, visible, center, height, ev) {\n if (HTMLElement) {\n var label = circle.drawLabelHTML(HTMLElement, visible, center, height);\n //console.log(label)\n if (!_this2.visible) {\n label.element.children[0].style.display = 'none';\n }\n label.element.onclick = ev;\n }\n };\n circle.setCoords(center);\n this.tb.add(circle);\n point.circle = circle;\n if (point.icon) {\n circle.addLabel(point.icon, true, circle.anchor, 0, function () {\n setTimeout(function () {\n _this2.popup.setLngLat(center).setHTML(\"<div class='monitorpoint-popup-card'>\\n <div class='monitorpoint-popup-title'>\".concat(point.title, \"</div>\\n \").concat(point.items.map(function (a) {\n return \"<div class='monitorpoint-popup-item'>\\n <div class='monitorpoint-popup-item-label'>\".concat(a.label, \"</div>:\\n \").concat(a.text, \"\\n </div>\");\n }).join(''), \"\\n </div>\")).addTo(_this2.map);\n }, 300);\n });\n } else {\n var el = this.iconHtml.cloneNode(true);\n circle.addLabel(el, true, circle.anchor, 0, function () {\n setTimeout(function () {\n _this2.popup.setLngLat(center).setHTML(\"<div class='monitorpoint-popup-card'>\\n <div class='monitorpoint-popup-title'>\".concat(point.title, \"</div>\\n \").concat(point.items.map(function (a) {\n return \"<div class='monitorpoint-popup-item'>\\n <div class='monitorpoint-popup-item-label'>\".concat(a.label, \"</div>:\\n \").concat(a.text, \"\\n </div>\");\n }).join(''), \"\\n </div>\")).addTo(_this2.map);\n }, 300);\n });\n }\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n this.tb.update();\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/CustomIconLayer.js?");
5204
5204
 
5205
5205
  /***/ }),
5206
5206
 
@@ -5211,7 +5211,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
5211
5211
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5212
5212
 
5213
5213
  "use strict";
5214
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ExtrusionLayer)\n/* harmony export */ });\n/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/util */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var three_examples_jsm_postprocessing_OutlinePass__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! three/examples/jsm/postprocessing/OutlinePass */ \"./node_modules/three/examples/jsm/postprocessing/OutlinePass.js\");\n/* harmony import */ var _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../lib/threebox-plugin */ \"./lib/threebox-plugin/main.js\");\n/* harmony import */ var _utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/mapUtil */ \"./src/utils/mapUtil.js\");\n/* harmony import */ var _utils_CameraSync__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/CameraSync */ \"./src/utils/CameraSync.js\");\n/* harmony import */ var three_addons_lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! three/addons/lines/LineGeometry.js */ \"./node_modules/three/examples/jsm/lines/LineGeometry.js\");\n/* harmony import */ var _utils_Materials_line_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/Materials/line.js */ \"./src/utils/Materials/line.js\");\n/* harmony import */ var _utils_Materials_shadow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/Materials/shadow.js */ \"./src/utils/Materials/shadow.js\");\n/* harmony import */ var three_addons_lines_Line2_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! three/addons/lines/Line2.js */ \"./node_modules/three/examples/jsm/lines/Line2.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar BLOOM_SCENE = 1;\nvar params = {\n threshold: 0,\n strength: 1.2,\n radius: 2.5,\n exposure: 0\n};\nvar tb = {};\nvar scene;\nvar sceneTarget;\nvar cameraMap;\nvar target;\nvar cameraTarget;\nvar materialTarget;\nvar cameraTransform;\nvar camera;\nvar outlineComposer;\nvar bloomComposer;\nvar renderScene;\nvar bloomPass;\nvar composer;\nvar outlinePass;\nvar composer2;\nvar group = new three__WEBPACK_IMPORTED_MODULE_7__.Group();\nvar group2 = new three__WEBPACK_IMPORTED_MODULE_7__.Group();\nvar group3 = new three__WEBPACK_IMPORTED_MODULE_7__.Group();\nvar sceneMap;\nvar darkMaterial = new three__WEBPACK_IMPORTED_MODULE_7__.MeshBasicMaterial({\n color: 'black',\n transparent: true,\n opacity: 1\n});\nvar bloomLayer = new three__WEBPACK_IMPORTED_MODULE_7__.Layers();\nvar ExtrusionLayer = /*#__PURE__*/function () {\n function ExtrusionLayer(id, config) {\n _classCallCheck(this, ExtrusionLayer);\n _defineProperty(this, \"opacity\", 0.8);\n _defineProperty(this, \"previewCanvas\", null);\n _defineProperty(this, \"w\", 0);\n _defineProperty(this, \"h\", 0);\n this.id = id;\n this.type = 'custom';\n this.renderingMode = '2d';\n this.previewCanvas = config === null || config === void 0 ? void 0 : config.previewCanvas;\n if (config !== null && config !== void 0 && config.previewCanvas) {\n this.previewCanvas.width = this.previewCanvas.clientWidth;\n this.previewCanvas.height = this.previewCanvas.clientHeight;\n this.ctxpre = this.previewCanvas.getContext('2d');\n }\n }\n return _createClass(ExtrusionLayer, [{\n key: \"addStart\",\n value: function addStart() {\n var points = [],\n numPts = 5;\n for (var i = 0; i < numPts * 2; i++) {\n var l = i % 2 == 1 ? 10 : 20;\n var a = i / numPts * Math.PI;\n points.push([Math.cos(a) * l, Math.sin(a) * l]);\n }\n var material1 = new three__WEBPACK_IMPORTED_MODULE_7__.MeshLambertMaterial({\n color: 0xb00000,\n wireframe: false\n });\n var material2 = new three__WEBPACK_IMPORTED_MODULE_7__.MeshLambertMaterial({\n color: 0xff8000,\n wireframe: false\n });\n var star = tb.extrusion({\n coordinates: [points],\n geometryOptions: {\n depth: 20,\n steps: 1,\n bevelEnabled: true,\n bevelThickness: 2,\n bevelSize: 4,\n bevelSegments: 1\n },\n anchor: 'center',\n units: 'meters',\n rotation: {\n x: 90,\n y: 0,\n z: 20\n },\n materials: [material1, material2]\n }, this.map);\n star.addTooltip(\"A animated extruded star over Columbus Park\", true);\n star.setCoords([-74.0001269, 40.7151698, 50]);\n star.set({\n rotation: {\n x: 0,\n y: 0,\n z: 720\n },\n duration: 20000\n });\n tb.add(star);\n }\n }, {\n key: \"addExtrusionsThreeBox\",\n value: function addExtrusionsThreeBox(coordinates, center) {\n var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;\n var material = new three__WEBPACK_IMPORTED_MODULE_7__.MeshPhongMaterial({\n color: 0x4065c9,\n opacity: 0.5,\n side: three__WEBPACK_IMPORTED_MODULE_7__.FrontSide,\n transparent: true\n });\n // let coords = []\n // data.forEach((b) => {\n // // let center = b.properties.center;\n // // let s = tb.projectedUnitsPerMeter(center[1]);\n // coords.push(b.geometry.coordinates)\n\n // });\n var extrusion = tb.extrusion({\n coordinates: coordinates,\n anchor: 'center',\n geometryOptions: {\n curveSegments: 1,\n depth: height\n },\n materials: material\n }, this.map);\n // extrusion.addTooltip(b.properties.tooltip, true);\n extrusion.setCoords([].concat(_toConsumableArray((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(center)), [0]));\n tb.add(extrusion);\n this.outlineObj(extrusion);\n }\n }, {\n key: \"addExtrusions\",\n value: function addExtrusions(coordinates) {\n var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;\n var opacity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.6;\n var color = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0x3d5dc1;\n var material = new three__WEBPACK_IMPORTED_MODULE_7__.MeshLambertMaterial({\n color: color,\n opacity: opacity,\n side: three__WEBPACK_IMPORTED_MODULE_7__.FrontSide,\n transparent: true\n });\n coordinates.forEach(function (coords) {\n var shape = new three__WEBPACK_IMPORTED_MODULE_7__.Shape();\n if (coords.length <= 2) {\n return;\n }\n coords.forEach(function (point, i) {\n var position = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.projectToWorld)(point);\n if (i == 0) {\n shape.moveTo(position.x, position.y, position.z);\n } else {\n shape.lineTo(position.x, position.y, position.z);\n }\n });\n // const length = 12, width = 8;\n\n // shape.moveTo( 0,0 );\n // shape.lineTo( 0, width );\n // shape.lineTo( length, width );\n // shape.lineTo( length, 0 );\n // shape.lineTo( 0, 0 );\n var geometry = new three__WEBPACK_IMPORTED_MODULE_7__.ExtrudeGeometry(shape, {\n curveSegments: 1,\n depth: height\n });\n var mesh = new three__WEBPACK_IMPORTED_MODULE_7__.Mesh(geometry, material);\n mesh.layers.enable(BLOOM_SCENE);\n group.add(mesh);\n // /group2.add() \n });\n }\n }, {\n key: \"outlineObj\",\n value: function outlineObj(selectedObjects) {\n if (outlinePass) {\n outlineComposer.removePass(outlinePass);\n outlinePass = null;\n }\n // 物体边缘发光通道\n outlinePass = new three_examples_jsm_postprocessing_OutlinePass__WEBPACK_IMPORTED_MODULE_8__.OutlinePass(new three__WEBPACK_IMPORTED_MODULE_7__.Vector2(window.innerWidth, window.innerHeight), scene, camera);\n outlinePass.edgeStrength = 5; // 边框的亮度\n outlinePass.edgeGlow = 0.1; // 光晕[0,1]\n outlinePass.edgeThickness = 0.1; // 边框宽度\n outlinePass.pulsePeriod = 2; // 呼吸闪烁的速度\n outlinePass.visibleEdgeColor.set(0xff4ecfff);\n outlinePass.hiddenEdgeColor.set(0x00ffff);\n outlinePass.selectedObjects = selectedObjects;\n outlineComposer.addPass(outlinePass);\n // 自定义的着色器通道 作为参数\n }\n }, {\n key: \"addLineThreeBox\",\n value: function addLineThreeBox(coordinates, center) {\n var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;\n coordinates.forEach(function (coords) {\n var line = tb.line({\n geometry: coords,\n color: 0xe6f2ff,\n width: 2\n });\n //line.setCoords([...transform(center), 0]);\n tb.add(line);\n });\n }\n }, {\n key: \"createLine\",\n value: function createLine(coords) {\n var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var opacity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.5;\n var width = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;\n var color = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0xb6d1fc;\n var straightProject = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.lnglatsToWorld)(coords);\n straightProject.forEach(function (a) {\n return a.z = height;\n });\n var normalized = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.normalizeVertices)(straightProject);\n var flattenedArray = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.flattenVectors)(normalized.vertices);\n var geometry = new three_addons_lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_9__.LineGeometry();\n geometry.setPositions(flattenedArray);\n // Material\n var matLine = new _utils_Materials_line_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]({\n color: 0xb6d1fc,\n linewidth: width,\n dashed: false,\n opacity: opacity,\n transparent: true\n });\n matLine.resolution.set(window.innerWidth, window.innerHeight);\n matLine.isMaterial = true;\n matLine.transparent = true;\n matLine.depthWrite = false;\n\n // Mesh\n var line = new three_addons_lines_Line2_js__WEBPACK_IMPORTED_MODULE_10__.Line2(geometry, matLine);\n line.position.copy(normalized.position);\n line.computeLineDistances();\n //this.createShadow(normalized,100)\n return line;\n }\n }, {\n key: \"createShadow\",\n value: function createShadow(normalized, radius) {\n var color = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0xb6d1f0;\n // var straightProject = lnglatsToWorld(coords); \n // straightProject.forEach(a=>a.z = height) \n // var normalized = normalizeVertices(straightProject);\n var flattenedArray = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.flattenVectors)(normalized.vertices);\n var geometry = new three_addons_lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_9__.LineGeometry();\n geometry.setPositions(flattenedArray);\n // Material\n var matLine = new _utils_Materials_shadow_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]({\n color: color,\n linewidth: radius,\n dashed: false,\n opacity: 1,\n transparent: true\n });\n matLine.resolution.set(window.innerWidth, window.innerHeight);\n matLine.isMaterial = true;\n matLine.transparent = true;\n matLine.depthWrite = false;\n\n // Mesh\n var line = new three_addons_lines_Line2_js__WEBPACK_IMPORTED_MODULE_10__.Line2(geometry, matLine);\n line.position.copy(normalized.position);\n line.computeLineDistances();\n group.add(line);\n }\n }, {\n key: \"addLine\",\n value: function addLine(coordinates) {\n var _this = this;\n var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;\n var opacity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.5;\n var width = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;\n var color = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0xb6d1fc;\n var lines = [];\n coordinates.forEach(function (coords) {\n // let positions = []\n if (coords.length <= 2) {\n return;\n }\n // const geometry = new LineGeometry();\n\n // coords.forEach((point,i)=>{\n // let position= projectToWorld(point)\n // positions.push( position.x,position.y,height);\n // })\n // geometry.setPositions( positions );\n // let matLine = new LineMaterial( {\n // color: 0xffffff,\n // linewidth: 2, // in world units with size attenuation, pixels otherwise \n // } );\n // let line = new Line2( geometry, matLine );\n var line = _this.createLine(coords, height, opacity, width, color);\n line.layers.enable(BLOOM_SCENE);\n group.add(line);\n lines.push(line);\n });\n //this.outlineObj([group])\n }\n\n // init(config){\n // config.height = config.height && config.height>0 ? config.height:100\n // //config.height = 0\n // this.addLine(config.coords,config.height)\n\n // //this.addStart()\n // this.addExtrusions(config.coords,config.height)\n\n // //this.addLine(config.coords,config.center,config.height)\n // }\n }, {\n key: \"setTargetTexture\",\n value: function setTargetTexture(w, h) {\n // let composePlaneGeometry = new THREE.BufferGeometry();\n // composePlaneGeometry.setAttribute( 'position', new THREE.Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n // composePlaneGeometry.setAttribute( 'uv', new THREE.Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n var composePlaneGeometry = new three__WEBPACK_IMPORTED_MODULE_7__.PlaneGeometry(w * 10000, h * 10000);\n //debugger\n // materialTarget = new THREE.ShaderMaterial( {\n // \tuniforms: {\n // 'tDiffuse': { value: null },\n // 'opacity': { value: 1 } \n // },\n // \tvertexShader: `\n // varying vec2 vUv; \n // void main() { \n // vUv = uv;\n // gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n // }`,\n // \tfragmentShader: `\n // uniform float opacity;\n // uniform sampler2D tDiffuse;\n // varying vec2 vUv;\n // void main() {\n\n // vec4 texel = texture2D( tDiffuse, vUv );\n // gl_FragColor = opacity * texel;\n\n // }`,\t\t\t\n // \tdepthTest: false,\n // \tdepthWrite: false\n // } );\n materialTarget = new three__WEBPACK_IMPORTED_MODULE_7__.MeshPhongMaterial({\n map: target.texture,\n opacity: 1,\n transparent: true\n });\n var mesh = new three__WEBPACK_IMPORTED_MODULE_7__.Mesh(composePlaneGeometry, materialTarget);\n mesh = tb.Object3D({\n obj: mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n mesh.setCoords([0, 0]);\n tb.add(mesh);\n group2.add(mesh);\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n tb = new _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true,\n passiveRendering: false\n });\n var container = map.getCanvas();\n var w = container.clientWidth;\n var h = container.clientHeight;\n this.w = w;\n this.h = h;\n scene = new three__WEBPACK_IMPORTED_MODULE_7__.Scene();\n //sceneTarget.background = new THREE.Color('rgba(0,0,0,0)')\n camera = new three__WEBPACK_IMPORTED_MODULE_7__.PerspectiveCamera(map.transform.fov, w / h, 0.1, 1e21);\n scene.add(group);\n scene.add(new three__WEBPACK_IMPORTED_MODULE_7__.AmbientLight(0xffffff));\n //scene.add(group2)\n\n new _utils_CameraSync__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this.map, camera, group);\n\n //new CameraSync(this.map, camera, group2); \n this.renderer = new three__WEBPACK_IMPORTED_MODULE_7__.WebGLRenderer({\n canvas: map.getCanvas(),\n context: gl,\n antialias: true,\n alpha: true\n });\n this.renderer.outputEncoding = three__WEBPACK_IMPORTED_MODULE_7__.sRGBEncoding;\n this.renderer.autoClear = false;\n scene.add(new three__WEBPACK_IMPORTED_MODULE_7__.AxesHelper(0));\n //scene.background =null;\n //scene.background = new THREE.Color(0x000000);\n //this.renderer.setClearAlpha(0.0); \n // target = new THREE.WebGLRenderTarget(w,h,{encoding: THREE.sRGBEncoding });\n // this.setTargetTexture(w,h)\n //renderScene = new RenderPass(scene, camera);\n //composer2 = new EffectComposer(this.renderer);\n //bloomPass = new UnrealBloomPass(new THREE.Vector2(w/2, h/2), params.strength, params.radius, params.threshold);\n //composer2.addPass(renderScene);\n //composer2.addPass(bloomPass);\n //composer2.renderToScreen = true;\n\n // bloomPass = new UnrealBloomPass(new THREE.Vector2(w/2, h/2), params.strength, params.radius, params.threshold);\n // bloomComposer = new EffectComposer(this.renderer);\n // bloomComposer.renderToScreen = true;\n // bloomComposer.addPass(renderScene);\n // bloomComposer.addPass(bloomPass);\n //outlineComposer = new EffectComposer(this.renderer)\n // bloomLayer.set(BLOOM_SCENE);\n\n // const bloomPass = new OutlinePass(\n // new THREE.Vector2(window.innerWidth, window.innerHeight),\n // scene,\n // camera\n // )\n // bloomPass.edgeStrength = 5 // 边框的亮度\n // bloomPass.edgeGlow = 1 // 光晕[0,1]\n // bloomPass.edgeThickness = 5 // 边框宽度\n // bloomPass.pulsePeriod = 3 // 呼吸闪烁的速度\n // bloomPass.visibleEdgeColor.set(0xff4ecfff)\n // bloomPass.hiddenEdgeColor.set(0x00ffff)\n //bloomPass.selectedObjects = [group]\n\n // const mixPass = new ShaderPass(\n // new THREE.ShaderMaterial({\n // uniforms: {\n // baseTexture: { value: null },\n // bloomTexture: { value: bloomComposer.renderTarget2.texture },\n // },\n // // @ts-ignore\n // vertexShader: document.getElementById('vertexshader').textContent,\n // // @ts-ignore\n // fragmentShader: document.getElementById('fragmentshader').textContent,\n // defines: {},\n // }),\n // 'baseTexture',\n // );\n // mixPass.needsSwap = true;\n\n // const outputPass = new OutputPass();\n\n // composer = new EffectComposer(this.renderer);\n // composer.addPass(renderScene);\n // composer.addPass(mixPass);\n // composer.addPass(outputPass);\n\n //let renderPass = new RenderPass(scene, camera) \n //outlineComposer.addPass(renderPass)\n }\n }, {\n key: \"updatePreview\",\n value: function updatePreview(ImageData) {\n this.ctxpre.clearRect(0, 0, this.previewCanvas.width, this.previewCanvas.height);\n this.ctxpre.putImageData(ImageData, 0, 0);\n }\n }, {\n key: \"flipY\",\n value: function flipY(buffer, width, height) {\n // 每一轮循环 第i行和第j行交换\n for (var i = 0, j = height - 1; i < j; ++i, --j) {\n // 交换两行的数据\n for (var k = 0; k < 4 * width; ++k) {\n var t = buffer[i * width * 4 + k];\n buffer[i * width * 4 + k] = buffer[j * width * 4 + k];\n buffer[j * width * 4 + k] = t;\n }\n }\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n //composer.render()\n // scene.traverse(this.darkenNonBloomed);\n // bloomComposer.render();\n //outlineComposer.render()\n //composer2.render();\n this.renderer.resetState();\n this.renderer.render(scene, camera);\n this.map.triggerRepaint();\n }\n }, {\n key: \"darkenNonBloomed\",\n value: function darkenNonBloomed(obj) {\n // if (obj instanceof THREE.Scene) { \n // obj.background = new THREE.Color(0x000fff)\n // debugger\n // } \n // if (obj.isMesh) {\n\n // //materials[obj.uuid] = obj.material;\n // obj.background = null\n // //obj.material = darkMaterial;\n // }\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/ExtrusionLayer.js?");
5214
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ExtrusionLayer)\n/* harmony export */ });\n/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/util */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var three_examples_jsm_postprocessing_OutlinePass__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! three/examples/jsm/postprocessing/OutlinePass */ \"./node_modules/three/examples/jsm/postprocessing/OutlinePass.js\");\n/* harmony import */ var _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../lib/threebox-plugin */ \"./lib/threebox-plugin/main.js\");\n/* harmony import */ var _utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/mapUtil */ \"./src/utils/mapUtil.js\");\n/* harmony import */ var _utils_CameraSync__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/CameraSync */ \"./src/utils/CameraSync.js\");\n/* harmony import */ var three_addons_lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! three/addons/lines/LineGeometry.js */ \"./node_modules/three/examples/jsm/lines/LineGeometry.js\");\n/* harmony import */ var _utils_Materials_line_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/Materials/line.js */ \"./src/utils/Materials/line.js\");\n/* harmony import */ var _utils_Materials_shadow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/Materials/shadow.js */ \"./src/utils/Materials/shadow.js\");\n/* harmony import */ var three_addons_lines_Line2_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! three/addons/lines/Line2.js */ \"./node_modules/three/examples/jsm/lines/Line2.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar BLOOM_SCENE = 1;\nvar params = {\n threshold: 0,\n strength: 1.2,\n radius: 2.5,\n exposure: 0\n};\nvar sceneTarget;\nvar cameraMap;\nvar cameraTarget;\nvar cameraTransform;\n\n// let this.outlineComposer;\nvar bloomComposer;\nvar renderScene;\nvar bloomPass;\nvar composer;\n// let this.outlinePass;\nvar composer2;\n// var this.group = new THREE.Group();\n// let this.group2 = new THREE.Group();\n// let this.group3 = new THREE.Group();\nvar sceneMap;\nvar darkMaterial = new three__WEBPACK_IMPORTED_MODULE_7__.MeshBasicMaterial({\n color: 'black',\n transparent: true,\n opacity: 1\n});\nvar bloomLayer = new three__WEBPACK_IMPORTED_MODULE_7__.Layers();\nvar ExtrusionLayer = /*#__PURE__*/function () {\n function ExtrusionLayer(id, config) {\n _classCallCheck(this, ExtrusionLayer);\n _defineProperty(this, \"tb\", {});\n _defineProperty(this, \"scene\", void 0);\n _defineProperty(this, \"camera\", void 0);\n _defineProperty(this, \"outlineComposer\", void 0);\n _defineProperty(this, \"outlinePass\", void 0);\n _defineProperty(this, \"group\", new three__WEBPACK_IMPORTED_MODULE_7__.Group());\n _defineProperty(this, \"group2\", new three__WEBPACK_IMPORTED_MODULE_7__.Group());\n _defineProperty(this, \"group3\", new three__WEBPACK_IMPORTED_MODULE_7__.Group());\n _defineProperty(this, \"materialTarget\", void 0);\n _defineProperty(this, \"target\", void 0);\n _defineProperty(this, \"opacity\", 0.8);\n _defineProperty(this, \"previewCanvas\", null);\n _defineProperty(this, \"w\", 0);\n _defineProperty(this, \"h\", 0);\n this.id = id;\n this.type = 'custom';\n this.renderingMode = '2d';\n this.previewCanvas = config === null || config === void 0 ? void 0 : config.previewCanvas;\n if (config !== null && config !== void 0 && config.previewCanvas) {\n this.previewCanvas.width = this.previewCanvas.clientWidth;\n this.previewCanvas.height = this.previewCanvas.clientHeight;\n this.ctxpre = this.previewCanvas.getContext('2d');\n }\n }\n return _createClass(ExtrusionLayer, [{\n key: \"addStart\",\n value: function addStart() {\n var points = [],\n numPts = 5;\n for (var i = 0; i < numPts * 2; i++) {\n var l = i % 2 == 1 ? 10 : 20;\n var a = i / numPts * Math.PI;\n points.push([Math.cos(a) * l, Math.sin(a) * l]);\n }\n var material1 = new three__WEBPACK_IMPORTED_MODULE_7__.MeshLambertMaterial({\n color: 0xb00000,\n wireframe: false\n });\n var material2 = new three__WEBPACK_IMPORTED_MODULE_7__.MeshLambertMaterial({\n color: 0xff8000,\n wireframe: false\n });\n var star = this.tb.extrusion({\n coordinates: [points],\n geometryOptions: {\n depth: 20,\n steps: 1,\n bevelEnabled: true,\n bevelThickness: 2,\n bevelSize: 4,\n bevelSegments: 1\n },\n anchor: 'center',\n units: 'meters',\n rotation: {\n x: 90,\n y: 0,\n z: 20\n },\n materials: [material1, material2]\n }, this.map);\n star.addTooltip(\"A animated extruded star over Columbus Park\", true);\n star.setCoords([-74.0001269, 40.7151698, 50]);\n star.set({\n rotation: {\n x: 0,\n y: 0,\n z: 720\n },\n duration: 20000\n });\n this.tb.add(star);\n }\n }, {\n key: \"addExtrusionsThreeBox\",\n value: function addExtrusionsThreeBox(coordinates, center) {\n var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;\n var material = new three__WEBPACK_IMPORTED_MODULE_7__.MeshPhongMaterial({\n color: 0x4065c9,\n opacity: 0.5,\n side: three__WEBPACK_IMPORTED_MODULE_7__.FrontSide,\n transparent: true\n });\n // let coords = []\n // data.forEach((b) => {\n // // let center = b.properties.center;\n // // let s = this.tb.projectedUnitsPerMeter(center[1]);\n // coords.push(b.geometry.coordinates)\n\n // });\n var extrusion = this.tb.extrusion({\n coordinates: coordinates,\n anchor: 'center',\n geometryOptions: {\n curveSegments: 1,\n depth: height\n },\n materials: material\n }, this.map);\n // extrusion.addTooltip(b.properties.tooltip, true);\n extrusion.setCoords([].concat(_toConsumableArray((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(center)), [0]));\n this.tb.add(extrusion);\n this.outlineObj(extrusion);\n }\n }, {\n key: \"addExtrusions\",\n value: function addExtrusions(coordinates) {\n var _this = this;\n var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;\n var opacity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.6;\n var color = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0x3d5dc1;\n var material = new three__WEBPACK_IMPORTED_MODULE_7__.MeshLambertMaterial({\n color: color,\n opacity: opacity,\n side: three__WEBPACK_IMPORTED_MODULE_7__.FrontSide,\n transparent: true\n });\n coordinates.forEach(function (coords) {\n var shape = new three__WEBPACK_IMPORTED_MODULE_7__.Shape();\n if (coords.length <= 2) {\n return;\n }\n coords.forEach(function (point, i) {\n var position = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.projectToWorld)(point);\n if (i == 0) {\n shape.moveTo(position.x, position.y, position.z);\n } else {\n shape.lineTo(position.x, position.y, position.z);\n }\n });\n // const length = 12, width = 8;\n\n // shape.moveTo( 0,0 );\n // shape.lineTo( 0, width );\n // shape.lineTo( length, width );\n // shape.lineTo( length, 0 );\n // shape.lineTo( 0, 0 );\n var geometry = new three__WEBPACK_IMPORTED_MODULE_7__.ExtrudeGeometry(shape, {\n curveSegments: 1,\n depth: height\n });\n var mesh = new three__WEBPACK_IMPORTED_MODULE_7__.Mesh(geometry, material);\n mesh.layers.enable(BLOOM_SCENE);\n _this.group.add(mesh);\n // /this.group2.add() \n });\n }\n }, {\n key: \"outlineObj\",\n value: function outlineObj(selectedObjects) {\n if (this.outlinePass) {\n this.outlineComposer.removePass(this.outlinePass);\n this.outlinePass = null;\n }\n // 物体边缘发光通道\n this.outlinePass = new three_examples_jsm_postprocessing_OutlinePass__WEBPACK_IMPORTED_MODULE_8__.OutlinePass(new three__WEBPACK_IMPORTED_MODULE_7__.Vector2(window.innerWidth, window.innerHeight), this.scene, this.camera);\n this.outlinePass.edgeStrength = 5; // 边框的亮度\n this.outlinePass.edgeGlow = 0.1; // 光晕[0,1]\n this.outlinePass.edgeThickness = 0.1; // 边框宽度\n this.outlinePass.pulsePeriod = 2; // 呼吸闪烁的速度\n this.outlinePass.visibleEdgeColor.set(0xff4ecfff);\n this.outlinePass.hiddenEdgeColor.set(0x00ffff);\n this.outlinePass.selectedObjects = selectedObjects;\n this.outlineComposer.addPass(this.outlinePass);\n // 自定义的着色器通道 作为参数\n }\n }, {\n key: \"addLineThreeBox\",\n value: function addLineThreeBox(coordinates, center) {\n var _this2 = this;\n var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;\n coordinates.forEach(function (coords) {\n var line = _this2.tb.line({\n geometry: coords,\n color: 0xe6f2ff,\n width: 2\n });\n //line.setCoords([...transform(center), 0]);\n _this2.tb.add(line);\n });\n }\n }, {\n key: \"createLine\",\n value: function createLine(coords) {\n var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var opacity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.5;\n var width = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;\n var color = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0xb6d1fc;\n var straightProject = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.lnglatsToWorld)(coords);\n straightProject.forEach(function (a) {\n return a.z = height;\n });\n var normalized = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.normalizeVertices)(straightProject);\n var flattenedArray = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.flattenVectors)(normalized.vertices);\n var geometry = new three_addons_lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_9__.LineGeometry();\n geometry.setPositions(flattenedArray);\n // Material\n var matLine = new _utils_Materials_line_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]({\n color: 0xb6d1fc,\n linewidth: width,\n dashed: false,\n opacity: opacity,\n transparent: true\n });\n matLine.resolution.set(window.innerWidth, window.innerHeight);\n matLine.isMaterial = true;\n matLine.transparent = true;\n matLine.depthWrite = false;\n\n // Mesh\n var line = new three_addons_lines_Line2_js__WEBPACK_IMPORTED_MODULE_10__.Line2(geometry, matLine);\n line.position.copy(normalized.position);\n line.computeLineDistances();\n //this.createShadow(normalized,100)\n return line;\n }\n }, {\n key: \"createShadow\",\n value: function createShadow(normalized, radius) {\n var color = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0xb6d1f0;\n // var straightProject = lnglatsToWorld(coords); \n // straightProject.forEach(a=>a.z = height) \n // var normalized = normalizeVertices(straightProject);\n var flattenedArray = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.flattenVectors)(normalized.vertices);\n var geometry = new three_addons_lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_9__.LineGeometry();\n geometry.setPositions(flattenedArray);\n // Material\n var matLine = new _utils_Materials_shadow_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]({\n color: color,\n linewidth: radius,\n dashed: false,\n opacity: 1,\n transparent: true\n });\n matLine.resolution.set(window.innerWidth, window.innerHeight);\n matLine.isMaterial = true;\n matLine.transparent = true;\n matLine.depthWrite = false;\n\n // Mesh\n var line = new three_addons_lines_Line2_js__WEBPACK_IMPORTED_MODULE_10__.Line2(geometry, matLine);\n line.position.copy(normalized.position);\n line.computeLineDistances();\n this.group.add(line);\n }\n }, {\n key: \"addLine\",\n value: function addLine(coordinates) {\n var _this3 = this;\n var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;\n var opacity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.5;\n var width = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;\n var color = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0xb6d1fc;\n var lines = [];\n coordinates.forEach(function (coords) {\n // let positions = []\n if (coords.length <= 2) {\n return;\n }\n // const geometry = new LineGeometry();\n\n // coords.forEach((point,i)=>{\n // let position= projectToWorld(point)\n // positions.push( position.x,position.y,height);\n // })\n // geometry.setPositions( positions );\n // let matLine = new LineMaterial( {\n // color: 0xffffff,\n // linewidth: 2, // in world units with size attenuation, pixels otherwise \n // } );\n // let line = new Line2( geometry, matLine );\n var line = _this3.createLine(coords, height, opacity, width, color);\n line.layers.enable(BLOOM_SCENE);\n _this3.group.add(line);\n lines.push(line);\n });\n //this.outlineObj([this.group])\n }\n\n // init(config){\n // config.height = config.height && config.height>0 ? config.height:100\n // //config.height = 0\n // this.addLine(config.coords,config.height)\n\n // //this.addStart()\n // this.addExtrusions(config.coords,config.height)\n\n // //this.addLine(config.coords,config.center,config.height)\n // }\n }, {\n key: \"setTargetTexture\",\n value: function setTargetTexture(w, h) {\n // let composePlaneGeometry = new THREE.BufferGeometry();\n // composePlaneGeometry.setAttribute( 'position', new THREE.Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n // composePlaneGeometry.setAttribute( 'uv', new THREE.Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n var composePlaneGeometry = new three__WEBPACK_IMPORTED_MODULE_7__.PlaneGeometry(w * 10000, h * 10000);\n //debugger\n // this.materialTarget = new THREE.ShaderMaterial( {\n // \tuniforms: {\n // 'tDiffuse': { value: null },\n // 'opacity': { value: 1 } \n // },\n // \tvertexShader: `\n // varying vec2 vUv; \n // void main() { \n // vUv = uv;\n // gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n // }`,\n // \tfragmentShader: `\n // uniform float opacity;\n // uniform sampler2D tDiffuse;\n // varying vec2 vUv;\n // void main() {\n\n // vec4 texel = texture2D( tDiffuse, vUv );\n // gl_FragColor = opacity * texel;\n\n // }`,\t\t\t\n // \tdepthTest: false,\n // \tdepthWrite: false\n // } );\n this.materialTarget = new three__WEBPACK_IMPORTED_MODULE_7__.MeshPhongMaterial({\n map: this.target.texture,\n opacity: 1,\n transparent: true\n });\n var mesh = new three__WEBPACK_IMPORTED_MODULE_7__.Mesh(composePlaneGeometry, this.materialTarget);\n mesh = this.tb.Object3D({\n obj: mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n mesh.setCoords([0, 0]);\n this.tb.add(mesh);\n this.group2.add(mesh);\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n this.tb = new _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true,\n passiveRendering: false\n });\n var container = map.getCanvas();\n var w = container.clientWidth;\n var h = container.clientHeight;\n this.w = w;\n this.h = h;\n this.scene = new three__WEBPACK_IMPORTED_MODULE_7__[\"this\"].scene();\n //sceneTarget.background = new THREE.Color('rgba(0,0,0,0)')\n this.camera = new three__WEBPACK_IMPORTED_MODULE_7__.PerspectiveCamera(map.transform.fov, w / h, 0.1, 1e21);\n this.scene.add(this.group);\n this.scene.add(new three__WEBPACK_IMPORTED_MODULE_7__.AmbientLight(0xffffff));\n //this.scene.add(this.group2)\n\n new _utils_CameraSync__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this.map, this.camera, this.group);\n\n //new CameraSync(this.map, this.camera, this.group2); \n this.renderer = new three__WEBPACK_IMPORTED_MODULE_7__.WebGLRenderer({\n canvas: map.getCanvas(),\n context: gl,\n antialias: true,\n alpha: true\n });\n this.renderer.outputEncoding = three__WEBPACK_IMPORTED_MODULE_7__.sRGBEncoding;\n this.renderer.autoClear = false;\n this.scene.add(new three__WEBPACK_IMPORTED_MODULE_7__.AxesHelper(0));\n //this.scene.background =null;\n //this.scene.background = new THREE.Color(0x000000);\n //this.renderer.setClearAlpha(0.0); \n // this.target = new THREE.WebGLRenderTarget(w,h,{encoding: THREE.sRGBEncoding });\n // this.setTargetTexture(w,h)\n //renderScene = new RenderPass(this.scene, this.camera);\n //composer2 = new EffectComposer(this.renderer);\n //bloomPass = new UnrealBloomPass(new THREE.Vector2(w/2, h/2), params.strength, params.radius, params.threshold);\n //composer2.addPass(renderScene);\n //composer2.addPass(bloomPass);\n //composer2.renderToScreen = true;\n\n // bloomPass = new UnrealBloomPass(new THREE.Vector2(w/2, h/2), params.strength, params.radius, params.threshold);\n // bloomComposer = new EffectComposer(this.renderer);\n // bloomComposer.renderToScreen = true;\n // bloomComposer.addPass(renderScene);\n // bloomComposer.addPass(bloomPass);\n //this.outlineComposer = new EffectComposer(this.renderer)\n // bloomLayer.set(BLOOM_SCENE);\n\n // const bloomPass = new OutlinePass(\n // new THREE.Vector2(window.innerWidth, window.innerHeight),\n // this.scene,\n // this.camera\n // )\n // bloomPass.edgeStrength = 5 // 边框的亮度\n // bloomPass.edgeGlow = 1 // 光晕[0,1]\n // bloomPass.edgeThickness = 5 // 边框宽度\n // bloomPass.pulsePeriod = 3 // 呼吸闪烁的速度\n // bloomPass.visibleEdgeColor.set(0xff4ecfff)\n // bloomPass.hiddenEdgeColor.set(0x00ffff)\n //bloomPass.selectedObjects = [this.group]\n\n // const mixPass = new ShaderPass(\n // new THREE.ShaderMaterial({\n // uniforms: {\n // baseTexture: { value: null },\n // bloomTexture: { value: bloomComposer.renderTarget2.texture },\n // },\n // // @ts-ignore\n // vertexShader: document.getElementById('vertexshader').textContent,\n // // @ts-ignore\n // fragmentShader: document.getElementById('fragmentshader').textContent,\n // defines: {},\n // }),\n // 'baseTexture',\n // );\n // mixPass.needsSwap = true;\n\n // const outputPass = new OutputPass();\n\n // composer = new EffectComposer(this.renderer);\n // composer.addPass(renderScene);\n // composer.addPass(mixPass);\n // composer.addPass(outputPass);\n\n //let renderPass = new RenderPass(this.scene, this.camera) \n //this.outlineComposer.addPass(renderPass)\n }\n }, {\n key: \"updatePreview\",\n value: function updatePreview(ImageData) {\n this.ctxpre.clearRect(0, 0, this.previewCanvas.width, this.previewCanvas.height);\n this.ctxpre.putImageData(ImageData, 0, 0);\n }\n }, {\n key: \"flipY\",\n value: function flipY(buffer, width, height) {\n // 每一轮循环 第i行和第j行交换\n for (var i = 0, j = height - 1; i < j; ++i, --j) {\n // 交换两行的数据\n for (var k = 0; k < 4 * width; ++k) {\n var t = buffer[i * width * 4 + k];\n buffer[i * width * 4 + k] = buffer[j * width * 4 + k];\n buffer[j * width * 4 + k] = t;\n }\n }\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n //composer.render()\n // this.scene.traverse(this.darkenNonBloomed);\n // bloomComposer.render();\n //this.outlineComposer.render()\n //composer2.render();\n this.renderer.resetState();\n this.renderer.render(this.scene, this.camera);\n this.map.triggerRepaint();\n }\n }, {\n key: \"darkenNonBloomed\",\n value: function darkenNonBloomed(obj) {\n // if (obj instanceof THREE.this.scene) { \n // obj.background = new THREE.Color(0x000fff)\n // debugger\n // } \n // if (obj.isMesh) {\n\n // //materials[obj.uuid] = obj.material;\n // obj.background = null\n // //obj.material = darkMaterial;\n // }\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/ExtrusionLayer.js?");
5215
5215
 
5216
5216
  /***/ }),
5217
5217
 
@@ -5222,7 +5222,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
5222
5222
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5223
5223
 
5224
5224
  "use strict";
5225
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ MarkerAreaLayer)\n/* harmony export */ });\n/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/util */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../lib/threebox-plugin */ \"./lib/threebox-plugin/main.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\nvar tb = {};\nvar markerGroup = new three__WEBPACK_IMPORTED_MODULE_3__.Group();\nvar MarkerAreaLayer = /*#__PURE__*/function () {\n function MarkerAreaLayer(id, config) {\n _classCallCheck(this, MarkerAreaLayer);\n _defineProperty(this, \"markerArr\", []);\n _defineProperty(this, \"opacity\", 0.8);\n _defineProperty(this, \"textClass\", '');\n this.id = id;\n this.opacity = config !== null && config !== void 0 && config.opacity ? Number(config.opacity) : 0.8;\n this.type = 'custom';\n this.renderingMode = '2d';\n }\n return _createClass(MarkerAreaLayer, [{\n key: \"createMesh\",\n value: function createMesh(item) {\n var geometry = new three__WEBPACK_IMPORTED_MODULE_3__.BoxGeometry(1000 * item.size, 1000 * item.size, 600000);\n var material = new three__WEBPACK_IMPORTED_MODULE_3__.MeshBasicMaterial({\n color: 0xffff00,\n opacity: 1,\n transparent: true\n });\n var mesh = new three__WEBPACK_IMPORTED_MODULE_3__.Mesh(geometry, material);\n mesh = tb.Object3D({\n obj: mesh,\n units: 'meters',\n anchor: 'center'\n });\n mesh.setCoords((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(item.coords));\n var geometryB = new three__WEBPACK_IMPORTED_MODULE_3__.CylinderGeometry(5000 * item.size, 7000 * item.size, 4000 * item.size, 32);\n var materialB = new three__WEBPACK_IMPORTED_MODULE_3__.MeshBasicMaterial({\n color: 0x377fb6,\n opacity: 1,\n transparent: true\n });\n var meshB = new three__WEBPACK_IMPORTED_MODULE_3__.Mesh(geometryB, materialB);\n\n //meshB.rotation.x = Math.PI / 4;\n meshB.position.z -= 600000;\n meshB.rotation.set(-Math.PI / 2, 0, 0);\n meshB = tb.Object3D({\n obj: meshB,\n units: 'meters',\n anchor: 'center',\n rotation: {\n x: 90,\n y: 0,\n z: 0\n }\n });\n meshB.setCoords((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(item.coords));\n //meshB.setRotation({x:0,y:Math.PI / 4,z:0})\n markerGroup.add(mesh);\n markerGroup.add(meshB);\n }\n }, {\n key: \"addMarkerList\",\n value: function addMarkerList(markerList) {\n for (var i in markerList) {\n var item = markerList[i];\n if (!item.id) {\n throw new Error('marker no id');\n }\n this.createMesh(item);\n }\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n tb = new _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true,\n passiveRendering: false\n });\n tb.add(markerGroup);\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n tb.update();\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/MarkerAreaLayer.js?");
5225
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ MarkerAreaLayer)\n/* harmony export */ });\n/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/util */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../lib/threebox-plugin */ \"./lib/threebox-plugin/main.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n// let this.markerGroup = new THREE.Group();\nvar MarkerAreaLayer = /*#__PURE__*/function () {\n function MarkerAreaLayer(id, config) {\n _classCallCheck(this, MarkerAreaLayer);\n _defineProperty(this, \"tb\", {});\n _defineProperty(this, \"markerArr\", []);\n _defineProperty(this, \"opacity\", 0.8);\n _defineProperty(this, \"textClass\", '');\n _defineProperty(this, \"markerGroup\", new three__WEBPACK_IMPORTED_MODULE_3__.Group());\n this.id = id;\n this.opacity = config !== null && config !== void 0 && config.opacity ? Number(config.opacity) : 0.8;\n this.type = 'custom';\n this.renderingMode = '2d';\n }\n return _createClass(MarkerAreaLayer, [{\n key: \"createMesh\",\n value: function createMesh(item) {\n var geometry = new three__WEBPACK_IMPORTED_MODULE_3__.BoxGeometry(1000 * item.size, 1000 * item.size, 600000);\n var material = new three__WEBPACK_IMPORTED_MODULE_3__.MeshBasicMaterial({\n color: 0xffff00,\n opacity: 1,\n transparent: true\n });\n var mesh = new three__WEBPACK_IMPORTED_MODULE_3__.Mesh(geometry, material);\n mesh = this.tb.Object3D({\n obj: mesh,\n units: 'meters',\n anchor: 'center'\n });\n mesh.setCoords((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(item.coords));\n var geometryB = new three__WEBPACK_IMPORTED_MODULE_3__.CylinderGeometry(5000 * item.size, 7000 * item.size, 4000 * item.size, 32);\n var materialB = new three__WEBPACK_IMPORTED_MODULE_3__.MeshBasicMaterial({\n color: 0x377fb6,\n opacity: 1,\n transparent: true\n });\n var meshB = new three__WEBPACK_IMPORTED_MODULE_3__.Mesh(geometryB, materialB);\n\n //meshB.rotation.x = Math.PI / 4;\n meshB.position.z -= 600000;\n meshB.rotation.set(-Math.PI / 2, 0, 0);\n meshB = this.tb.Object3D({\n obj: meshB,\n units: 'meters',\n anchor: 'center',\n rotation: {\n x: 90,\n y: 0,\n z: 0\n }\n });\n meshB.setCoords((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(item.coords));\n //meshB.setRotation({x:0,y:Math.PI / 4,z:0})\n this.markerGroup.add(mesh);\n this.markerGroup.add(meshB);\n }\n }, {\n key: \"addMarkerList\",\n value: function addMarkerList(markerList) {\n for (var i in markerList) {\n var item = markerList[i];\n if (!item.id) {\n throw new Error('marker no id');\n }\n this.createMesh(item);\n }\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n this.tb = new _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true,\n passiveRendering: false\n });\n this.tb.add(this.markerGroup);\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n this.tb.update();\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/MarkerAreaLayer.js?");
5226
5226
 
5227
5227
  /***/ }),
5228
5228
 
@@ -5233,7 +5233,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
5233
5233
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5234
5234
 
5235
5235
  "use strict";
5236
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ PathLineLayer)\n/* harmony export */ });\n/* harmony import */ var _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../lib/threebox-plugin */ \"./lib/threebox-plugin/main.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _utils_util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/util.js */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\n\nvar tb = {};\nvar PathLineLayer = /*#__PURE__*/function () {\n function PathLineLayer(id, config) {\n _classCallCheck(this, PathLineLayer);\n _defineProperty(this, \"lines\", []);\n this.id = id;\n this.type = 'custom';\n this.renderingMode = '2d';\n }\n return _createClass(PathLineLayer, [{\n key: \"remove\",\n value: function remove() {\n this.lines.forEach(function (a) {\n return tb.remove(a);\n });\n }\n }, {\n key: \"drawLine\",\n value: function drawLine(list) {\n var _this = this;\n this.remove();\n var _lines = [];\n var _line = {\n geometry: [],\n color: 0xffffff,\n width: 20\n };\n for (var i in list) {\n var item = list[i];\n if (i > 0) {\n var pre = list[i - 1];\n if (item.color == pre.color) {\n _line.geometry.push(item.point);\n } else {\n var c = new three__WEBPACK_IMPORTED_MODULE_3__.Color(item.color);\n _lines.push(_line);\n _line = {\n geometry: [],\n color: c,\n width: 20\n };\n }\n if (i == list.length - 1) {\n _lines.push(_line);\n }\n }\n // lineMesh.addEventListener('ObjectMouseOver', ()=>{\n // console.log(999)\n // }, false)\n }\n _lines.forEach(function (line) {\n // var lineOptions = {\n // geometry: line,\n // color: 0xffffff, // color based on latitude of endpoint\n // width: Math.random() + 1 // random width between 1 and 2\n // }\n\n var lineMesh = tb.line(line);\n tb.add(lineMesh);\n _this.lines.push(lineMesh);\n });\n this.map.fitBounds((0,_utils_util_js__WEBPACK_IMPORTED_MODULE_1__.getBBox)(list.map(function (a) {\n return a.point;\n })), {\n padding: {\n top: 45,\n bottom: 45,\n left: 35,\n right: 35\n },\n maxZoom: 11,\n pitch: 0\n });\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n tb = new _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_0__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true,\n passiveRendering: false\n });\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n tb.update();\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/PathLineLayer.js?");
5236
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ PathLineLayer)\n/* harmony export */ });\n/* harmony import */ var _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../lib/threebox-plugin */ \"./lib/threebox-plugin/main.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _utils_util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../utils/util.js */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\n\nvar PathLineLayer = /*#__PURE__*/function () {\n function PathLineLayer(id, config) {\n _classCallCheck(this, PathLineLayer);\n _defineProperty(this, \"tb\", {});\n _defineProperty(this, \"lines\", []);\n this.id = id;\n this.type = 'custom';\n this.renderingMode = '2d';\n }\n return _createClass(PathLineLayer, [{\n key: \"remove\",\n value: function remove() {\n var _this = this;\n this.lines.forEach(function (a) {\n return _this.tb.remove(a);\n });\n }\n }, {\n key: \"drawLine\",\n value: function drawLine(list) {\n var _this2 = this;\n this.remove();\n var _lines = [];\n var _line = {\n geometry: [],\n color: 0xffffff,\n width: 20\n };\n for (var i in list) {\n var item = list[i];\n if (i > 0) {\n var pre = list[i - 1];\n if (item.color == pre.color) {\n _line.geometry.push(item.point);\n } else {\n var c = new three__WEBPACK_IMPORTED_MODULE_3__.Color(item.color);\n _lines.push(_line);\n _line = {\n geometry: [],\n color: c,\n width: 20\n };\n }\n if (i == list.length - 1) {\n _lines.push(_line);\n }\n }\n // lineMesh.addEventListener('ObjectMouseOver', ()=>{\n // console.log(999)\n // }, false)\n }\n _lines.forEach(function (line) {\n // var lineOptions = {\n // geometry: line,\n // color: 0xffffff, // color based on latitude of endpoint\n // width: Math.random() + 1 // random width between 1 and 2\n // }\n\n var lineMesh = _this2.tb.line(line);\n _this2.tb.add(lineMesh);\n _this2.lines.push(lineMesh);\n });\n this.map.fitBounds((0,_utils_util_js__WEBPACK_IMPORTED_MODULE_1__.getBBox)(list.map(function (a) {\n return a.point;\n })), {\n padding: {\n top: 45,\n bottom: 45,\n left: 35,\n right: 35\n },\n maxZoom: 11,\n pitch: 0\n });\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n this.tb = new _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_0__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true,\n passiveRendering: false\n });\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n this.tb.update();\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/PathLineLayer.js?");
5237
5237
 
5238
5238
  /***/ }),
5239
5239
 
@@ -5266,7 +5266,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
5266
5266
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5267
5267
 
5268
5268
  "use strict";
5269
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ThreeScanLayer)\n/* harmony export */ });\n/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/util */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../lib/threebox-plugin */ \"./lib/threebox-plugin/main.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\n\n\nvar tb = {};\nvar ThreeScanLayer = /*#__PURE__*/function () {\n function ThreeScanLayer(id, config) {\n _classCallCheck(this, ThreeScanLayer);\n _defineProperty(this, \"drawArray\", []);\n _defineProperty(this, \"opacity\", 0.8);\n _defineProperty(this, \"textClass\", '');\n _defineProperty(this, \"forceClear\", false);\n _defineProperty(this, \"rectMesh\", {\n mesh: null,\n w: 0.5,\n lng: 0,\n lat: 0\n });\n this.id = id;\n this.opacity = Number(config.opacity);\n this.textClass = config.textClass ? config.textClass : '';\n this.type = 'custom';\n this.renderingMode = '2d';\n this.forceClear = config === null || config === void 0 ? void 0 : config.forceClear;\n }\n\n //同时渲染多个地点图片文本\n return _createClass(ThreeScanLayer, [{\n key: \"drawImageList\",\n value: function () {\n var _drawImageList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(list) {\n var _this = this;\n var delay,\n i,\n _loop,\n _i,\n canvas,\n _args2 = arguments;\n return _regeneratorRuntime().wrap(function _callee$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n delay = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : 300;\n _context2.t0 = _regeneratorRuntime().keys(list);\n case 2:\n if ((_context2.t1 = _context2.t0()).done) {\n _context2.next = 8;\n break;\n }\n i = _context2.t1.value;\n _context2.next = 6;\n return this.update(list[i]);\n case 6:\n _context2.next = 2;\n break;\n case 8:\n _loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop(_i) {\n var _point;\n return _regeneratorRuntime().wrap(function _loop$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _point = list.find(function (a) {\n return a.center[0] == _this.drawArray[_i].center[0] && a.center[1] == _this.drawArray[_i].center[1];\n });\n if (!_point) {\n _this.remove(_this.drawArray[_i]);\n _this.drawArray[_i] = null;\n }\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _loop);\n });\n _context2.t2 = _regeneratorRuntime().keys(this.drawArray);\n case 10:\n if ((_context2.t3 = _context2.t2()).done) {\n _context2.next = 15;\n break;\n }\n _i = _context2.t3.value;\n return _context2.delegateYield(_loop(_i), \"t4\", 13);\n case 13:\n _context2.next = 10;\n break;\n case 15:\n this.drawArray = this.drawArray.filter(function (a) {\n return a;\n });\n tb.update();\n this.map.triggerRepaint();\n _context2.next = 20;\n return (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.sleep)(delay);\n case 20:\n canvas = this.map.getCanvas();\n return _context2.abrupt(\"return\", canvas.toDataURL());\n case 22:\n case \"end\":\n return _context2.stop();\n }\n }, _callee, this);\n }));\n function drawImageList(_x) {\n return _drawImageList.apply(this, arguments);\n }\n return drawImageList;\n }()\n }, {\n key: \"remove\",\n value: function remove(point) {\n point.mesh.label.element.remove();\n tb.remove(point.mesh);\n }\n }, {\n key: \"removeAll\",\n value: function removeAll() {\n for (var i in this.drawArray) {\n this.remove(this.drawArray[i]);\n this.drawArray[i] = null;\n }\n this.drawArray = this.drawArray.filter(function (a) {\n return a;\n });\n tb.update();\n this.map.triggerRepaint();\n }\n }, {\n key: \"setOpacity\",\n value: function setOpacity(opacity) {\n this.opacity = opacity;\n for (var i in this.drawArray) {\n this.drawArray[i].mesh.model.material.opacity = this.opacity;\n }\n }\n }, {\n key: \"updateRect\",\n value: function updateRect(point) {\n var w = point.rect.width ? point.rect.width : this.rectMesh.w;\n if (!this.rectMesh.mesh || w != this.rectMesh.w || point.rect.position[0] != this.rectMesh.lng || point.rect.position[1] != this.rectMesh.lat) {\n if (this.rectMesh.mesh) {\n tb.remove(this.rectMesh.mesh);\n }\n var bounds = (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.getLayerMapPosition)(w, (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(point.rect.position));\n bounds.push(bounds[0]);\n var lineOptions = {\n geometry: bounds,\n color: 0xff1f00,\n // color based on latitude of endpoint\n width: 20 // random width between 1 and 2\n };\n var lineMesh = tb.line(lineOptions);\n this.rectMesh.mesh = lineMesh;\n tb.add(lineMesh);\n // if(this.rectMesh.mesh){\n // tb.remove(this.rectMesh.mesh)\n // }\n // let plane = new THREE.PlaneGeometry( w*20,w*20);\n // let material = new THREE.MeshLambertMaterial({\n // color: 0x004444,\n // transparent:true,\n // opacity:0.5,\n // });\n // let mesh = new THREE.Mesh(plane, material);\n // let edges = new THREE.EdgesGeometry(plane);\n // let edgesMaterial = new THREE.LineBasicMaterial({\n // color: 0xffffff,\n // linewidth:5\n // })\n\n // let line = new THREE.LineSegments(edges, edgesMaterial);\n // mesh.add(line);\n // mesh = tb.Object3D({ obj: mesh, units: 'meters',fixedZoom :15 ,anchor:'center'});\n // this.rectMesh.mesh = mesh;\n // this.rectMesh.w = w;\n }\n // if(this.rectMesh.mesh){\n // this.rectMesh.mesh.setCoords(transform(point.rect.position))\n // tb.add(this.rectMesh.mesh);\n // }\n }\n }, {\n key: \"update\",\n value: function () {\n var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(point) {\n var texture, _texture2, _w, dep, p, index, _point, geometry, material, mesh, dom, _geometry, _material, _mesh, _dom;\n return _regeneratorRuntime().wrap(function _callee2$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n point.text = point.text ? point.text : '';\n if (this.forceClear) {\n three__WEBPACK_IMPORTED_MODULE_3__.Cache.clear();\n (_texture2 = texture) === null || _texture2 === void 0 || _texture2.dispose();\n }\n if (!point.image) {\n _context3.next = 9;\n break;\n }\n _w = point.distance * point.rp * 2;\n dep = point.rp * 2;\n texture = new three__WEBPACK_IMPORTED_MODULE_3__.DataTexture(point.image, _w, _w, three__WEBPACK_IMPORTED_MODULE_3__.RGBAFormat);\n // var width = 32; //纹理宽度\n // var height = 32; //纹理高度\n // var size = width * height; //像素大小\n // var data = new Uint8Array(size * 3); //size*3:像素在缓冲区占用空间\n // for (let i = 0; i < size * 3; i += 3) {\n // // 随机设置RGB分量的值\n // data[i] = 255 * Math.random()\n // data[i + 1] = 255 * Math.random()\n // data[i + 2] = 255 * Math.random()\n\n // 创建数据文理对象 RGB格式:THREE.RGBFormat\n //texture = new THREE.DataTexture(data, width, height, THREE.RGBFormat);\n texture.needsUpdate = true; //纹理更新\n _context3.next = 17;\n break;\n case 9:\n if (!point.url) {\n _context3.next = 17;\n break;\n }\n if (this.forceClear) {\n point.url += \"?tempid=\".concat(Math.random());\n }\n p = function p() {\n return new Promise(function (resolve, reject) {\n new three__WEBPACK_IMPORTED_MODULE_3__.TextureLoader().load(point.url, function (_texture) {\n resolve(_texture);\n });\n });\n };\n _context3.next = 14;\n return p();\n case 14:\n texture = _context3.sent;\n texture.center.set(0.5, 0.5);\n texture.rotation = -Math.PI;\n case 17:\n texture.colorSpace = three__WEBPACK_IMPORTED_MODULE_3__.SRGBColorSpace;\n texture.encoding = three__WEBPACK_IMPORTED_MODULE_3__.sRGBEncoding;\n // texture.flipY = false;\n // texture.flipX = true; \n index = this.drawArray.findIndex(function (a) {\n return a.center[0] == point.center[0] && a.center[1] == point.center[1];\n });\n if (index >= 0) {\n _point = this.drawArray[index];\n if (_point && point.width != _point.width) {\n this.remove(this.drawArray[index]);\n this.drawArray[index] = null;\n this.drawArray = this.drawArray.filter(function (a) {\n return a;\n });\n geometry = new three__WEBPACK_IMPORTED_MODULE_3__.PlaneGeometry(point.width * 20, point.width * 20); //geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));\n material = new three__WEBPACK_IMPORTED_MODULE_3__.MeshBasicMaterial({\n map: texture,\n opacity: this.opacity,\n transparent: true\n });\n material.color.convertSRGBToLinear();\n mesh = new three__WEBPACK_IMPORTED_MODULE_3__.Mesh(geometry, material);\n mesh.name = 'scanimg';\n mesh = tb.Object3D({\n obj: mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n mesh.setCoords((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(point.center));\n tb.renderer.outputEncoding = three__WEBPACK_IMPORTED_MODULE_3__.sRGBEncoding;\n tb.add(mesh);\n dom = document.createElement('div');\n mesh.addLabel(dom, true, {\n x: mesh.anchor.x,\n y: mesh.anchor.y + point.distance * 1200,\n z: mesh.anchor.z\n }, 0);\n mesh.label.element.className += '' + this.textClass;\n mesh.label.element.style.fontSize = '24px';\n mesh.label.element.innerHTML = point.text;\n point.mesh = mesh;\n this.drawArray.push(point);\n if (point.rect) {\n this.updateRect(point);\n }\n } else {\n if (this.forceClear) {\n _point.mesh.model.material.map.dispose();\n }\n _point.mesh.model.material.map = texture;\n _point.mesh.label.element.innerHTML = point.text;\n if (point.rect) {\n this.updateRect(point);\n }\n }\n } else {\n _geometry = new three__WEBPACK_IMPORTED_MODULE_3__.PlaneGeometry(point.width * 20, point.width * 20); //geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));\n _material = new three__WEBPACK_IMPORTED_MODULE_3__.MeshBasicMaterial({\n map: texture,\n opacity: this.opacity,\n transparent: true\n });\n _material.color.convertSRGBToLinear();\n _mesh = new three__WEBPACK_IMPORTED_MODULE_3__.Mesh(_geometry, _material);\n _mesh.name = 'scanimg';\n _mesh = tb.Object3D({\n obj: _mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n _mesh.setCoords((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(point.center));\n tb.renderer.outputEncoding = three__WEBPACK_IMPORTED_MODULE_3__.sRGBEncoding;\n tb.add(_mesh);\n _dom = document.createElement('div');\n _mesh.addLabel(_dom, true, {\n x: _mesh.anchor.x,\n y: _mesh.anchor.y + point.distance * 1200,\n z: _mesh.anchor.z\n }, 0);\n _mesh.label.element.className += '' + this.textClass;\n _mesh.label.element.style.fontSize = '24px';\n _mesh.label.element.innerHTML = point.text;\n point.mesh = _mesh;\n this.drawArray.push(point);\n if (point.rect) {\n this.updateRect(point);\n }\n }\n case 21:\n case \"end\":\n return _context3.stop();\n }\n }, _callee2, this);\n }));\n function update(_x2) {\n return _update.apply(this, arguments);\n }\n return update;\n }()\n }, {\n key: \"drawImage\",\n value: function drawImage(point) {\n var texture;\n if (point.image) {\n texture = new three__WEBPACK_IMPORTED_MODULE_3__.TextureLoader(point.image);\n } else if (point.url) {\n texture = new three__WEBPACK_IMPORTED_MODULE_3__.TextureLoader().load(point.url);\n }\n texture.encoding = three__WEBPACK_IMPORTED_MODULE_3__.sRGBEncoding;\n texture.flipY = false;\n var geometry = new three__WEBPACK_IMPORTED_MODULE_3__.PlaneGeometry(point.width * 20, point.width * 20);\n //geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));\n var material = new three__WEBPACK_IMPORTED_MODULE_3__.MeshPhongMaterial({\n map: texture,\n opacity: this.opacity,\n transparent: true\n });\n material.color.convertSRGBToLinear();\n var mesh = new three__WEBPACK_IMPORTED_MODULE_3__.Mesh(geometry, material);\n mesh.name = 'scanimg';\n mesh = tb.Object3D({\n obj: mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n mesh.setCoords((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(point.center));\n tb.renderer.outputEncoding = three__WEBPACK_IMPORTED_MODULE_3__.sRGBEncoding;\n tb.add(mesh);\n var dom = document.createElement('div');\n mesh.addLabel(dom, true, {\n x: mesh.anchor.x,\n y: mesh.anchor.y + point.distance * 1200,\n z: mesh.anchor.z\n }, 0);\n mesh.label.element.className += '' + this.textClass;\n mesh.label.element.style.fontSize = '24px';\n point.mesh = mesh;\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n tb = new _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true,\n passiveRendering: false\n });\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n tb.update();\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/ThreeScanLayer.js?");
5269
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ThreeScanLayer)\n/* harmony export */ });\n/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/util */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../lib/threebox-plugin */ \"./lib/threebox-plugin/main.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\n\n\nvar ThreeScanLayer = /*#__PURE__*/function () {\n function ThreeScanLayer(id, config) {\n _classCallCheck(this, ThreeScanLayer);\n _defineProperty(this, \"tb\", {});\n _defineProperty(this, \"drawArray\", []);\n _defineProperty(this, \"opacity\", 0.8);\n _defineProperty(this, \"textClass\", '');\n _defineProperty(this, \"forceClear\", false);\n _defineProperty(this, \"rectMesh\", {\n mesh: null,\n w: 0.5,\n lng: 0,\n lat: 0\n });\n this.id = id;\n this.opacity = Number(config.opacity);\n this.textClass = config.textClass ? config.textClass : '';\n this.type = 'custom';\n this.renderingMode = '2d';\n this.forceClear = config === null || config === void 0 ? void 0 : config.forceClear;\n }\n\n //同时渲染多个地点图片文本\n return _createClass(ThreeScanLayer, [{\n key: \"drawImageList\",\n value: function () {\n var _drawImageList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(list) {\n var _this = this;\n var delay,\n i,\n _loop,\n _i,\n canvas,\n _args2 = arguments;\n return _regeneratorRuntime().wrap(function _callee$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n delay = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : 300;\n _context2.t0 = _regeneratorRuntime().keys(list);\n case 2:\n if ((_context2.t1 = _context2.t0()).done) {\n _context2.next = 8;\n break;\n }\n i = _context2.t1.value;\n _context2.next = 6;\n return this.update(list[i]);\n case 6:\n _context2.next = 2;\n break;\n case 8:\n _loop = /*#__PURE__*/_regeneratorRuntime().mark(function _loop(_i) {\n var _point;\n return _regeneratorRuntime().wrap(function _loop$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n _point = list.find(function (a) {\n return a.center[0] == _this.drawArray[_i].center[0] && a.center[1] == _this.drawArray[_i].center[1];\n });\n if (!_point) {\n _this.remove(_this.drawArray[_i]);\n _this.drawArray[_i] = null;\n }\n case 2:\n case \"end\":\n return _context.stop();\n }\n }, _loop);\n });\n _context2.t2 = _regeneratorRuntime().keys(this.drawArray);\n case 10:\n if ((_context2.t3 = _context2.t2()).done) {\n _context2.next = 15;\n break;\n }\n _i = _context2.t3.value;\n return _context2.delegateYield(_loop(_i), \"t4\", 13);\n case 13:\n _context2.next = 10;\n break;\n case 15:\n this.drawArray = this.drawArray.filter(function (a) {\n return a;\n });\n this.tb.update();\n this.map.triggerRepaint();\n _context2.next = 20;\n return (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.sleep)(delay);\n case 20:\n canvas = this.map.getCanvas();\n return _context2.abrupt(\"return\", canvas.toDataURL());\n case 22:\n case \"end\":\n return _context2.stop();\n }\n }, _callee, this);\n }));\n function drawImageList(_x) {\n return _drawImageList.apply(this, arguments);\n }\n return drawImageList;\n }()\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n this.removeAll();\n }\n }, {\n key: \"remove\",\n value: function remove(point) {\n point.mesh.label.element.remove();\n this.tb.remove(point.mesh);\n }\n }, {\n key: \"removeAll\",\n value: function removeAll() {\n for (var i in this.drawArray) {\n this.remove(this.drawArray[i]);\n this.drawArray[i] = null;\n }\n this.drawArray = this.drawArray.filter(function (a) {\n return a;\n });\n this.tb.update();\n this.map.triggerRepaint();\n }\n }, {\n key: \"setOpacity\",\n value: function setOpacity(opacity) {\n this.opacity = opacity;\n for (var i in this.drawArray) {\n this.drawArray[i].mesh.model.material.opacity = this.opacity;\n }\n }\n }, {\n key: \"updateRect\",\n value: function updateRect(point) {\n var w = point.rect.width ? point.rect.width : this.rectMesh.w;\n if (!this.rectMesh.mesh || w != this.rectMesh.w || point.rect.position[0] != this.rectMesh.lng || point.rect.position[1] != this.rectMesh.lat) {\n if (this.rectMesh.mesh) {\n this.tb.remove(this.rectMesh.mesh);\n }\n var bounds = (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.getLayerMapPosition)(w, (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(point.rect.position));\n bounds.push(bounds[0]);\n var lineOptions = {\n geometry: bounds,\n color: 0xff1f00,\n // color based on latitude of endpoint\n width: 20 // random width between 1 and 2\n };\n var lineMesh = this.tb.line(lineOptions);\n this.rectMesh.mesh = lineMesh;\n this.tb.add(lineMesh);\n // if(this.rectMesh.mesh){\n // this.tb.remove(this.rectMesh.mesh)\n // }\n // let plane = new THREE.PlaneGeometry( w*20,w*20);\n // let material = new THREE.MeshLambertMaterial({\n // color: 0x004444,\n // transparent:true,\n // opacity:0.5,\n // });\n // let mesh = new THREE.Mesh(plane, material);\n // let edges = new THREE.EdgesGeometry(plane);\n // let edgesMaterial = new THREE.LineBasicMaterial({\n // color: 0xffffff,\n // linewidth:5\n // })\n\n // let line = new THREE.LineSegments(edges, edgesMaterial);\n // mesh.add(line);\n // mesh = this.tb.Object3D({ obj: mesh, units: 'meters',fixedZoom :15 ,anchor:'center'});\n // this.rectMesh.mesh = mesh;\n // this.rectMesh.w = w;\n }\n // if(this.rectMesh.mesh){\n // this.rectMesh.mesh.setCoords(transform(point.rect.position))\n // this.tb.add(this.rectMesh.mesh);\n // }\n }\n }, {\n key: \"update\",\n value: function () {\n var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(point) {\n var texture, _texture2, _w, dep, p, index, _point, geometry, material, mesh, dom, _geometry, _material, _mesh, _dom;\n return _regeneratorRuntime().wrap(function _callee2$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n point.text = point.text ? point.text : '';\n if (this.forceClear) {\n three__WEBPACK_IMPORTED_MODULE_3__.Cache.clear();\n (_texture2 = texture) === null || _texture2 === void 0 || _texture2.dispose();\n }\n if (!point.image) {\n _context3.next = 9;\n break;\n }\n _w = point.distance * point.rp * 2;\n dep = point.rp * 2;\n texture = new three__WEBPACK_IMPORTED_MODULE_3__.DataTexture(point.image, _w, _w, three__WEBPACK_IMPORTED_MODULE_3__.RGBAFormat);\n // var width = 32; //纹理宽度\n // var height = 32; //纹理高度\n // var size = width * height; //像素大小\n // var data = new Uint8Array(size * 3); //size*3:像素在缓冲区占用空间\n // for (let i = 0; i < size * 3; i += 3) {\n // // 随机设置RGB分量的值\n // data[i] = 255 * Math.random()\n // data[i + 1] = 255 * Math.random()\n // data[i + 2] = 255 * Math.random()\n\n // 创建数据文理对象 RGB格式:THREE.RGBFormat\n //texture = new THREE.DataTexture(data, width, height, THREE.RGBFormat);\n texture.needsUpdate = true; //纹理更新\n _context3.next = 19;\n break;\n case 9:\n if (!point.url) {\n _context3.next = 19;\n break;\n }\n if (this.forceClear) {\n point.url += \"?tempid=\".concat(Math.random());\n }\n p = function p() {\n return new Promise(function (resolve, reject) {\n try {\n new three__WEBPACK_IMPORTED_MODULE_3__.TextureLoader().load(point.url, function (_texture) {\n resolve(_texture);\n }, function () {}, function () {\n resolve(null);\n });\n } catch (_unused) {\n reject(null);\n }\n });\n };\n _context3.next = 14;\n return p();\n case 14:\n texture = _context3.sent;\n if (texture) {\n _context3.next = 17;\n break;\n }\n return _context3.abrupt(\"return\");\n case 17:\n texture.center.set(0.5, 0.5);\n texture.rotation = -Math.PI;\n case 19:\n texture.colorSpace = three__WEBPACK_IMPORTED_MODULE_3__.SRGBColorSpace;\n texture.encoding = three__WEBPACK_IMPORTED_MODULE_3__.sRGBEncoding;\n // texture.flipY = false;\n // texture.flipX = true; \n index = this.drawArray.findIndex(function (a) {\n return a.center[0] == point.center[0] && a.center[1] == point.center[1];\n });\n if (index >= 0) {\n _point = this.drawArray[index];\n if (_point && point.width != _point.width) {\n this.remove(this.drawArray[index]);\n this.drawArray[index] = null;\n this.drawArray = this.drawArray.filter(function (a) {\n return a;\n });\n geometry = new three__WEBPACK_IMPORTED_MODULE_3__.PlaneGeometry(point.width * 20, point.width * 20); //geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));\n material = new three__WEBPACK_IMPORTED_MODULE_3__.MeshBasicMaterial({\n map: texture,\n opacity: this.opacity,\n transparent: true\n });\n material.color.convertSRGBToLinear();\n mesh = new three__WEBPACK_IMPORTED_MODULE_3__.Mesh(geometry, material);\n mesh.name = 'scanimg';\n mesh = this.tb.Object3D({\n obj: mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n mesh.setCoords((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(point.center));\n this.tb.renderer.outputEncoding = three__WEBPACK_IMPORTED_MODULE_3__.sRGBEncoding;\n this.tb.add(mesh);\n dom = document.createElement('div');\n mesh.addLabel(dom, true, {\n x: mesh.anchor.x,\n y: mesh.anchor.y + point.distance * 1200,\n z: mesh.anchor.z\n }, 0);\n mesh.label.element.className += '' + this.textClass;\n mesh.label.element.style.fontSize = '24px';\n mesh.label.element.innerHTML = point.text;\n point.mesh = mesh;\n this.drawArray.push(point);\n if (point.rect) {\n this.updateRect(point);\n }\n } else {\n if (this.forceClear) {\n _point.mesh.model.material.map.dispose();\n }\n _point.mesh.model.material.map = texture;\n _point.mesh.label.element.innerHTML = point.text;\n if (point.rect) {\n this.updateRect(point);\n }\n }\n } else {\n _geometry = new three__WEBPACK_IMPORTED_MODULE_3__.PlaneGeometry(point.width * 20, point.width * 20); //geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));\n _material = new three__WEBPACK_IMPORTED_MODULE_3__.MeshBasicMaterial({\n map: texture,\n opacity: this.opacity,\n transparent: true\n });\n _material.color.convertSRGBToLinear();\n _mesh = new three__WEBPACK_IMPORTED_MODULE_3__.Mesh(_geometry, _material);\n _mesh.name = 'scanimg';\n _mesh = this.tb.Object3D({\n obj: _mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n _mesh.setCoords((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(point.center));\n this.tb.renderer.outputEncoding = three__WEBPACK_IMPORTED_MODULE_3__.sRGBEncoding;\n this.tb.add(_mesh);\n _dom = document.createElement('div');\n _mesh.addLabel(_dom, true, {\n x: _mesh.anchor.x,\n y: _mesh.anchor.y + point.distance * 1200,\n z: _mesh.anchor.z\n }, 0);\n _mesh.label.element.className += '' + this.textClass;\n _mesh.label.element.style.fontSize = '24px';\n _mesh.label.element.innerHTML = point.text;\n point.mesh = _mesh;\n this.drawArray.push(point);\n if (point.rect) {\n this.updateRect(point);\n }\n }\n case 23:\n case \"end\":\n return _context3.stop();\n }\n }, _callee2, this);\n }));\n function update(_x2) {\n return _update.apply(this, arguments);\n }\n return update;\n }()\n }, {\n key: \"drawImage\",\n value: function drawImage(point) {\n var texture;\n if (point.image) {\n texture = new three__WEBPACK_IMPORTED_MODULE_3__.TextureLoader(point.image);\n } else if (point.url) {\n texture = new three__WEBPACK_IMPORTED_MODULE_3__.TextureLoader().load(point.url);\n }\n texture.encoding = three__WEBPACK_IMPORTED_MODULE_3__.sRGBEncoding;\n texture.flipY = false;\n var geometry = new three__WEBPACK_IMPORTED_MODULE_3__.PlaneGeometry(point.width * 20, point.width * 20);\n //geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));\n var material = new three__WEBPACK_IMPORTED_MODULE_3__.MeshPhongMaterial({\n map: texture,\n opacity: this.opacity,\n transparent: true\n });\n material.color.convertSRGBToLinear();\n var mesh = new three__WEBPACK_IMPORTED_MODULE_3__.Mesh(geometry, material);\n mesh.name = 'scanimg';\n mesh = this.tb.Object3D({\n obj: mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n mesh.setCoords((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(point.center));\n this.tb.renderer.outputEncoding = three__WEBPACK_IMPORTED_MODULE_3__.sRGBEncoding;\n this.tb.add(mesh);\n var dom = document.createElement('div');\n mesh.addLabel(dom, true, {\n x: mesh.anchor.x,\n y: mesh.anchor.y + point.distance * 1200,\n z: mesh.anchor.z\n }, 0);\n mesh.label.element.className += '' + this.textClass;\n mesh.label.element.style.fontSize = '24px';\n point.mesh = mesh;\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n this.tb = new _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_2__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true,\n passiveRendering: false\n });\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n this.tb.update();\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/ThreeScanLayer.js?");
5270
5270
 
5271
5271
  /***/ }),
5272
5272
 
@@ -5277,7 +5277,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
5277
5277
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5278
5278
 
5279
5279
  "use strict";
5280
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ThreeWallLayer)\n/* harmony export */ });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/util */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../lib/threebox-plugin */ \"./lib/threebox-plugin/main.js\");\n/* harmony import */ var _utils_mapUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/mapUtil */ \"./src/utils/mapUtil.js\");\n/* harmony import */ var _utils_CameraSync__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/CameraSync */ \"./src/utils/CameraSync.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\nvar WORLD_SIZE = 1024000;\nvar tb = {};\nvar scene;\nvar cameraTransform;\nvar group = new three__WEBPACK_IMPORTED_MODULE_4__.Group();\nvar ThreeWallLayer = /*#__PURE__*/function () {\n function ThreeWallLayer(id, config) {\n _classCallCheck(this, ThreeWallLayer);\n _defineProperty(this, \"opacity\", 0.8);\n _defineProperty(this, \"scale\", 2);\n _defineProperty(this, \"limit\", 6);\n _defineProperty(this, \"colorFun\", function () {\n return [0, 0, 0, 0];\n });\n _defineProperty(this, \"addedFun\", null);\n this.id = id;\n this.opacity = Number(config.opacity);\n if (config.colorFun) {\n this.colorFun = config.colorFun;\n }\n this.type = 'custom';\n this.renderingMode = '2d';\n this.addedFun = config.addedFun;\n }\n return _createClass(ThreeWallLayer, [{\n key: \"drawWall\",\n value: function drawWall(dataList) {\n var geometry = new three__WEBPACK_IMPORTED_MODULE_4__.BufferGeometry();\n var indices = [];\n var vertices = [\n // 82.71083,\n // 2,\n // 40.68735,\n\n // 82.71083,\n // 4,\n // 40.68735,\n\n // 82.71083,\n // 6,\n // 40.68735,\n\n // 82.42999,\n // 2,\n // 40.58893,\n\n // 82.42999,\n // 4,\n // 40.58893,\n\n // 82.42999,\n // 6,\n // 40.58893,\n\n // 82.3689,\n // 2,\n // 40.79668,\n\n // 82.3689,\n // 4,\n // 40.79668,\n\n // 82.3689,\n // 6,\n // 40.79668,\n\n // 82.30361,\n // 2,\n // 40.76822,\n\n // 82.30361,\n // 4,\n // 40.76822,\n\n // 82.30361,\n // 6,\n // 40.76822,\n\n // 82.15195,\n // 2,\n // 40.261634,\n\n // 82.15195,\n // 4,\n // 40.261634,\n\n // 82.15195,\n // 6,\n // 40.261634\n ];\n var normals = [];\n var colors = [];\n var distance = dataList[0].distance;\n var noDataLenth = distance[0] / distance[1];\n var limitIndex = this.limit / distance[1];\n limitIndex = limitIndex >= distance[2] - 1 ? distance[2] - 1 : limitIndex;\n dataList = dataList;\n var len = limitIndex + noDataLenth;\n var index = 0;\n var _color = new three__WEBPACK_IMPORTED_MODULE_4__.Color();\n for (var i in dataList) {\n i = Number(i);\n var item = dataList[i];\n var lng = item.lng;\n var lat = item.lat;\n var position = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_2__.projectToWorld)([lng, lat]);\n if (i < dataList.length - 1) {\n var next = dataList[i + 1];\n if (lng == next.lng && lat == next.lat) {\n continue;\n }\n }\n for (var j in item.data) {\n j = Number(j);\n var indexJ = j + noDataLenth - 1;\n if (j > -noDataLenth && j <= limitIndex) {\n //let position = mapboxgl.MercatorCoordinate.fromLngLat({lng: lng, lat: lat}, (j+noDataLenth) * this.scale); \n\n //(Math.floor(position.x * 1000000 )/10000,(j+noDataLenth) * this.scale ,Math.floor(position.y * 1000000)/10000)\n vertices.push(position.x, position.y, position.z + (j + noDataLenth) * this.scale);\n // debugger\n normals.push(0, 1, 0);\n var color = this.colorFun(item.data[j]);\n _color.setRGB(color[0] / 255, color[1] / 255, color[2] / 255, three__WEBPACK_IMPORTED_MODULE_4__.SRGBColorSpace);\n colors.push(_color.r, _color.g, _color.b, color[3]);\n if (i < dataList.length - 2 && j < limitIndex) {\n var a = index + 1;\n var b = index;\n var c = index + len;\n var d = index + len + 1;\n indices.push(a, b, d); // face one\n indices.push(b, c, d); // face two \n index = index + 1;\n }\n }\n }\n index = vertices.length / 3;\n }\n geometry.setIndex(indices);\n geometry.setAttribute('position', new three__WEBPACK_IMPORTED_MODULE_4__.Float32BufferAttribute(vertices, 3));\n geometry.setAttribute('normal', new three__WEBPACK_IMPORTED_MODULE_4__.Float32BufferAttribute(normals, 3));\n geometry.setAttribute('color', new three__WEBPACK_IMPORTED_MODULE_4__.Float32BufferAttribute(colors, 4));\n var material = new three__WEBPACK_IMPORTED_MODULE_4__.MeshBasicMaterial({\n side: three__WEBPACK_IMPORTED_MODULE_4__.DoubleSide,\n transparent: true,\n vertexColors: true\n });\n //material.color.convertSRGBToLinear();\n var mesh = new three__WEBPACK_IMPORTED_MODULE_4__.Mesh(geometry, material);\n // mesh = tb.Object3D({ obj: mesh, units: 'meters',anchor:'center'});\n // tb.add(mesh);\n group.add(mesh);\n this.map.fitBounds((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.getBBox)(dataList.map(function (a) {\n return [a.lng, a.lat];\n })), {\n padding: {\n top: 45,\n bottom: 45,\n left: 35,\n right: 35\n },\n maxZoom: 11,\n pitch: 30\n });\n }\n }, {\n key: \"drawWallTest\",\n value: function drawWallTest(dataList) {\n var geometry = new three__WEBPACK_IMPORTED_MODULE_4__.BufferGeometry();\n var indices = [];\n var vertices = [];\n var normals = [];\n var colors = [];\n var size = 20;\n var segments = 10;\n var halfSize = size / 2;\n var segmentSize = size / segments;\n var _color = new three__WEBPACK_IMPORTED_MODULE_4__.Color();\n\n // generate vertices, normals and color data for a simple grid geometry\n\n for (var i = 0; i <= segments; i++) {\n var y = i * segmentSize - halfSize;\n for (var j = 0; j <= segments; j++) {\n var x = j * segmentSize - halfSize;\n vertices.push(x, -y, 0);\n normals.push(0, 0, 1);\n var r = x / size + 0.5;\n var g = y / size + 0.5;\n _color.setRGB(r, g, 1, three__WEBPACK_IMPORTED_MODULE_4__.SRGBColorSpace);\n colors.push(_color.r, _color.g, _color.b);\n }\n }\n\n // generate indices (data for element array buffer)\n\n for (var _i = 0; _i < segments; _i++) {\n for (var _j = 0; _j < segments; _j++) {\n var a = _i * (segments + 1) + (_j + 1);\n var b = _i * (segments + 1) + _j;\n var c = (_i + 1) * (segments + 1) + _j;\n var d = (_i + 1) * (segments + 1) + (_j + 1);\n\n // generate two faces (triangles) per iteration\n\n indices.push(a, b, d); // face one\n indices.push(b, c, d); // face two\n }\n }\n\n //\n\n geometry.setIndex(indices);\n geometry.setAttribute('position', new three__WEBPACK_IMPORTED_MODULE_4__.Float32BufferAttribute(vertices, 3));\n geometry.setAttribute('normal', new three__WEBPACK_IMPORTED_MODULE_4__.Float32BufferAttribute(normals, 3));\n geometry.setAttribute('color', new three__WEBPACK_IMPORTED_MODULE_4__.Float32BufferAttribute(colors, 3));\n var material = new three__WEBPACK_IMPORTED_MODULE_4__.MeshPhongMaterial({\n side: three__WEBPACK_IMPORTED_MODULE_4__.DoubleSide,\n vertexColors: true\n });\n var mesh = new three__WEBPACK_IMPORTED_MODULE_4__.Mesh(geometry, material);\n scene.add(mesh);\n // mesh = tb.Object3D({ obj: mesh, units: 'meters',anchor:'center'});\n // tb.add(mesh); \n // for(let line of lines){\n // this.createLine(line.coords,`rgba(${line.color.join(',')})`)\n // }\n }\n }, {\n key: \"createLine\",\n value: function createLine(path, color) {\n var line = tb.line({\n width: this.width,\n opacity: this.opacity,\n color: color,\n geometry: path\n });\n tb.add(line);\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n var container = map.getCanvas();\n var w = container.clientWidth;\n var h = container.clientHeight;\n this.camera = new three__WEBPACK_IMPORTED_MODULE_4__.PerspectiveCamera(map.transform.fov, w / h, 0.1, 1e21);\n scene = new three__WEBPACK_IMPORTED_MODULE_4__.Scene();\n scene.add(group);\n new _utils_CameraSync__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this.map, this.camera, group);\n // let centerlngLat = map.getCenter()\n // let center = mapboxgl.MercatorCoordinate.fromLngLat(centerlngLat)\n // const scale = center.meterInMercatorCoordinateUnits();\n // //this.scale = scale;\n // let {x,y,z} = center;\n // const modelRotate = [Math.PI / 2, 0, 0];\n\n // cameraTransform = new THREE.Matrix4()\n // .makeTranslation(\n // x,\n // y,\n // z\n // )\n // .scale(\n // new THREE.Vector3(\n // scale,\n // -scale,\n // scale\n // )\n // )\n // .multiply( new THREE.Matrix4().makeRotationAxis(\n // new THREE.Vector3(1, 0, 0),\n // modelRotate[0]\n // ))\n // .multiply(new THREE.Matrix4().makeRotationAxis(\n // new THREE.Vector3(0, 1, 0),\n // modelRotate[1]\n // ))\n // .multiply(new THREE.Matrix4().makeRotationAxis(\n // new THREE.Vector3(0, 0, 1),\n // modelRotate[2]\n // ));\n // create two three.js lights to illuminate the model\n // let directionalLight = new THREE.DirectionalLight(0xffffff);\n // directionalLight.position.set(0, -70, 100).normalize();\n // scene.add(directionalLight);\n\n // let directionalLight2 = new THREE.DirectionalLight(0xffffff);\n // directionalLight2.position.set(0, 70, 100).normalize();\n // scene.add(directionalLight2); \n // tb = new Threebox(\n // map,\n // gl, //get the context from Mapbox\n // { defaultLights: true ,passiveRendering:false}\n // ); \n //scene.add(new THREE.AxesHelper(1000));\n this.renderer = new three__WEBPACK_IMPORTED_MODULE_4__.WebGLRenderer({\n canvas: map.getCanvas(),\n context: gl,\n antialias: true\n });\n this.renderer.outputEncoding = three__WEBPACK_IMPORTED_MODULE_4__.sRGBEncoding;\n this.renderer.autoClear = false;\n if (this.addedFun) this.addedFun();\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n //tb.update(); \n // const rotationX = new THREE.Matrix4().makeRotationAxis(\n // new THREE.Vector3(1, 0, 0),\n // modelTransform.rotateX\n // );\n // const rotationY = new THREE.Matrix4().makeRotationAxis(\n // new THREE.Vector3(0, 1, 0),\n // modelTransform.rotateY\n // );\n // const rotationZ = new THREE.Matrix4().makeRotationAxis(\n // new THREE.Vector3(0, 0, 1),\n // modelTransform.rotateZ\n // );\n\n // const m = new THREE.Matrix4().fromArray(matrix);\n // const l = new THREE.Matrix4()\n // .makeTranslation(\n // modelTransform.translateX,\n // modelTransform.translateY,\n // modelTransform.translateZ\n // )\n // .scale(\n // new THREE.Vector3(\n // modelTransform.scale,\n // -modelTransform.scale,\n // modelTransform.scale\n // )\n // )\n // .multiply(rotationX)\n // .multiply(rotationY)\n // .multiply(rotationZ);\n\n //this.camera.projectionMatrix = m.multiply(l);\n // var m = new THREE.Matrix4().fromArray(matrix);\n // this.camera.projectionMatrix = m.multiply(cameraTransform);;\n // this.renderer.resetState();\n this.renderer.render(scene, this.camera);\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/ThreeWallLayer.js?");
5280
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ThreeWallLayer)\n/* harmony export */ });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/util */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_threebox_plugin__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../lib/threebox-plugin */ \"./lib/threebox-plugin/main.js\");\n/* harmony import */ var _utils_mapUtil__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/mapUtil */ \"./src/utils/mapUtil.js\");\n/* harmony import */ var _utils_CameraSync__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/CameraSync */ \"./src/utils/CameraSync.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\nvar WORLD_SIZE = 1024000;\n// var this.\n// let this.scene;\nvar cameraTransform;\n// var this.group = new THREE.Group();\nvar ThreeWallLayer = /*#__PURE__*/function () {\n function ThreeWallLayer(id, config) {\n _classCallCheck(this, ThreeWallLayer);\n _defineProperty(this, \"tb\", {});\n _defineProperty(this, \"group\", new three__WEBPACK_IMPORTED_MODULE_4__.Group());\n _defineProperty(this, \"scene\", void 0);\n _defineProperty(this, \"opacity\", 0.8);\n _defineProperty(this, \"scale\", 2);\n _defineProperty(this, \"limit\", 6);\n _defineProperty(this, \"colorFun\", function () {\n return [0, 0, 0, 0];\n });\n _defineProperty(this, \"addedFun\", null);\n this.id = id;\n this.opacity = Number(config.opacity);\n if (config.colorFun) {\n this.colorFun = config.colorFun;\n }\n this.type = 'custom';\n this.renderingMode = '2d';\n this.addedFun = config.addedFun;\n }\n return _createClass(ThreeWallLayer, [{\n key: \"drawWall\",\n value: function drawWall(dataList) {\n var geometry = new three__WEBPACK_IMPORTED_MODULE_4__.BufferGeometry();\n var indices = [];\n var vertices = [\n // 82.71083,\n // 2,\n // 40.68735,\n\n // 82.71083,\n // 4,\n // 40.68735,\n\n // 82.71083,\n // 6,\n // 40.68735,\n\n // 82.42999,\n // 2,\n // 40.58893,\n\n // 82.42999,\n // 4,\n // 40.58893,\n\n // 82.42999,\n // 6,\n // 40.58893,\n\n // 82.3689,\n // 2,\n // 40.79668,\n\n // 82.3689,\n // 4,\n // 40.79668,\n\n // 82.3689,\n // 6,\n // 40.79668,\n\n // 82.30361,\n // 2,\n // 40.76822,\n\n // 82.30361,\n // 4,\n // 40.76822,\n\n // 82.30361,\n // 6,\n // 40.76822,\n\n // 82.15195,\n // 2,\n // 40.261634,\n\n // 82.15195,\n // 4,\n // 40.261634,\n\n // 82.15195,\n // 6,\n // 40.261634\n ];\n var normals = [];\n var colors = [];\n var distance = dataList[0].distance;\n var noDataLenth = distance[0] / distance[1];\n var limitIndex = this.limit / distance[1];\n limitIndex = limitIndex >= distance[2] - 1 ? distance[2] - 1 : limitIndex;\n dataList = dataList;\n var len = limitIndex + noDataLenth;\n var index = 0;\n var _color = new three__WEBPACK_IMPORTED_MODULE_4__.Color();\n for (var i in dataList) {\n i = Number(i);\n var item = dataList[i];\n var lng = item.lng;\n var lat = item.lat;\n var position = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_2__.projectToWorld)([lng, lat]);\n if (i < dataList.length - 1) {\n var next = dataList[i + 1];\n if (lng == next.lng && lat == next.lat) {\n continue;\n }\n }\n for (var j in item.data) {\n j = Number(j);\n var indexJ = j + noDataLenth - 1;\n if (j > -noDataLenth && j <= limitIndex) {\n //let position = mapboxgl.MercatorCoordinate.fromLngLat({lng: lng, lat: lat}, (j+noDataLenth) * this.scale); \n\n //(Math.floor(position.x * 1000000 )/10000,(j+noDataLenth) * this.scale ,Math.floor(position.y * 1000000)/10000)\n vertices.push(position.x, position.y, position.z + (j + noDataLenth) * this.scale);\n // debugger\n normals.push(0, 1, 0);\n var color = this.colorFun(item.data[j]);\n _color.setRGB(color[0] / 255, color[1] / 255, color[2] / 255, three__WEBPACK_IMPORTED_MODULE_4__.SRGBColorSpace);\n colors.push(_color.r, _color.g, _color.b, color[3]);\n if (i < dataList.length - 2 && j < limitIndex) {\n var a = index + 1;\n var b = index;\n var c = index + len;\n var d = index + len + 1;\n indices.push(a, b, d); // face one\n indices.push(b, c, d); // face two \n index = index + 1;\n }\n }\n }\n index = vertices.length / 3;\n }\n geometry.setIndex(indices);\n geometry.setAttribute('position', new three__WEBPACK_IMPORTED_MODULE_4__.Float32BufferAttribute(vertices, 3));\n geometry.setAttribute('normal', new three__WEBPACK_IMPORTED_MODULE_4__.Float32BufferAttribute(normals, 3));\n geometry.setAttribute('color', new three__WEBPACK_IMPORTED_MODULE_4__.Float32BufferAttribute(colors, 4));\n var material = new three__WEBPACK_IMPORTED_MODULE_4__.MeshBasicMaterial({\n side: three__WEBPACK_IMPORTED_MODULE_4__.DoubleSide,\n transparent: true,\n vertexColors: true\n });\n //material.color.convertSRGBToLinear();\n var mesh = new three__WEBPACK_IMPORTED_MODULE_4__.Mesh(geometry, material);\n // mesh = this.tb.Object3D({ obj: mesh, units: 'meters',anchor:'center'});\n // this.tb.add(mesh);\n this.group.add(mesh);\n this.map.fitBounds((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.getBBox)(dataList.map(function (a) {\n return [a.lng, a.lat];\n })), {\n padding: {\n top: 45,\n bottom: 45,\n left: 35,\n right: 35\n },\n maxZoom: 11,\n pitch: 30\n });\n }\n }, {\n key: \"drawWallTest\",\n value: function drawWallTest(dataList) {\n var geometry = new three__WEBPACK_IMPORTED_MODULE_4__.BufferGeometry();\n var indices = [];\n var vertices = [];\n var normals = [];\n var colors = [];\n var size = 20;\n var segments = 10;\n var halfSize = size / 2;\n var segmentSize = size / segments;\n var _color = new three__WEBPACK_IMPORTED_MODULE_4__.Color();\n\n // generate vertices, normals and color data for a simple grid geometry\n\n for (var i = 0; i <= segments; i++) {\n var y = i * segmentSize - halfSize;\n for (var j = 0; j <= segments; j++) {\n var x = j * segmentSize - halfSize;\n vertices.push(x, -y, 0);\n normals.push(0, 0, 1);\n var r = x / size + 0.5;\n var g = y / size + 0.5;\n _color.setRGB(r, g, 1, three__WEBPACK_IMPORTED_MODULE_4__.SRGBColorSpace);\n colors.push(_color.r, _color.g, _color.b);\n }\n }\n\n // generate indices (data for element array buffer)\n\n for (var _i = 0; _i < segments; _i++) {\n for (var _j = 0; _j < segments; _j++) {\n var a = _i * (segments + 1) + (_j + 1);\n var b = _i * (segments + 1) + _j;\n var c = (_i + 1) * (segments + 1) + _j;\n var d = (_i + 1) * (segments + 1) + (_j + 1);\n\n // generate two faces (triangles) per iteration\n\n indices.push(a, b, d); // face one\n indices.push(b, c, d); // face two\n }\n }\n\n //\n\n geometry.setIndex(indices);\n geometry.setAttribute('position', new three__WEBPACK_IMPORTED_MODULE_4__.Float32BufferAttribute(vertices, 3));\n geometry.setAttribute('normal', new three__WEBPACK_IMPORTED_MODULE_4__.Float32BufferAttribute(normals, 3));\n geometry.setAttribute('color', new three__WEBPACK_IMPORTED_MODULE_4__.Float32BufferAttribute(colors, 3));\n var material = new three__WEBPACK_IMPORTED_MODULE_4__.MeshPhongMaterial({\n side: three__WEBPACK_IMPORTED_MODULE_4__.DoubleSide,\n vertexColors: true\n });\n var mesh = new three__WEBPACK_IMPORTED_MODULE_4__.Mesh(geometry, material);\n this.scene.add(mesh);\n // mesh = this.tb.Object3D({ obj: mesh, units: 'meters',anchor:'center'});\n // this.tb.add(mesh); \n // for(let line of lines){\n // this.createLine(line.coords,`rgba(${line.color.join(',')})`)\n // }\n }\n }, {\n key: \"createLine\",\n value: function createLine(path, color) {\n var line = this.tb.line({\n width: this.width,\n opacity: this.opacity,\n color: color,\n geometry: path\n });\n this.tb.add(line);\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n var container = map.getCanvas();\n var w = container.clientWidth;\n var h = container.clientHeight;\n this.camera = new three__WEBPACK_IMPORTED_MODULE_4__.PerspectiveCamera(map.transform.fov, w / h, 0.1, 1e21);\n this.scene = new three__WEBPACK_IMPORTED_MODULE_4__.Scene();\n this.scene.add(this.group);\n new _utils_CameraSync__WEBPACK_IMPORTED_MODULE_3__[\"default\"](this.map, this.camera, this.group);\n // let centerlngLat = map.getCenter()\n // let center = mapboxgl.MercatorCoordinate.fromLngLat(centerlngLat)\n // const scale = center.meterInMercatorCoordinateUnits();\n // //this.scale = scale;\n // let {x,y,z} = center;\n // const modelRotate = [Math.PI / 2, 0, 0];\n\n // cameraTransform = new THREE.Matrix4()\n // .makeTranslation(\n // x,\n // y,\n // z\n // )\n // .scale(\n // new THREE.Vector3(\n // scale,\n // -scale,\n // scale\n // )\n // )\n // .multiply( new THREE.Matrix4().makeRotationAxis(\n // new THREE.Vector3(1, 0, 0),\n // modelRotate[0]\n // ))\n // .multiply(new THREE.Matrix4().makeRotationAxis(\n // new THREE.Vector3(0, 1, 0),\n // modelRotate[1]\n // ))\n // .multiply(new THREE.Matrix4().makeRotationAxis(\n // new THREE.Vector3(0, 0, 1),\n // modelRotate[2]\n // ));\n // create two three.js lights to illuminate the model\n // let directionalLight = new THREE.DirectionalLight(0xffffff);\n // directionalLight.position.set(0, -70, 100).normalize();\n // this.scene.add(directionalLight);\n\n // let directionalLight2 = new THREE.DirectionalLight(0xffffff);\n // directionalLight2.position.set(0, 70, 100).normalize();\n // this.scene.add(directionalLight2); \n // this.tb = new Threebox(\n // map,\n // gl, //get the context from Mapbox\n // { defaultLights: true ,passiveRendering:false}\n // ); \n //this.scene.add(new THREE.AxesHelper(1000));\n this.renderer = new three__WEBPACK_IMPORTED_MODULE_4__.WebGLRenderer({\n canvas: map.getCanvas(),\n context: gl,\n antialias: true\n });\n this.renderer.outputEncoding = three__WEBPACK_IMPORTED_MODULE_4__.sRGBEncoding;\n this.renderer.autoClear = false;\n if (this.addedFun) this.addedFun();\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n //this.tb.update(); \n // const rotationX = new THREE.Matrix4().makeRotationAxis(\n // new THREE.Vector3(1, 0, 0),\n // modelTransform.rotateX\n // );\n // const rotationY = new THREE.Matrix4().makeRotationAxis(\n // new THREE.Vector3(0, 1, 0),\n // modelTransform.rotateY\n // );\n // const rotationZ = new THREE.Matrix4().makeRotationAxis(\n // new THREE.Vector3(0, 0, 1),\n // modelTransform.rotateZ\n // );\n\n // const m = new THREE.Matrix4().fromArray(matrix);\n // const l = new THREE.Matrix4()\n // .makeTranslation(\n // modelTransform.translateX,\n // modelTransform.translateY,\n // modelTransform.translateZ\n // )\n // .scale(\n // new THREE.Vector3(\n // modelTransform.scale,\n // -modelTransform.scale,\n // modelTransform.scale\n // )\n // )\n // .multiply(rotationX)\n // .multiply(rotationY)\n // .multiply(rotationZ);\n\n //this.camera.projectionMatrix = m.multiply(l);\n // var m = new THREE.Matrix4().fromArray(matrix);\n // this.camera.projectionMatrix = m.multiply(cameraTransform);;\n // this.renderer.resetState();\n\n this.renderer.render(this.scene, this.camera);\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/ThreeWallLayer.js?");
5281
5281
 
5282
5282
  /***/ }),
5283
5283