@ohuoy/easymap 1.0.16 → 1.0.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/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 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}();\n\n//# sourceURL=webpack://@ohuoy/easymap/./index.js?");
201
201
 
202
202
  /***/ }),
203
203
 
@@ -4661,7 +4661,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
4661
4661
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4662
4662
 
4663
4663
  "use strict";
4664
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EasyMap: () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.EasyMap),\n/* harmony export */ EffectComposer: () => (/* reexport safe */ three_examples_jsm_postprocessing_EffectComposer_js__WEBPACK_IMPORTED_MODULE_10__.EffectComposer),\n/* harmony export */ EmComponents: () => (/* reexport module object */ _src_components_index__WEBPACK_IMPORTED_MODULE_1__),\n/* harmony export */ EmUtils: () => (/* reexport module object */ _src_utils_util__WEBPACK_IMPORTED_MODULE_2__),\n/* harmony export */ FXAAShader: () => (/* reexport safe */ three_examples_jsm_shaders_FXAAShader_js__WEBPACK_IMPORTED_MODULE_15__.FXAAShader),\n/* harmony export */ GammaCorrectionShader: () => (/* reexport safe */ three_examples_jsm_shaders_GammaCorrectionShader_js__WEBPACK_IMPORTED_MODULE_16__.GammaCorrectionShader),\n/* harmony export */ Line2: () => (/* reexport safe */ three_addons_lines_Line2_js__WEBPACK_IMPORTED_MODULE_5__.Line2),\n/* harmony export */ LineGeometry: () => (/* reexport safe */ three_addons_lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_14__.LineGeometry),\n/* harmony export */ OrbitControls: () => (/* reexport safe */ three_addons_controls_OrbitControls_js__WEBPACK_IMPORTED_MODULE_6__.OrbitControls),\n/* harmony export */ OutlinePass: () => (/* reexport safe */ three_examples_jsm_postprocessing_OutlinePass_js__WEBPACK_IMPORTED_MODULE_13__.OutlinePass),\n/* harmony export */ RenderPass: () => (/* reexport safe */ three_examples_jsm_postprocessing_RenderPass_js__WEBPACK_IMPORTED_MODULE_11__.RenderPass),\n/* harmony export */ ShaderPass: () => (/* reexport safe */ three_examples_jsm_postprocessing_ShaderPass_js__WEBPACK_IMPORTED_MODULE_12__.ShaderPass),\n/* harmony export */ Three: () => (/* reexport module object */ three__WEBPACK_IMPORTED_MODULE_8__),\n/* harmony export */ TrackballControls: () => (/* reexport safe */ three_addons_controls_TrackballControls_js__WEBPACK_IMPORTED_MODULE_9__.TrackballControls),\n/* harmony export */ UnrealBloomPass: () => (/* reexport safe */ three_examples_jsm_postprocessing_UnrealBloomPass__WEBPACK_IMPORTED_MODULE_7__.UnrealBloomPass),\n/* harmony export */ ant7: () => (/* reexport module object */ _lib_antv_l7__WEBPACK_IMPORTED_MODULE_4__),\n/* harmony export */ mapboxgl: () => (/* reexport safe */ _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index */ \"./index.js\");\n/* harmony import */ var _src_components_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./src/components/index */ \"./src/components/index.js\");\n/* harmony import */ var _src_utils_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./src/utils/util */ \"./src/utils/util.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\");\n/* harmony import */ var _lib_antv_l7__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/@antv/l7 */ \"./lib/@antv/l7/es/index.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var three_addons_controls_TrackballControls_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! three/addons/controls/TrackballControls.js */ \"./node_modules/three/examples/jsm/controls/TrackballControls.js\");\n/* harmony import */ var three_addons_controls_OrbitControls_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! three/addons/controls/OrbitControls.js */ \"./node_modules/three/examples/jsm/controls/OrbitControls.js\");\n/* harmony import */ var three_examples_jsm_postprocessing_EffectComposer_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! three/examples/jsm/postprocessing/EffectComposer.js */ \"./node_modules/three/examples/jsm/postprocessing/EffectComposer.js\");\n/* harmony import */ var three_examples_jsm_postprocessing_RenderPass_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! three/examples/jsm/postprocessing/RenderPass.js */ \"./node_modules/three/examples/jsm/postprocessing/RenderPass.js\");\n/* harmony import */ var three_examples_jsm_postprocessing_ShaderPass_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! three/examples/jsm/postprocessing/ShaderPass.js */ \"./node_modules/three/examples/jsm/postprocessing/ShaderPass.js\");\n/* harmony import */ var three_examples_jsm_postprocessing_OutlinePass_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! three/examples/jsm/postprocessing/OutlinePass.js */ \"./node_modules/three/examples/jsm/postprocessing/OutlinePass.js\");\n/* harmony import */ var three_examples_jsm_shaders_FXAAShader_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! three/examples/jsm/shaders/FXAAShader.js */ \"./node_modules/three/examples/jsm/shaders/FXAAShader.js\");\n/* harmony import */ var three_examples_jsm_postprocessing_UnrealBloomPass__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! three/examples/jsm/postprocessing/UnrealBloomPass */ \"./node_modules/three/examples/jsm/postprocessing/UnrealBloomPass.js\");\n/* harmony import */ var three_addons_lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! three/addons/lines/LineGeometry.js */ \"./node_modules/three/examples/jsm/lines/LineGeometry.js\");\n/* harmony import */ var three_addons_lines_Line2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! three/addons/lines/Line2.js */ \"./node_modules/three/examples/jsm/lines/Line2.js\");\n/* harmony import */ var three_examples_jsm_shaders_GammaCorrectionShader_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! three/examples/jsm/shaders/GammaCorrectionShader.js */ \"./node_modules/three/examples/jsm/shaders/GammaCorrectionShader.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nwindow.EasyMap = _index__WEBPACK_IMPORTED_MODULE_0__.EasyMap;\nwindow.EmComponents = _src_components_index__WEBPACK_IMPORTED_MODULE_1__;\nwindow.EmUtils = _src_utils_util__WEBPACK_IMPORTED_MODULE_2__;\n// const modulesFiles = import.meta.glob('./src/components/*.js')\n// console.log(modulesFiles)\n// Object.entries(modulesFiles).forEach(a=>{\n// console.log(a)\n// })\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./main.js?");
4664
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EasyMap: () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.EasyMap),\n/* harmony export */ EffectComposer: () => (/* reexport safe */ three_examples_jsm_postprocessing_EffectComposer_js__WEBPACK_IMPORTED_MODULE_10__.EffectComposer),\n/* harmony export */ EmComponents: () => (/* reexport module object */ _src_components_index__WEBPACK_IMPORTED_MODULE_1__),\n/* harmony export */ EmUtils: () => (/* reexport module object */ _src_utils_util__WEBPACK_IMPORTED_MODULE_2__),\n/* harmony export */ FXAAShader: () => (/* reexport safe */ three_examples_jsm_shaders_FXAAShader_js__WEBPACK_IMPORTED_MODULE_17__.FXAAShader),\n/* harmony export */ FontLoader: () => (/* reexport safe */ three_addons_loaders_FontLoader_js__WEBPACK_IMPORTED_MODULE_16__.FontLoader),\n/* harmony export */ GammaCorrectionShader: () => (/* reexport safe */ three_examples_jsm_shaders_GammaCorrectionShader_js__WEBPACK_IMPORTED_MODULE_18__.GammaCorrectionShader),\n/* harmony export */ Line2: () => (/* reexport safe */ three_addons_lines_Line2_js__WEBPACK_IMPORTED_MODULE_5__.Line2),\n/* harmony export */ LineGeometry: () => (/* reexport safe */ three_addons_lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_14__.LineGeometry),\n/* harmony export */ LineMaterial: () => (/* reexport safe */ three_examples_jsm_lines_LineMaterial_js__WEBPACK_IMPORTED_MODULE_15__.LineMaterial),\n/* harmony export */ OrbitControls: () => (/* reexport safe */ three_addons_controls_OrbitControls_js__WEBPACK_IMPORTED_MODULE_6__.OrbitControls),\n/* harmony export */ OutlinePass: () => (/* reexport safe */ three_examples_jsm_postprocessing_OutlinePass_js__WEBPACK_IMPORTED_MODULE_13__.OutlinePass),\n/* harmony export */ RenderPass: () => (/* reexport safe */ three_examples_jsm_postprocessing_RenderPass_js__WEBPACK_IMPORTED_MODULE_11__.RenderPass),\n/* harmony export */ ShaderPass: () => (/* reexport safe */ three_examples_jsm_postprocessing_ShaderPass_js__WEBPACK_IMPORTED_MODULE_12__.ShaderPass),\n/* harmony export */ Three: () => (/* reexport module object */ three__WEBPACK_IMPORTED_MODULE_8__),\n/* harmony export */ TrackballControls: () => (/* reexport safe */ three_addons_controls_TrackballControls_js__WEBPACK_IMPORTED_MODULE_9__.TrackballControls),\n/* harmony export */ UnrealBloomPass: () => (/* reexport safe */ three_examples_jsm_postprocessing_UnrealBloomPass__WEBPACK_IMPORTED_MODULE_7__.UnrealBloomPass),\n/* harmony export */ ant7: () => (/* reexport module object */ _lib_antv_l7__WEBPACK_IMPORTED_MODULE_4__),\n/* harmony export */ mapboxgl: () => (/* reexport safe */ _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./index */ \"./index.js\");\n/* harmony import */ var _src_components_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./src/components/index */ \"./src/components/index.js\");\n/* harmony import */ var _src_utils_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./src/utils/util */ \"./src/utils/util.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\");\n/* harmony import */ var _lib_antv_l7__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./lib/@antv/l7 */ \"./lib/@antv/l7/es/index.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var three_addons_controls_TrackballControls_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! three/addons/controls/TrackballControls.js */ \"./node_modules/three/examples/jsm/controls/TrackballControls.js\");\n/* harmony import */ var three_addons_controls_OrbitControls_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! three/addons/controls/OrbitControls.js */ \"./node_modules/three/examples/jsm/controls/OrbitControls.js\");\n/* harmony import */ var three_examples_jsm_postprocessing_EffectComposer_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! three/examples/jsm/postprocessing/EffectComposer.js */ \"./node_modules/three/examples/jsm/postprocessing/EffectComposer.js\");\n/* harmony import */ var three_examples_jsm_postprocessing_RenderPass_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! three/examples/jsm/postprocessing/RenderPass.js */ \"./node_modules/three/examples/jsm/postprocessing/RenderPass.js\");\n/* harmony import */ var three_examples_jsm_postprocessing_ShaderPass_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! three/examples/jsm/postprocessing/ShaderPass.js */ \"./node_modules/three/examples/jsm/postprocessing/ShaderPass.js\");\n/* harmony import */ var three_examples_jsm_postprocessing_OutlinePass_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! three/examples/jsm/postprocessing/OutlinePass.js */ \"./node_modules/three/examples/jsm/postprocessing/OutlinePass.js\");\n/* harmony import */ var three_examples_jsm_shaders_FXAAShader_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! three/examples/jsm/shaders/FXAAShader.js */ \"./node_modules/three/examples/jsm/shaders/FXAAShader.js\");\n/* harmony import */ var three_examples_jsm_postprocessing_UnrealBloomPass__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! three/examples/jsm/postprocessing/UnrealBloomPass */ \"./node_modules/three/examples/jsm/postprocessing/UnrealBloomPass.js\");\n/* harmony import */ var three_addons_lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! three/addons/lines/LineGeometry.js */ \"./node_modules/three/examples/jsm/lines/LineGeometry.js\");\n/* harmony import */ var three_addons_lines_Line2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! three/addons/lines/Line2.js */ \"./node_modules/three/examples/jsm/lines/Line2.js\");\n/* harmony import */ var three_examples_jsm_lines_LineMaterial_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! three/examples/jsm/lines/LineMaterial.js */ \"./node_modules/three/examples/jsm/lines/LineMaterial.js\");\n/* harmony import */ var three_addons_loaders_FontLoader_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! three/addons/loaders/FontLoader.js */ \"./node_modules/three/examples/jsm/loaders/FontLoader.js\");\n/* harmony import */ var three_examples_jsm_shaders_GammaCorrectionShader_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! three/examples/jsm/shaders/GammaCorrectionShader.js */ \"./node_modules/three/examples/jsm/shaders/GammaCorrectionShader.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nwindow.EasyMap = _index__WEBPACK_IMPORTED_MODULE_0__.EasyMap;\nwindow.EmComponents = _src_components_index__WEBPACK_IMPORTED_MODULE_1__;\nwindow.EmUtils = _src_utils_util__WEBPACK_IMPORTED_MODULE_2__;\n// const modulesFiles = import.meta.glob('./src/components/*.js')\n// console.log(modulesFiles)\n// Object.entries(modulesFiles).forEach(a=>{\n// console.log(a)\n// })\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./main.js?");
4665
4665
 
4666
4666
  /***/ }),
4667
4667
 
@@ -4683,7 +4683,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
4683
4683
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4684
4684
 
4685
4685
  "use strict";
4686
- 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 this.drawEntity.changeMode('simple_select_rect');\n }\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/control/DrawBar.js?");
4686
+ 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?");
4687
4687
 
4688
4688
  /***/ }),
4689
4689
 
@@ -4705,7 +4705,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
4705
4705
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4706
4706
 
4707
4707
  "use strict";
4708
- 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;right: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?");
4708
+ 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?");
4709
4709
 
4710
4710
  /***/ }),
4711
4711
 
@@ -4716,7 +4716,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
4716
4716
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4717
4717
 
4718
4718
  "use strict";
4719
- 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;right: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 = [e.lngLat.lng, e.lngLat.lat];\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?");
4719
+ 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?");
4720
4720
 
4721
4721
  /***/ }),
4722
4722
 
@@ -4848,7 +4848,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
4848
4848
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4849
4849
 
4850
4850
  "use strict";
4851
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AlarmLayer: () => (/* reexport safe */ _layer_AlarmLayer__WEBPACK_IMPORTED_MODULE_4__[\"default\"]),\n/* harmony export */ AnimationBarbsLayer: () => (/* reexport safe */ _layer_AnimationBarbsLayer__WEBPACK_IMPORTED_MODULE_10__[\"default\"]),\n/* harmony export */ AnimationLayer: () => (/* reexport safe */ _layer_AnimationLayer__WEBPACK_IMPORTED_MODULE_6__[\"default\"]),\n/* harmony export */ CustomIconLayer: () => (/* reexport safe */ _layer_CustomIconLayer__WEBPACK_IMPORTED_MODULE_7__[\"default\"]),\n/* harmony export */ EasyMapMarker: () => (/* reexport safe */ _EasyMapMarker__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */ ExtrusionLayer: () => (/* reexport safe */ _layer_ExtrusionLayer__WEBPACK_IMPORTED_MODULE_12__[\"default\"]),\n/* harmony export */ LineTool: () => (/* reexport safe */ _control_Toobars__WEBPACK_IMPORTED_MODULE_1__[\"default\"]),\n/* harmony export */ PathLineLayer: () => (/* reexport safe */ _layer_PathLineLayer__WEBPACK_IMPORTED_MODULE_11__[\"default\"]),\n/* harmony export */ ScanLayer: () => (/* reexport safe */ _layer_ScanLayer__WEBPACK_IMPORTED_MODULE_2__[\"default\"]),\n/* harmony export */ TextLayer: () => (/* reexport safe */ _layer_TextLayer__WEBPACK_IMPORTED_MODULE_3__[\"default\"]),\n/* harmony export */ ThreeScanLayer: () => (/* reexport safe */ _layer_ThreeScanLayer__WEBPACK_IMPORTED_MODULE_8__[\"default\"]),\n/* harmony export */ ThreeWallLayer: () => (/* reexport safe */ _layer_ThreeWallLayer__WEBPACK_IMPORTED_MODULE_9__[\"default\"]),\n/* harmony export */ WallLayer: () => (/* reexport safe */ _layer_WallLayer__WEBPACK_IMPORTED_MODULE_5__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _EasyMapMarker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./EasyMapMarker */ \"./src/components/EasyMapMarker.js\");\n/* harmony import */ var _control_Toobars__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./control/Toobars */ \"./src/components/control/Toobars.js\");\n/* harmony import */ var _layer_ScanLayer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./layer/ScanLayer */ \"./src/components/layer/ScanLayer.js\");\n/* harmony import */ var _layer_TextLayer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./layer/TextLayer */ \"./src/components/layer/TextLayer.js\");\n/* harmony import */ var _layer_AlarmLayer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./layer/AlarmLayer */ \"./src/components/layer/AlarmLayer.js\");\n/* harmony import */ var _layer_WallLayer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./layer/WallLayer */ \"./src/components/layer/WallLayer.js\");\n/* harmony import */ var _layer_AnimationLayer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./layer/AnimationLayer */ \"./src/components/layer/AnimationLayer.js\");\n/* harmony import */ var _layer_CustomIconLayer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./layer/CustomIconLayer */ \"./src/components/layer/CustomIconLayer.js\");\n/* harmony import */ var _layer_ThreeScanLayer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./layer/ThreeScanLayer */ \"./src/components/layer/ThreeScanLayer.js\");\n/* harmony import */ var _layer_ThreeWallLayer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./layer/ThreeWallLayer */ \"./src/components/layer/ThreeWallLayer.js\");\n/* harmony import */ var _layer_AnimationBarbsLayer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./layer/AnimationBarbsLayer */ \"./src/components/layer/AnimationBarbsLayer.js\");\n/* harmony import */ var _layer_PathLineLayer__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./layer/PathLineLayer */ \"./src/components/layer/PathLineLayer.js\");\n/* harmony import */ var _layer_ExtrusionLayer__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./layer/ExtrusionLayer */ \"./src/components/layer/ExtrusionLayer.js\");\n\n\n//layer\n\n//control\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/index.js?");
4851
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AlarmLayer: () => (/* reexport safe */ _layer_AlarmLayer__WEBPACK_IMPORTED_MODULE_4__[\"default\"]),\n/* harmony export */ AnimationBarbsLayer: () => (/* reexport safe */ _layer_AnimationBarbsLayer__WEBPACK_IMPORTED_MODULE_10__[\"default\"]),\n/* harmony export */ AnimationLayer: () => (/* reexport safe */ _layer_AnimationLayer__WEBPACK_IMPORTED_MODULE_6__[\"default\"]),\n/* harmony export */ CustomIconLayer: () => (/* reexport safe */ _layer_CustomIconLayer__WEBPACK_IMPORTED_MODULE_7__[\"default\"]),\n/* harmony export */ EasyMapMarker: () => (/* reexport safe */ _EasyMapMarker__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */ ExtrusionLayer: () => (/* reexport safe */ _layer_ExtrusionLayer__WEBPACK_IMPORTED_MODULE_12__[\"default\"]),\n/* harmony export */ LineTool: () => (/* reexport safe */ _control_Toobars__WEBPACK_IMPORTED_MODULE_1__[\"default\"]),\n/* harmony export */ MarkerAreaLayer: () => (/* reexport safe */ _layer_MarkerAreaLayer__WEBPACK_IMPORTED_MODULE_13__[\"default\"]),\n/* harmony export */ PathLineLayer: () => (/* reexport safe */ _layer_PathLineLayer__WEBPACK_IMPORTED_MODULE_11__[\"default\"]),\n/* harmony export */ ScanLayer: () => (/* reexport safe */ _layer_ScanLayer__WEBPACK_IMPORTED_MODULE_2__[\"default\"]),\n/* harmony export */ TextLayer: () => (/* reexport safe */ _layer_TextLayer__WEBPACK_IMPORTED_MODULE_3__[\"default\"]),\n/* harmony export */ ThreeScanLayer: () => (/* reexport safe */ _layer_ThreeScanLayer__WEBPACK_IMPORTED_MODULE_8__[\"default\"]),\n/* harmony export */ ThreeWallLayer: () => (/* reexport safe */ _layer_ThreeWallLayer__WEBPACK_IMPORTED_MODULE_9__[\"default\"]),\n/* harmony export */ WallLayer: () => (/* reexport safe */ _layer_WallLayer__WEBPACK_IMPORTED_MODULE_5__[\"default\"])\n/* harmony export */ });\n/* harmony import */ var _EasyMapMarker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./EasyMapMarker */ \"./src/components/EasyMapMarker.js\");\n/* harmony import */ var _control_Toobars__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./control/Toobars */ \"./src/components/control/Toobars.js\");\n/* harmony import */ var _layer_ScanLayer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./layer/ScanLayer */ \"./src/components/layer/ScanLayer.js\");\n/* harmony import */ var _layer_TextLayer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./layer/TextLayer */ \"./src/components/layer/TextLayer.js\");\n/* harmony import */ var _layer_AlarmLayer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./layer/AlarmLayer */ \"./src/components/layer/AlarmLayer.js\");\n/* harmony import */ var _layer_WallLayer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./layer/WallLayer */ \"./src/components/layer/WallLayer.js\");\n/* harmony import */ var _layer_AnimationLayer__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./layer/AnimationLayer */ \"./src/components/layer/AnimationLayer.js\");\n/* harmony import */ var _layer_CustomIconLayer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./layer/CustomIconLayer */ \"./src/components/layer/CustomIconLayer.js\");\n/* harmony import */ var _layer_ThreeScanLayer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./layer/ThreeScanLayer */ \"./src/components/layer/ThreeScanLayer.js\");\n/* harmony import */ var _layer_ThreeWallLayer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./layer/ThreeWallLayer */ \"./src/components/layer/ThreeWallLayer.js\");\n/* harmony import */ var _layer_AnimationBarbsLayer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./layer/AnimationBarbsLayer */ \"./src/components/layer/AnimationBarbsLayer.js\");\n/* harmony import */ var _layer_PathLineLayer__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./layer/PathLineLayer */ \"./src/components/layer/PathLineLayer.js\");\n/* harmony import */ var _layer_ExtrusionLayer__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./layer/ExtrusionLayer */ \"./src/components/layer/ExtrusionLayer.js\");\n/* harmony import */ var _layer_MarkerAreaLayer__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./layer/MarkerAreaLayer */ \"./src/components/layer/MarkerAreaLayer.js\");\n\n\n//layer\n\n//control\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/index.js?");
4852
4852
 
4853
4853
  /***/ }),
4854
4854
 
@@ -4892,7 +4892,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
4892
4892
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4893
4893
 
4894
4894
  "use strict";
4895
- 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 threebox_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! threebox-plugin */ \"./node_modules/threebox-plugin/main.js\");\n/* harmony import */ var threebox_plugin__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(threebox_plugin__WEBPACK_IMPORTED_MODULE_0__);\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 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) {\n a.circle.label.element.children[0].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) {\n a.circle.label.element.children[0].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?");
4895
+ 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 threebox_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! threebox-plugin */ \"./node_modules/threebox-plugin/main.js\");\n/* harmony import */ var threebox_plugin__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(threebox_plugin__WEBPACK_IMPORTED_MODULE_0__);\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 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?");
4896
4896
 
4897
4897
  /***/ }),
4898
4898
 
@@ -4907,6 +4907,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
4907
4907
 
4908
4908
  /***/ }),
4909
4909
 
4910
+ /***/ "./src/components/layer/MarkerAreaLayer.js":
4911
+ /*!*************************************************!*\
4912
+ !*** ./src/components/layer/MarkerAreaLayer.js ***!
4913
+ \*************************************************/
4914
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4915
+
4916
+ "use strict";
4917
+ 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 threebox_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! threebox-plugin */ \"./node_modules/threebox-plugin/main.js\");\n/* harmony import */ var threebox_plugin__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(threebox_plugin__WEBPACK_IMPORTED_MODULE_2__);\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 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?");
4918
+
4919
+ /***/ }),
4920
+
4910
4921
  /***/ "./src/components/layer/PathLineLayer.js":
4911
4922
  /*!***********************************************!*\
4912
4923
  !*** ./src/components/layer/PathLineLayer.js ***!
@@ -4947,7 +4958,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
4947
4958
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4948
4959
 
4949
4960
  "use strict";
4950
- 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 threebox_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! threebox-plugin */ \"./node_modules/threebox-plugin/main.js\");\n/* harmony import */ var threebox_plugin__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(threebox_plugin__WEBPACK_IMPORTED_MODULE_2__);\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\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 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 }\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 _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 return _context2.abrupt(\"return\", this.map.getCanvas().toDataURL());\n case 21:\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: \"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: \"update\",\n value: function () {\n var _update = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(point) {\n var texture, _w, dep, p, index, _point, 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 (!point.image) {\n _context3.next = 8;\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 = 13;\n break;\n case 8:\n if (!point.url) {\n _context3.next = 13;\n break;\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 = 12;\n return p();\n case 12:\n texture = _context3.sent;\n case 13:\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 _point.mesh.model.material.map = texture;\n _point.mesh.label.element.innerHTML = point.text;\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__.MeshPhongMaterial({\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 }\n case 17:\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 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?");
4961
+ 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 threebox_plugin__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! threebox-plugin */ \"./node_modules/threebox-plugin/main.js\");\n/* harmony import */ var threebox_plugin__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(threebox_plugin__WEBPACK_IMPORTED_MODULE_2__);\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\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 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 _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 return _context2.abrupt(\"return\", this.map.getCanvas().toDataURL());\n case 21:\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: \"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;\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 = 15;\n break;\n case 9:\n if (!point.url) {\n _context3.next = 15;\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 case 15:\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 (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 } 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__.MeshPhongMaterial({\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 }\n case 19:\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 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?");
4951
4962
 
4952
4963
  /***/ }),
4953
4964
 
@@ -13873,6 +13884,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
13873
13884
 
13874
13885
  /***/ }),
13875
13886
 
13887
+ /***/ "./node_modules/three/examples/jsm/loaders/FontLoader.js":
13888
+ /*!***************************************************************!*\
13889
+ !*** ./node_modules/three/examples/jsm/loaders/FontLoader.js ***!
13890
+ \***************************************************************/
13891
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13892
+
13893
+ "use strict";
13894
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Font: () => (/* binding */ Font),\n/* harmony export */ FontLoader: () => (/* binding */ FontLoader)\n/* harmony export */ });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\n\nclass FontLoader extends three__WEBPACK_IMPORTED_MODULE_0__.Loader {\n\n\tconstructor( manager ) {\n\n\t\tsuper( manager );\n\n\t}\n\n\tload( url, onLoad, onProgress, onError ) {\n\n\t\tconst scope = this;\n\n\t\tconst loader = new three__WEBPACK_IMPORTED_MODULE_0__.FileLoader( this.manager );\n\t\tloader.setPath( this.path );\n\t\tloader.setRequestHeader( this.requestHeader );\n\t\tloader.setWithCredentials( this.withCredentials );\n\t\tloader.load( url, function ( text ) {\n\n\t\t\tconst font = scope.parse( JSON.parse( text ) );\n\n\t\t\tif ( onLoad ) onLoad( font );\n\n\t\t}, onProgress, onError );\n\n\t}\n\n\tparse( json ) {\n\n\t\treturn new Font( json );\n\n\t}\n\n}\n\n//\n\nclass Font {\n\n\tconstructor( data ) {\n\n\t\tthis.isFont = true;\n\n\t\tthis.type = 'Font';\n\n\t\tthis.data = data;\n\n\t}\n\n\tgenerateShapes( text, size = 100 ) {\n\n\t\tconst shapes = [];\n\t\tconst paths = createPaths( text, size, this.data );\n\n\t\tfor ( let p = 0, pl = paths.length; p < pl; p ++ ) {\n\n\t\t\tshapes.push( ...paths[ p ].toShapes() );\n\n\t\t}\n\n\t\treturn shapes;\n\n\t}\n\n}\n\nfunction createPaths( text, size, data ) {\n\n\tconst chars = Array.from( text );\n\tconst scale = size / data.resolution;\n\tconst line_height = ( data.boundingBox.yMax - data.boundingBox.yMin + data.underlineThickness ) * scale;\n\n\tconst paths = [];\n\n\tlet offsetX = 0, offsetY = 0;\n\n\tfor ( let i = 0; i < chars.length; i ++ ) {\n\n\t\tconst char = chars[ i ];\n\n\t\tif ( char === '\\n' ) {\n\n\t\t\toffsetX = 0;\n\t\t\toffsetY -= line_height;\n\n\t\t} else {\n\n\t\t\tconst ret = createPath( char, scale, offsetX, offsetY, data );\n\t\t\toffsetX += ret.offsetX;\n\t\t\tpaths.push( ret.path );\n\n\t\t}\n\n\t}\n\n\treturn paths;\n\n}\n\nfunction createPath( char, scale, offsetX, offsetY, data ) {\n\n\tconst glyph = data.glyphs[ char ] || data.glyphs[ '?' ];\n\n\tif ( ! glyph ) {\n\n\t\tconsole.error( 'THREE.Font: character \"' + char + '\" does not exists in font family ' + data.familyName + '.' );\n\n\t\treturn;\n\n\t}\n\n\tconst path = new three__WEBPACK_IMPORTED_MODULE_0__.ShapePath();\n\n\tlet x, y, cpx, cpy, cpx1, cpy1, cpx2, cpy2;\n\n\tif ( glyph.o ) {\n\n\t\tconst outline = glyph._cachedOutline || ( glyph._cachedOutline = glyph.o.split( ' ' ) );\n\n\t\tfor ( let i = 0, l = outline.length; i < l; ) {\n\n\t\t\tconst action = outline[ i ++ ];\n\n\t\t\tswitch ( action ) {\n\n\t\t\t\tcase 'm': // moveTo\n\n\t\t\t\t\tx = outline[ i ++ ] * scale + offsetX;\n\t\t\t\t\ty = outline[ i ++ ] * scale + offsetY;\n\n\t\t\t\t\tpath.moveTo( x, y );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'l': // lineTo\n\n\t\t\t\t\tx = outline[ i ++ ] * scale + offsetX;\n\t\t\t\t\ty = outline[ i ++ ] * scale + offsetY;\n\n\t\t\t\t\tpath.lineTo( x, y );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'q': // quadraticCurveTo\n\n\t\t\t\t\tcpx = outline[ i ++ ] * scale + offsetX;\n\t\t\t\t\tcpy = outline[ i ++ ] * scale + offsetY;\n\t\t\t\t\tcpx1 = outline[ i ++ ] * scale + offsetX;\n\t\t\t\t\tcpy1 = outline[ i ++ ] * scale + offsetY;\n\n\t\t\t\t\tpath.quadraticCurveTo( cpx1, cpy1, cpx, cpy );\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'b': // bezierCurveTo\n\n\t\t\t\t\tcpx = outline[ i ++ ] * scale + offsetX;\n\t\t\t\t\tcpy = outline[ i ++ ] * scale + offsetY;\n\t\t\t\t\tcpx1 = outline[ i ++ ] * scale + offsetX;\n\t\t\t\t\tcpy1 = outline[ i ++ ] * scale + offsetY;\n\t\t\t\t\tcpx2 = outline[ i ++ ] * scale + offsetX;\n\t\t\t\t\tcpy2 = outline[ i ++ ] * scale + offsetY;\n\n\t\t\t\t\tpath.bezierCurveTo( cpx1, cpy1, cpx2, cpy2, cpx, cpy );\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\treturn { offsetX: glyph.ha * scale, path: path };\n\n}\n\n\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./node_modules/three/examples/jsm/loaders/FontLoader.js?");
13895
+
13896
+ /***/ }),
13897
+
13876
13898
  /***/ "./node_modules/three/examples/jsm/postprocessing/EffectComposer.js":
13877
13899
  /*!**************************************************************************!*\
13878
13900
  !*** ./node_modules/three/examples/jsm/postprocessing/EffectComposer.js ***!