@ohuoy/easymap 1.0.12 → 1.0.13

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.js */ \"./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 _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//导出组件\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, _target) {\n var target;\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 (!_target) target = document.createElement('div');else target = _target;\n var pix = 1024;\n target.style = \"width:\".concat(pix, \"px;height:\").concat(pix, \"px;\");\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: (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)([114.7198975, 23.0446]),\n bounds: [bounds[0], bounds[2]],\n container: target,\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 var base64 = map._canvas.toDataURL();\n (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.downloadFileByBase64)(base64, (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.guid)());\n target.remove();\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(_ref) {\n var _ref$center = _ref.center,\n center = _ref$center === void 0 ? (0,_src_utils_util_js__WEBPACK_IMPORTED_MODULE_5__.transform)(this.config.center) : _ref$center,\n _ref$zoom = _ref.zoom,\n zoom = _ref$zoom === void 0 ? this.config.zoom : _ref$zoom,\n _ref$pitch = _ref.pitch,\n pitch = _ref$pitch === void 0 ? this.config.pitch : _ref$pitch,\n _ref$bearing = _ref.bearing,\n bearing = _ref$bearing === void 0 ? this.config.bearing : _ref$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 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 */ 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 */ Three: () => (/* reexport module object */ three__WEBPACK_IMPORTED_MODULE_5__),\n/* harmony export */ TrackballControls: () => (/* reexport safe */ three_addons_controls_TrackballControls_js__WEBPACK_IMPORTED_MODULE_6__.TrackballControls),\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_5__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var three_addons_controls_TrackballControls_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! three/addons/controls/TrackballControls.js */ \"./node_modules/three/examples/jsm/controls/TrackballControls.js\");\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_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?");
4665
4665
 
4666
4666
  /***/ }),
4667
4667
 
@@ -4870,7 +4870,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
4870
4870
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4871
4871
 
4872
4872
  "use strict";
4873
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ AnimationLayer)\n/* harmony export */ });\n/* harmony import */ var _utils_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/util.js */ \"./src/utils/util.js\");\n/* harmony import */ var mapbox_gl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mapbox-gl */ \"./lib/mapbox-gl/dist/mapbox-gl.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__);\n/* harmony import */ var _utils_barbsHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/barbsHelper.js */ \"./src/utils/barbsHelper.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\n\n\nvar tb = {};\nvar actionStatus = {\n Play: 0,\n Stop: 1,\n Pause: 2\n};\nvar AnimationLayer = /*#__PURE__*/function () {\n function AnimationLayer(id, config) {\n var _this = this;\n _classCallCheck(this, AnimationLayer);\n //当前帧率\n _defineProperty(this, \"timerId\", void 0);\n _defineProperty(this, \"speed\", 1);\n //帧\n _defineProperty(this, \"itemList\", []);\n _defineProperty(this, \"barbsList\", []);\n _defineProperty(this, \"opacity\", 0.8);\n _defineProperty(this, \"meshList\", {});\n _defineProperty(this, \"status\", actionStatus.Pause);\n _defineProperty(this, \"current\", 0);\n _defineProperty(this, \"textClass\", '');\n _defineProperty(this, \"progress\", {\n value: 0\n });\n _defineProperty(this, \"getProgress\", function () {});\n _defineProperty(this, \"setProgress\", function () {});\n var _config = {\n speed: 1,\n item: {},\n opacity: 0.8,\n getProgress: this.getProgress,\n setProgress: this.setProgress(),\n textClass: ''\n };\n config = Object.assign({}, _config, config);\n this.id = id;\n this.type = 'custom';\n this.renderingMode = '2d';\n this.speed = config.speed;\n this.opacity = config.opacity;\n this.getProgress = config.getProgress;\n this.setProgress = config.setProgress;\n this.progress = new Proxy(this.progress, {\n set: function set(target, property, value) {\n target[property] = value;\n _this.setCurrent(Math.floor(_this.itemList.length * value));\n return true;\n },\n get: function get(target, prop) {\n target[prop] = !isNaN(_this.current / _this.itemList.length) ? _this.current / (_this.itemList.length - 1) : 0;\n return target[prop];\n }\n });\n this.createBarbsMesh();\n // this.timerId = setInterval(()=>this.getTick(),1000)\n }\n return _createClass(AnimationLayer, [{\n key: \"destory\",\n value: function destory() {\n delete this;\n }\n }, {\n key: \"createBarbsMesh\",\n value: function createBarbsMesh() {\n for (var i = 0; i < 12; i++) {\n var pathBarbs = (0,_utils_barbsHelper_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(i);\n this.barbsList[i] = {\n color: pathBarbs.color,\n shape: new three__WEBPACK_IMPORTED_MODULE_4__.ShapePath()\n };\n for (var j in pathBarbs.path) {\n if (j == 0) {\n var _this$barbsList$i$sha;\n (_this$barbsList$i$sha = this.barbsList[i].shape).moveTo.apply(_this$barbsList$i$sha, _toConsumableArray(pathBarbs.path[j]));\n } else {\n var _this$barbsList$i$sha2;\n (_this$barbsList$i$sha2 = this.barbsList[i].shape).lineTo.apply(_this$barbsList$i$sha2, _toConsumableArray(pathBarbs.path[j]));\n }\n // let x = 0 ,y = 0; \n // this.barbsList[i].shape.moveTo( x + 5, y + 5 );\n // this.barbsList[i].shape.bezierCurveTo( x + 5, y + 5, x + 4, y, x, y );\n // this.barbsList[i].shape.bezierCurveTo( x - 6, y, x - 6, y + 7,x - 6, y + 7 );\n // this.barbsList[i].shape.bezierCurveTo( x - 6, y + 11, x - 3, y + 15.4, x + 5, y + 19 );\n // this.barbsList[i].shape.bezierCurveTo( x + 12, y + 15.4, x + 16, y + 11, x + 16, y + 7 );\n // this.barbsList[i].shape.bezierCurveTo( x + 16, y + 7, x + 16, y, x + 10, y );\n // this.barbsList[i].shape.bezierCurveTo( x + 7, y, x + 5, y + 5, x + 5, y + 5 );\n }\n }\n }\n\n //创建图片纹理\n }, {\n key: \"init\",\n value: function init(list) {\n this.remove();\n //重置状态\n this.current = 0;\n this.actionStatus = 0;\n this.itemList = list;\n // item.imageList.forEach(async _item => {\n // let texture = new THREE.TextureLoader().load(\n // _item.image);\n // texture.encoding = THREE.sRGBEncoding;\n // texture.flipY = false;\n // this.itemList.push({\n // texture:texture,\n // item:_item\n // }) \n // })\n if (this.itemList.length == 0) {\n return;\n }\n //this.obj = this.loadMesh()\n }\n }, {\n key: \"remove\",\n value: function remove() {\n for (var i in this.meshList) {\n this.tb.remove(this.meshList[i]);\n delete this.meshList[i];\n }\n }\n }, {\n key: \"createMesh\",\n value: function createMesh(id, center) {\n // 创建几何体\n var geometry = new three__WEBPACK_IMPORTED_MODULE_4__.ShapeGeometry();\n // 创建材质\n var material = new three__WEBPACK_IMPORTED_MODULE_4__.MeshBasicMaterial({\n color: 0xffffff\n });\n // 创建网格\n var mesh = new three__WEBPACK_IMPORTED_MODULE_4__.Mesh(geometry, material);\n mesh = tb.Object3D({\n obj: mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n // 将网格添加到场景中\n // scene.add(mesh);\n mesh.setCoords((0,_utils_util_js__WEBPACK_IMPORTED_MODULE_0__.transform)(center));\n tb.renderer.outputEncoding = three__WEBPACK_IMPORTED_MODULE_4__.sRGBEncoding;\n tb.add(mesh);\n this.meshList[id] = mesh;\n // let texture = this.itemList[0].texture\n // let _item = this.itemList[0].item;\n // let geometry = new THREE.PlaneGeometry(_item.width *20,_item.width*20); \n // //geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));\n // let material = new THREE.MeshPhongMaterial({ \n // map:texture, \n // opacity:this.opacity, \n // transparent: true,\n // });\n // material.color.convertSRGBToLinear();\n // let mesh = new THREE.Mesh(geometry, material);\n // mesh.name = 'scanimg'\n // mesh = tb.Object3D({ obj: mesh, units: 'meters',fixedZoom :15 ,anchor:'center'});\n // mesh.setCoords( transform(_item.center));\n // tb.renderer.outputEncoding = THREE.sRGBEncoding;\n // tb.add(mesh); \n // let dom =document.createElement('div') \n // mesh.addLabel(dom,true,{x:mesh.anchor.x,y:mesh.anchor.y+_item.distance *1200,z:mesh.anchor.z},0)\n // mesh.label.element.className += ('' +this.textClass)\n // mesh.label.element.style.fontSize = '24px' \n // return mesh;\n }\n }, {\n key: \"pause\",\n value: function pause() {\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.status = actionStatus.Stop;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"setCurrent\",\n value: function setCurrent(index) {\n if (index < this.itemList.length) {\n this.current = index;\n this.animate();\n } else {\n return;\n }\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"next\",\n value: function next() {\n if (this.current + 1 >= this.itemList.length) {\n return 0;\n }\n this.status = actionStatus.Pause;\n this.current++;\n this.animate();\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"previous\",\n value: function previous() {\n if (this.current - 1 < 0) {\n return 0;\n }\n this.status = actionStatus.Pause;\n this.current--;\n this.animate();\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"createInterval\",\n value: function createInterval() {\n var _this2 = this;\n if (this.timerId) {\n clearInterval(this.timerId);\n }\n this.timerId = setInterval(function () {\n if (_this2.status == actionStatus.Play && _this2.itemList.length > 0) {\n if (_this2.current >= _this2.itemList.length) {\n _this2.current = 0;\n _this2.animate();\n _this2.status = actionStatus.Pause;\n _this2.getProgress(_this2.progress.value, _this2.status, _this2.itemList[_this2.current].time);\n } else {\n _this2.animate();\n _this2.getProgress(_this2.progress.value, _this2.status, _this2.itemList[_this2.current].time);\n _this2.current++;\n }\n }\n }, 1000 / this.speed);\n }\n }, {\n key: \"replay\",\n value: function replay() {\n this.current = 0;\n this.status = actionStatus.Play;\n if (this.itemList.length == 0) {\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n return 0;\n }\n }\n }, {\n key: \"play\",\n value: function play() {\n //获取帧率\n //await this.getTick();\n //this.starttime = new Date().getTime() \n this.status = actionStatus.Play;\n if (this.itemList.length == 0) {\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n return 0;\n }\n }\n }, {\n key: \"getLevel\",\n value: function getLevel(speed) {\n speed = Math.round(speed);\n speed = speed > 24 ? 24 : speed;\n var level = 0;\n // if(speed <= 1 ){\n // color = '#bd1084'\n // }else \n speed = speed < 2 ? 2 : speed;\n if (speed <= 3) {} else if (speed > 3 && speed <= 5) {\n level = 1;\n } else if (speed > 5 && speed <= 7) {\n level = 2;\n } else if (speed > 7 && speed <= 9) {\n level = 3;\n } else if (speed > 9 && speed <= 11) {\n level = 4;\n } else if (speed > 11 && speed <= 13) {\n level = 5;\n } else if (speed > 13 && speed <= 15) {\n level = 6;\n } else if (speed > 15 && speed <= 17) {\n level = 7;\n } else if (speed > 17 && speed <= 19) {\n level = 8;\n } else if (speed > 19 && speed <= 21) {\n level = 9;\n } else if (speed > 21 && speed <= 23) {\n level = 10;\n } else if (speed > 23) {\n level = 11;\n }\n return level;\n }\n }, {\n key: \"animate\",\n value: function animate() {\n // this.obj.model.material.map = this.itemList[this.current].texture\n var _item = this.itemList[this.current];\n for (var i in _item.data) {\n if (!this.meshList[_item.data[i].id]) {\n this.createMesh(_item.data[i].id, _item.data[i].center);\n }\n if (_item.data[i].speed) {\n var color = new three__WEBPACK_IMPORTED_MODULE_4__.Color();\n var level = this.getLevel(_item.data[i].speed);\n var shapeItemInfo = this.barbsList[level];\n var _color = color.set(shapeItemInfo.color);\n var mesh = new three__WEBPACK_IMPORTED_MODULE_4__.Mesh(new three__WEBPACK_IMPORTED_MODULE_4__.ShapeGeometry(shapeItemInfo.shape.toShapes()[0]), this.meshList[_item.data[i].id].model.material);\n mesh = tb.Object3D({\n obj: mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n mesh.setCoords((0,_utils_util_js__WEBPACK_IMPORTED_MODULE_0__.transform)(_item.data[i].center));\n this.meshList[_item.data[i].id].model.geometry = mesh.model.geometry;\n this.meshList[_item.data[i].id].model.material.color = _color;\n tb.update();\n this.map.triggerRepaint();\n }\n //console.log(this.meshList[_item.data[i].id].model.geometry,mesh) \n // console.log(this.meshList[_item.data[i].id].model.material.color)\n //console.log(this.meshList[_item.data[i].id].model) \n }\n // this.obj.label.element.innerHTML = _item.text\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n if (this.timerId) {\n clearInterval(this.timerId);\n }\n this.destory();\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n tb = new threebox_plugin__WEBPACK_IMPORTED_MODULE_2__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true,\n passiveRendering: false\n });\n this.createInterval();\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n tb.update();\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/AnimationBarbsLayer.js?");
4873
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ AnimationLayer)\n/* harmony export */ });\n/* harmony import */ var _utils_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/util.js */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\n/* harmony import */ var 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__);\n/* harmony import */ var _utils_barbsHelper_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/barbsHelper.js */ \"./src/utils/barbsHelper.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\n\n\nvar tb = {};\nvar actionStatus = {\n Play: 0,\n Stop: 1,\n Pause: 2\n};\nvar AnimationLayer = /*#__PURE__*/function () {\n function AnimationLayer(id, config) {\n var _this = this;\n _classCallCheck(this, AnimationLayer);\n //当前帧率\n _defineProperty(this, \"timerId\", void 0);\n _defineProperty(this, \"speed\", 1);\n //帧\n _defineProperty(this, \"itemList\", []);\n _defineProperty(this, \"barbsList\", []);\n _defineProperty(this, \"opacity\", 0.8);\n _defineProperty(this, \"meshList\", {});\n _defineProperty(this, \"status\", actionStatus.Pause);\n _defineProperty(this, \"current\", 0);\n _defineProperty(this, \"textClass\", '');\n _defineProperty(this, \"progress\", {\n value: 0\n });\n _defineProperty(this, \"getProgress\", function () {});\n _defineProperty(this, \"setProgress\", function () {});\n var _config = {\n speed: 1,\n item: {},\n opacity: 0.8,\n getProgress: this.getProgress,\n setProgress: this.setProgress(),\n textClass: ''\n };\n config = Object.assign({}, _config, config);\n this.id = id;\n this.type = 'custom';\n this.renderingMode = '2d';\n this.speed = config.speed;\n this.opacity = config.opacity;\n this.getProgress = config.getProgress;\n this.setProgress = config.setProgress;\n this.progress = new Proxy(this.progress, {\n set: function set(target, property, value) {\n target[property] = value;\n _this.setCurrent(Math.floor(_this.itemList.length * value));\n return true;\n },\n get: function get(target, prop) {\n target[prop] = !isNaN(_this.current / _this.itemList.length) ? _this.current / (_this.itemList.length - 1) : 0;\n return target[prop];\n }\n });\n this.createBarbsMesh();\n // this.timerId = setInterval(()=>this.getTick(),1000)\n }\n return _createClass(AnimationLayer, [{\n key: \"destory\",\n value: function destory() {\n delete this;\n }\n }, {\n key: \"createBarbsMesh\",\n value: function createBarbsMesh() {\n for (var i = 0; i < 12; i++) {\n var pathBarbs = (0,_utils_barbsHelper_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(i);\n this.barbsList[i] = {\n color: pathBarbs.color,\n shape: new three__WEBPACK_IMPORTED_MODULE_4__.ShapePath()\n };\n for (var j in pathBarbs.path) {\n if (j == 0) {\n var _this$barbsList$i$sha;\n (_this$barbsList$i$sha = this.barbsList[i].shape).moveTo.apply(_this$barbsList$i$sha, _toConsumableArray(pathBarbs.path[j]));\n } else {\n var _this$barbsList$i$sha2;\n (_this$barbsList$i$sha2 = this.barbsList[i].shape).lineTo.apply(_this$barbsList$i$sha2, _toConsumableArray(pathBarbs.path[j]));\n }\n // let x = 0 ,y = 0; \n // this.barbsList[i].shape.moveTo( x + 5, y + 5 );\n // this.barbsList[i].shape.bezierCurveTo( x + 5, y + 5, x + 4, y, x, y );\n // this.barbsList[i].shape.bezierCurveTo( x - 6, y, x - 6, y + 7,x - 6, y + 7 );\n // this.barbsList[i].shape.bezierCurveTo( x - 6, y + 11, x - 3, y + 15.4, x + 5, y + 19 );\n // this.barbsList[i].shape.bezierCurveTo( x + 12, y + 15.4, x + 16, y + 11, x + 16, y + 7 );\n // this.barbsList[i].shape.bezierCurveTo( x + 16, y + 7, x + 16, y, x + 10, y );\n // this.barbsList[i].shape.bezierCurveTo( x + 7, y, x + 5, y + 5, x + 5, y + 5 );\n }\n }\n }\n\n //创建图片纹理\n }, {\n key: \"init\",\n value: function init(list) {\n this.remove();\n //重置状态\n this.current = 0;\n this.actionStatus = 0;\n this.itemList = list;\n // item.imageList.forEach(async _item => {\n // let texture = new THREE.TextureLoader().load(\n // _item.image);\n // texture.encoding = THREE.sRGBEncoding;\n // texture.flipY = false;\n // this.itemList.push({\n // texture:texture,\n // item:_item\n // }) \n // })\n if (this.itemList.length == 0) {\n return;\n }\n //this.obj = this.loadMesh()\n }\n }, {\n key: \"remove\",\n value: function remove() {\n for (var i in this.meshList) {\n this.tb.remove(this.meshList[i]);\n delete this.meshList[i];\n }\n }\n }, {\n key: \"createMesh\",\n value: function createMesh(id, center) {\n // 创建几何体\n var geometry = new three__WEBPACK_IMPORTED_MODULE_4__.ShapeGeometry();\n // 创建材质\n var material = new three__WEBPACK_IMPORTED_MODULE_4__.MeshBasicMaterial({\n color: 0xffffff\n });\n // 创建网格\n var mesh = new three__WEBPACK_IMPORTED_MODULE_4__.Mesh(geometry, material);\n mesh = tb.Object3D({\n obj: mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n // 将网格添加到场景中\n // scene.add(mesh);\n mesh.setCoords((0,_utils_util_js__WEBPACK_IMPORTED_MODULE_0__.transform)(center));\n tb.renderer.outputEncoding = three__WEBPACK_IMPORTED_MODULE_4__.sRGBEncoding;\n tb.add(mesh);\n this.meshList[id] = mesh;\n // let texture = this.itemList[0].texture\n // let _item = this.itemList[0].item;\n // let geometry = new THREE.PlaneGeometry(_item.width *20,_item.width*20); \n // //geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));\n // let material = new THREE.MeshPhongMaterial({ \n // map:texture, \n // opacity:this.opacity, \n // transparent: true,\n // });\n // material.color.convertSRGBToLinear();\n // let mesh = new THREE.Mesh(geometry, material);\n // mesh.name = 'scanimg'\n // mesh = tb.Object3D({ obj: mesh, units: 'meters',fixedZoom :15 ,anchor:'center'});\n // mesh.setCoords( transform(_item.center));\n // tb.renderer.outputEncoding = THREE.sRGBEncoding;\n // tb.add(mesh); \n // let dom =document.createElement('div') \n // mesh.addLabel(dom,true,{x:mesh.anchor.x,y:mesh.anchor.y+_item.distance *1200,z:mesh.anchor.z},0)\n // mesh.label.element.className += ('' +this.textClass)\n // mesh.label.element.style.fontSize = '24px' \n // return mesh;\n }\n }, {\n key: \"pause\",\n value: function pause() {\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"stop\",\n value: function stop() {\n this.status = actionStatus.Stop;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"setCurrent\",\n value: function setCurrent(index) {\n if (index < this.itemList.length) {\n this.current = index;\n this.animate();\n } else {\n return;\n }\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"next\",\n value: function next() {\n if (this.current + 1 >= this.itemList.length) {\n return 0;\n }\n this.status = actionStatus.Pause;\n this.current++;\n this.animate();\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"previous\",\n value: function previous() {\n if (this.current - 1 < 0) {\n return 0;\n }\n this.status = actionStatus.Pause;\n this.current--;\n this.animate();\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n }\n }, {\n key: \"createInterval\",\n value: function createInterval() {\n var _this2 = this;\n if (this.timerId) {\n clearInterval(this.timerId);\n }\n this.timerId = setInterval(function () {\n if (_this2.status == actionStatus.Play && _this2.itemList.length > 0) {\n if (_this2.current >= _this2.itemList.length) {\n _this2.current = 0;\n _this2.animate();\n _this2.status = actionStatus.Pause;\n _this2.getProgress(_this2.progress.value, _this2.status, _this2.itemList[_this2.current].time);\n } else {\n _this2.animate();\n _this2.getProgress(_this2.progress.value, _this2.status, _this2.itemList[_this2.current].time);\n _this2.current++;\n }\n }\n }, 1000 / this.speed);\n }\n }, {\n key: \"replay\",\n value: function replay() {\n this.current = 0;\n this.status = actionStatus.Play;\n if (this.itemList.length == 0) {\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n return 0;\n }\n }\n }, {\n key: \"play\",\n value: function play() {\n //获取帧率\n //await this.getTick();\n //this.starttime = new Date().getTime() \n this.status = actionStatus.Play;\n if (this.itemList.length == 0) {\n this.status = actionStatus.Pause;\n this.getProgress(this.progress.value, this.status, this.itemList[this.current].time);\n return 0;\n }\n }\n }, {\n key: \"getLevel\",\n value: function getLevel(speed) {\n speed = Math.round(speed);\n speed = speed > 24 ? 24 : speed;\n var level = 0;\n // if(speed <= 1 ){\n // color = '#bd1084'\n // }else \n speed = speed < 2 ? 2 : speed;\n if (speed <= 3) {} else if (speed > 3 && speed <= 5) {\n level = 1;\n } else if (speed > 5 && speed <= 7) {\n level = 2;\n } else if (speed > 7 && speed <= 9) {\n level = 3;\n } else if (speed > 9 && speed <= 11) {\n level = 4;\n } else if (speed > 11 && speed <= 13) {\n level = 5;\n } else if (speed > 13 && speed <= 15) {\n level = 6;\n } else if (speed > 15 && speed <= 17) {\n level = 7;\n } else if (speed > 17 && speed <= 19) {\n level = 8;\n } else if (speed > 19 && speed <= 21) {\n level = 9;\n } else if (speed > 21 && speed <= 23) {\n level = 10;\n } else if (speed > 23) {\n level = 11;\n }\n return level;\n }\n }, {\n key: \"animate\",\n value: function animate() {\n // this.obj.model.material.map = this.itemList[this.current].texture\n var _item = this.itemList[this.current];\n for (var i in _item.data) {\n if (!this.meshList[_item.data[i].id]) {\n this.createMesh(_item.data[i].id, _item.data[i].center);\n }\n if (_item.data[i].speed) {\n var color = new three__WEBPACK_IMPORTED_MODULE_4__.Color();\n var level = this.getLevel(_item.data[i].speed);\n var shapeItemInfo = this.barbsList[level];\n var _color = color.set(shapeItemInfo.color);\n var mesh = new three__WEBPACK_IMPORTED_MODULE_4__.Mesh(new three__WEBPACK_IMPORTED_MODULE_4__.ShapeGeometry(shapeItemInfo.shape.toShapes()[0]), this.meshList[_item.data[i].id].model.material);\n mesh = tb.Object3D({\n obj: mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n mesh.setCoords((0,_utils_util_js__WEBPACK_IMPORTED_MODULE_0__.transform)(_item.data[i].center));\n this.meshList[_item.data[i].id].model.geometry = mesh.model.geometry;\n this.meshList[_item.data[i].id].model.material.color = _color;\n tb.update();\n this.map.triggerRepaint();\n }\n //console.log(this.meshList[_item.data[i].id].model.geometry,mesh) \n // console.log(this.meshList[_item.data[i].id].model.material.color)\n //console.log(this.meshList[_item.data[i].id].model) \n }\n // this.obj.label.element.innerHTML = _item.text\n }\n }, {\n key: \"onRemove\",\n value: function onRemove() {\n if (this.timerId) {\n clearInterval(this.timerId);\n }\n this.destory();\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n tb = new threebox_plugin__WEBPACK_IMPORTED_MODULE_2__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true,\n passiveRendering: false\n });\n this.createInterval();\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n tb.update();\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/AnimationBarbsLayer.js?");
4874
4874
 
4875
4875
  /***/ }),
4876
4876
 
@@ -4903,7 +4903,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
4903
4903
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4904
4904
 
4905
4905
  "use strict";
4906
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ExtrusionLayer)\n/* harmony export */ });\n/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/util */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var three_examples_jsm_postprocessing_OutlinePass__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! three/examples/jsm/postprocessing/OutlinePass */ \"./node_modules/three/examples/jsm/postprocessing/OutlinePass.js\");\n/* harmony import */ var 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__);\n/* harmony import */ var _utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/mapUtil */ \"./src/utils/mapUtil.js\");\n/* harmony import */ var _utils_CameraSync__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/CameraSync */ \"./src/utils/CameraSync.js\");\n/* harmony import */ var three_addons_lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! three/addons/lines/LineGeometry.js */ \"./node_modules/three/examples/jsm/lines/LineGeometry.js\");\n/* harmony import */ var _utils_Materials_line_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/Materials/line.js */ \"./src/utils/Materials/line.js\");\n/* harmony import */ var _utils_Materials_shadow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/Materials/shadow.js */ \"./src/utils/Materials/shadow.js\");\n/* harmony import */ var three_addons_lines_Line2_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! three/addons/lines/Line2.js */ \"./node_modules/three/examples/jsm/lines/Line2.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar BLOOM_SCENE = 1;\nvar params = {\n threshold: 0,\n strength: 1.2,\n radius: 2.5,\n exposure: 0\n};\nvar tb = {};\nvar scene;\nvar sceneTarget;\nvar cameraMap;\nvar target;\nvar cameraTarget;\nvar materialTarget;\nvar cameraTransform;\nvar camera;\nvar outlineComposer;\nvar bloomComposer;\nvar renderScene;\nvar bloomPass;\nvar composer;\nvar outlinePass;\nvar composer2;\nvar group = new three__WEBPACK_IMPORTED_MODULE_7__.Group();\nvar group2 = new three__WEBPACK_IMPORTED_MODULE_7__.Group();\nvar group3 = new three__WEBPACK_IMPORTED_MODULE_7__.Group();\nvar sceneMap;\nvar darkMaterial = new three__WEBPACK_IMPORTED_MODULE_7__.MeshBasicMaterial({\n color: 'black',\n transparent: true,\n opacity: 1\n});\nvar bloomLayer = new three__WEBPACK_IMPORTED_MODULE_7__.Layers();\nvar ExtrusionLayer = /*#__PURE__*/function () {\n function ExtrusionLayer(id, config) {\n _classCallCheck(this, ExtrusionLayer);\n _defineProperty(this, \"opacity\", 0.8);\n _defineProperty(this, \"previewCanvas\", null);\n _defineProperty(this, \"w\", 0);\n _defineProperty(this, \"h\", 0);\n this.id = id;\n this.type = 'custom';\n this.renderingMode = '2d';\n this.previewCanvas = config === null || config === void 0 ? void 0 : config.previewCanvas;\n if (config !== null && config !== void 0 && config.previewCanvas) {\n this.previewCanvas.width = this.previewCanvas.clientWidth;\n this.previewCanvas.height = this.previewCanvas.clientHeight;\n this.ctxpre = this.previewCanvas.getContext('2d');\n }\n }\n return _createClass(ExtrusionLayer, [{\n key: \"addStart\",\n value: function addStart() {\n var points = [],\n numPts = 5;\n for (var i = 0; i < numPts * 2; i++) {\n var l = i % 2 == 1 ? 10 : 20;\n var a = i / numPts * Math.PI;\n points.push([Math.cos(a) * l, Math.sin(a) * l]);\n }\n var material1 = new three__WEBPACK_IMPORTED_MODULE_7__.MeshLambertMaterial({\n color: 0xb00000,\n wireframe: false\n });\n var material2 = new three__WEBPACK_IMPORTED_MODULE_7__.MeshLambertMaterial({\n color: 0xff8000,\n wireframe: false\n });\n var star = tb.extrusion({\n coordinates: [points],\n geometryOptions: {\n depth: 20,\n steps: 1,\n bevelEnabled: true,\n bevelThickness: 2,\n bevelSize: 4,\n bevelSegments: 1\n },\n anchor: 'center',\n units: 'meters',\n rotation: {\n x: 90,\n y: 0,\n z: 20\n },\n materials: [material1, material2]\n }, this.map);\n star.addTooltip(\"A animated extruded star over Columbus Park\", true);\n star.setCoords([-74.0001269, 40.7151698, 50]);\n star.set({\n rotation: {\n x: 0,\n y: 0,\n z: 720\n },\n duration: 20000\n });\n tb.add(star);\n }\n }, {\n key: \"addExtrusionsThreeBox\",\n value: function addExtrusionsThreeBox(coordinates, center) {\n var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;\n var material = new three__WEBPACK_IMPORTED_MODULE_7__.MeshPhongMaterial({\n color: 0x4065c9,\n opacity: 0.5,\n side: three__WEBPACK_IMPORTED_MODULE_7__.FrontSide,\n transparent: true\n });\n // let coords = []\n // data.forEach((b) => {\n // // let center = b.properties.center;\n // // let s = tb.projectedUnitsPerMeter(center[1]);\n // coords.push(b.geometry.coordinates)\n\n // });\n var extrusion = tb.extrusion({\n coordinates: coordinates,\n anchor: 'center',\n geometryOptions: {\n curveSegments: 1,\n depth: height\n },\n materials: material\n }, this.map);\n // extrusion.addTooltip(b.properties.tooltip, true);\n extrusion.setCoords([].concat(_toConsumableArray((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(center)), [0]));\n tb.add(extrusion);\n this.outlineObj(extrusion);\n }\n }, {\n key: \"addExtrusions\",\n value: function addExtrusions(coordinates) {\n var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;\n var material = new three__WEBPACK_IMPORTED_MODULE_7__.MeshLambertMaterial({\n color: 0x3d5dc1,\n opacity: 0.6,\n side: three__WEBPACK_IMPORTED_MODULE_7__.FrontSide,\n transparent: true\n });\n coordinates.forEach(function (coords) {\n var shape = new three__WEBPACK_IMPORTED_MODULE_7__.Shape();\n if (coords.length <= 2) {\n return;\n }\n coords.forEach(function (point, i) {\n var position = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.projectToWorld)(point);\n if (i == 0) {\n shape.moveTo(position.x, position.y, position.z);\n } else {\n shape.lineTo(position.x, position.y, position.z);\n }\n });\n // const length = 12, width = 8;\n\n // shape.moveTo( 0,0 );\n // shape.lineTo( 0, width );\n // shape.lineTo( length, width );\n // shape.lineTo( length, 0 );\n // shape.lineTo( 0, 0 );\n var geometry = new three__WEBPACK_IMPORTED_MODULE_7__.ExtrudeGeometry(shape, {\n curveSegments: 1,\n depth: height\n });\n var mesh = new three__WEBPACK_IMPORTED_MODULE_7__.Mesh(geometry, material);\n mesh.layers.enable(BLOOM_SCENE);\n group.add(mesh);\n // /group2.add() \n });\n }\n }, {\n key: \"outlineObj\",\n value: function outlineObj(selectedObjects) {\n if (outlinePass) {\n outlineComposer.removePass(outlinePass);\n outlinePass = null;\n }\n // 物体边缘发光通道\n outlinePass = new three_examples_jsm_postprocessing_OutlinePass__WEBPACK_IMPORTED_MODULE_8__.OutlinePass(new three__WEBPACK_IMPORTED_MODULE_7__.Vector2(window.innerWidth, window.innerHeight), scene, camera);\n outlinePass.edgeStrength = 5; // 边框的亮度\n outlinePass.edgeGlow = 0.1; // 光晕[0,1]\n outlinePass.edgeThickness = 0.1; // 边框宽度\n outlinePass.pulsePeriod = 2; // 呼吸闪烁的速度\n outlinePass.visibleEdgeColor.set(0xff4ecfff);\n outlinePass.hiddenEdgeColor.set(0x00ffff);\n outlinePass.selectedObjects = selectedObjects;\n outlineComposer.addPass(outlinePass);\n // 自定义的着色器通道 作为参数\n }\n }, {\n key: \"addLineThreeBox\",\n value: function addLineThreeBox(coordinates, center) {\n var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;\n coordinates.forEach(function (coords) {\n var line = tb.line({\n geometry: coords,\n color: 0xe6f2ff,\n width: 2\n });\n //line.setCoords([...transform(center), 0]);\n tb.add(line);\n });\n }\n }, {\n key: \"createLine\",\n value: function createLine(coords) {\n var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var opacity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.5;\n var width = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;\n var color = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0xb6d1fc;\n var straightProject = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.lnglatsToWorld)(coords);\n straightProject.forEach(function (a) {\n return a.z = height;\n });\n var normalized = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.normalizeVertices)(straightProject);\n var flattenedArray = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.flattenVectors)(normalized.vertices);\n var geometry = new three_addons_lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_9__.LineGeometry();\n geometry.setPositions(flattenedArray);\n // Material\n var matLine = new _utils_Materials_line_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]({\n color: 0xb6d1fc,\n linewidth: width,\n dashed: false,\n opacity: opacity,\n transparent: true\n });\n matLine.resolution.set(window.innerWidth, window.innerHeight);\n matLine.isMaterial = true;\n matLine.transparent = true;\n matLine.depthWrite = false;\n\n // Mesh\n var line = new three_addons_lines_Line2_js__WEBPACK_IMPORTED_MODULE_10__.Line2(geometry, matLine);\n line.position.copy(normalized.position);\n line.computeLineDistances();\n //this.createShadow(normalized,100)\n return line;\n }\n }, {\n key: \"createShadow\",\n value: function createShadow(normalized, radius) {\n var color = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0xb6d1f0;\n // var straightProject = lnglatsToWorld(coords); \n // straightProject.forEach(a=>a.z = height) \n // var normalized = normalizeVertices(straightProject);\n var flattenedArray = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.flattenVectors)(normalized.vertices);\n var geometry = new three_addons_lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_9__.LineGeometry();\n geometry.setPositions(flattenedArray);\n // Material\n var matLine = new _utils_Materials_shadow_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]({\n color: color,\n linewidth: radius,\n dashed: false,\n opacity: 1,\n transparent: true\n });\n matLine.resolution.set(window.innerWidth, window.innerHeight);\n matLine.isMaterial = true;\n matLine.transparent = true;\n matLine.depthWrite = false;\n\n // Mesh\n var line = new three_addons_lines_Line2_js__WEBPACK_IMPORTED_MODULE_10__.Line2(geometry, matLine);\n line.position.copy(normalized.position);\n line.computeLineDistances();\n group.add(line);\n }\n }, {\n key: \"addLine\",\n value: function addLine(coordinates) {\n var _this = this;\n var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;\n var opacity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.5;\n var width = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;\n var color = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0xb6d1fc;\n var lines = [];\n coordinates.forEach(function (coords) {\n // let positions = []\n if (coords.length <= 2) {\n return;\n }\n // const geometry = new LineGeometry();\n\n // coords.forEach((point,i)=>{\n // let position= projectToWorld(point)\n // positions.push( position.x,position.y,height);\n // })\n // geometry.setPositions( positions );\n // let matLine = new LineMaterial( {\n // color: 0xffffff,\n // linewidth: 2, // in world units with size attenuation, pixels otherwise \n // } );\n // let line = new Line2( geometry, matLine );\n var line = _this.createLine(coords, height, opacity, width, color);\n line.layers.enable(BLOOM_SCENE);\n group.add(line);\n lines.push(line);\n });\n //this.outlineObj([group])\n }\n\n // init(config){\n // config.height = config.height && config.height>0 ? config.height:100\n // //config.height = 0\n // this.addLine(config.coords,config.height)\n\n // //this.addStart()\n // this.addExtrusions(config.coords,config.height)\n\n // //this.addLine(config.coords,config.center,config.height)\n // }\n }, {\n key: \"setTargetTexture\",\n value: function setTargetTexture(w, h) {\n // let composePlaneGeometry = new THREE.BufferGeometry();\n // composePlaneGeometry.setAttribute( 'position', new THREE.Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n // composePlaneGeometry.setAttribute( 'uv', new THREE.Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n var composePlaneGeometry = new three__WEBPACK_IMPORTED_MODULE_7__.PlaneGeometry(w * 10000, h * 10000);\n //debugger\n // materialTarget = new THREE.ShaderMaterial( {\n // \tuniforms: {\n // 'tDiffuse': { value: null },\n // 'opacity': { value: 1 } \n // },\n // \tvertexShader: `\n // varying vec2 vUv; \n // void main() { \n // vUv = uv;\n // gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n // }`,\n // \tfragmentShader: `\n // uniform float opacity;\n // uniform sampler2D tDiffuse;\n // varying vec2 vUv;\n // void main() {\n\n // vec4 texel = texture2D( tDiffuse, vUv );\n // gl_FragColor = opacity * texel;\n\n // }`,\t\t\t\n // \tdepthTest: false,\n // \tdepthWrite: false\n // } );\n materialTarget = new three__WEBPACK_IMPORTED_MODULE_7__.MeshPhongMaterial({\n map: target.texture,\n opacity: 1,\n transparent: true\n });\n var mesh = new three__WEBPACK_IMPORTED_MODULE_7__.Mesh(composePlaneGeometry, materialTarget);\n mesh = tb.Object3D({\n obj: mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n mesh.setCoords([0, 0]);\n tb.add(mesh);\n group2.add(mesh);\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n tb = new threebox_plugin__WEBPACK_IMPORTED_MODULE_2__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true,\n passiveRendering: false\n });\n var container = map.getCanvas();\n var w = container.clientWidth;\n var h = container.clientHeight;\n this.w = w;\n this.h = h;\n scene = new three__WEBPACK_IMPORTED_MODULE_7__.Scene();\n //sceneTarget.background = new THREE.Color('rgba(0,0,0,0)')\n camera = new three__WEBPACK_IMPORTED_MODULE_7__.PerspectiveCamera(map.transform.fov, w / h, 0.1, 1e21);\n scene.add(group);\n scene.add(new three__WEBPACK_IMPORTED_MODULE_7__.AmbientLight(0xffffff));\n //scene.add(group2)\n\n new _utils_CameraSync__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this.map, camera, group);\n\n //new CameraSync(this.map, camera, group2); \n this.renderer = new three__WEBPACK_IMPORTED_MODULE_7__.WebGLRenderer({\n canvas: map.getCanvas(),\n context: gl,\n antialias: true,\n alpha: true\n });\n this.renderer.outputEncoding = three__WEBPACK_IMPORTED_MODULE_7__.sRGBEncoding;\n this.renderer.autoClear = false;\n scene.add(new three__WEBPACK_IMPORTED_MODULE_7__.AxesHelper(0));\n //scene.background =null;\n //scene.background = new THREE.Color(0x000000);\n //this.renderer.setClearAlpha(0.0); \n // target = new THREE.WebGLRenderTarget(w,h,{encoding: THREE.sRGBEncoding });\n // this.setTargetTexture(w,h)\n //renderScene = new RenderPass(scene, camera);\n //composer2 = new EffectComposer(this.renderer);\n //bloomPass = new UnrealBloomPass(new THREE.Vector2(w/2, h/2), params.strength, params.radius, params.threshold);\n //composer2.addPass(renderScene);\n //composer2.addPass(bloomPass);\n //composer2.renderToScreen = true;\n\n // bloomPass = new UnrealBloomPass(new THREE.Vector2(w/2, h/2), params.strength, params.radius, params.threshold);\n // bloomComposer = new EffectComposer(this.renderer);\n // bloomComposer.renderToScreen = true;\n // bloomComposer.addPass(renderScene);\n // bloomComposer.addPass(bloomPass);\n //outlineComposer = new EffectComposer(this.renderer)\n // bloomLayer.set(BLOOM_SCENE);\n\n // const bloomPass = new OutlinePass(\n // new THREE.Vector2(window.innerWidth, window.innerHeight),\n // scene,\n // camera\n // )\n // bloomPass.edgeStrength = 5 // 边框的亮度\n // bloomPass.edgeGlow = 1 // 光晕[0,1]\n // bloomPass.edgeThickness = 5 // 边框宽度\n // bloomPass.pulsePeriod = 3 // 呼吸闪烁的速度\n // bloomPass.visibleEdgeColor.set(0xff4ecfff)\n // bloomPass.hiddenEdgeColor.set(0x00ffff)\n //bloomPass.selectedObjects = [group]\n\n // const mixPass = new ShaderPass(\n // new THREE.ShaderMaterial({\n // uniforms: {\n // baseTexture: { value: null },\n // bloomTexture: { value: bloomComposer.renderTarget2.texture },\n // },\n // // @ts-ignore\n // vertexShader: document.getElementById('vertexshader').textContent,\n // // @ts-ignore\n // fragmentShader: document.getElementById('fragmentshader').textContent,\n // defines: {},\n // }),\n // 'baseTexture',\n // );\n // mixPass.needsSwap = true;\n\n // const outputPass = new OutputPass();\n\n // composer = new EffectComposer(this.renderer);\n // composer.addPass(renderScene);\n // composer.addPass(mixPass);\n // composer.addPass(outputPass);\n\n //let renderPass = new RenderPass(scene, camera) \n //outlineComposer.addPass(renderPass)\n }\n }, {\n key: \"updatePreview\",\n value: function updatePreview(ImageData) {\n this.ctxpre.clearRect(0, 0, this.previewCanvas.width, this.previewCanvas.height);\n this.ctxpre.putImageData(ImageData, 0, 0);\n }\n }, {\n key: \"flipY\",\n value: function flipY(buffer, width, height) {\n // 每一轮循环 第i行和第j行交换\n for (var i = 0, j = height - 1; i < j; ++i, --j) {\n // 交换两行的数据\n for (var k = 0; k < 4 * width; ++k) {\n var t = buffer[i * width * 4 + k];\n buffer[i * width * 4 + k] = buffer[j * width * 4 + k];\n buffer[j * width * 4 + k] = t;\n }\n }\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n //composer.render()\n // scene.traverse(this.darkenNonBloomed);\n // bloomComposer.render();\n //outlineComposer.render()\n //composer2.render();\n this.renderer.resetState();\n this.renderer.render(scene, camera);\n this.map.triggerRepaint();\n }\n }, {\n key: \"darkenNonBloomed\",\n value: function darkenNonBloomed(obj) {\n // if (obj instanceof THREE.Scene) { \n // obj.background = new THREE.Color(0x000fff)\n // debugger\n // } \n // if (obj.isMesh) {\n\n // //materials[obj.uuid] = obj.material;\n // obj.background = null\n // //obj.material = darkMaterial;\n // }\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/ExtrusionLayer.js?");
4906
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ExtrusionLayer)\n/* harmony export */ });\n/* harmony import */ var _utils_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../utils/util */ \"./src/utils/util.js\");\n/* harmony import */ var _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../lib/mapbox-gl/dist/mapbox-gl.js */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var three_examples_jsm_postprocessing_OutlinePass__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! three/examples/jsm/postprocessing/OutlinePass */ \"./node_modules/three/examples/jsm/postprocessing/OutlinePass.js\");\n/* harmony import */ var 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__);\n/* harmony import */ var _utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../utils/mapUtil */ \"./src/utils/mapUtil.js\");\n/* harmony import */ var _utils_CameraSync__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/CameraSync */ \"./src/utils/CameraSync.js\");\n/* harmony import */ var three_addons_lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! three/addons/lines/LineGeometry.js */ \"./node_modules/three/examples/jsm/lines/LineGeometry.js\");\n/* harmony import */ var _utils_Materials_line_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/Materials/line.js */ \"./src/utils/Materials/line.js\");\n/* harmony import */ var _utils_Materials_shadow_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../utils/Materials/shadow.js */ \"./src/utils/Materials/shadow.js\");\n/* harmony import */ var three_addons_lines_Line2_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! three/addons/lines/Line2.js */ \"./node_modules/three/examples/jsm/lines/Line2.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _iterableToArray(r) { if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r); }\nfunction _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar BLOOM_SCENE = 1;\nvar params = {\n threshold: 0,\n strength: 1.2,\n radius: 2.5,\n exposure: 0\n};\nvar tb = {};\nvar scene;\nvar sceneTarget;\nvar cameraMap;\nvar target;\nvar cameraTarget;\nvar materialTarget;\nvar cameraTransform;\nvar camera;\nvar outlineComposer;\nvar bloomComposer;\nvar renderScene;\nvar bloomPass;\nvar composer;\nvar outlinePass;\nvar composer2;\nvar group = new three__WEBPACK_IMPORTED_MODULE_7__.Group();\nvar group2 = new three__WEBPACK_IMPORTED_MODULE_7__.Group();\nvar group3 = new three__WEBPACK_IMPORTED_MODULE_7__.Group();\nvar sceneMap;\nvar darkMaterial = new three__WEBPACK_IMPORTED_MODULE_7__.MeshBasicMaterial({\n color: 'black',\n transparent: true,\n opacity: 1\n});\nvar bloomLayer = new three__WEBPACK_IMPORTED_MODULE_7__.Layers();\nvar ExtrusionLayer = /*#__PURE__*/function () {\n function ExtrusionLayer(id, config) {\n _classCallCheck(this, ExtrusionLayer);\n _defineProperty(this, \"opacity\", 0.8);\n _defineProperty(this, \"previewCanvas\", null);\n _defineProperty(this, \"w\", 0);\n _defineProperty(this, \"h\", 0);\n this.id = id;\n this.type = 'custom';\n this.renderingMode = '2d';\n this.previewCanvas = config === null || config === void 0 ? void 0 : config.previewCanvas;\n if (config !== null && config !== void 0 && config.previewCanvas) {\n this.previewCanvas.width = this.previewCanvas.clientWidth;\n this.previewCanvas.height = this.previewCanvas.clientHeight;\n this.ctxpre = this.previewCanvas.getContext('2d');\n }\n }\n return _createClass(ExtrusionLayer, [{\n key: \"addStart\",\n value: function addStart() {\n var points = [],\n numPts = 5;\n for (var i = 0; i < numPts * 2; i++) {\n var l = i % 2 == 1 ? 10 : 20;\n var a = i / numPts * Math.PI;\n points.push([Math.cos(a) * l, Math.sin(a) * l]);\n }\n var material1 = new three__WEBPACK_IMPORTED_MODULE_7__.MeshLambertMaterial({\n color: 0xb00000,\n wireframe: false\n });\n var material2 = new three__WEBPACK_IMPORTED_MODULE_7__.MeshLambertMaterial({\n color: 0xff8000,\n wireframe: false\n });\n var star = tb.extrusion({\n coordinates: [points],\n geometryOptions: {\n depth: 20,\n steps: 1,\n bevelEnabled: true,\n bevelThickness: 2,\n bevelSize: 4,\n bevelSegments: 1\n },\n anchor: 'center',\n units: 'meters',\n rotation: {\n x: 90,\n y: 0,\n z: 20\n },\n materials: [material1, material2]\n }, this.map);\n star.addTooltip(\"A animated extruded star over Columbus Park\", true);\n star.setCoords([-74.0001269, 40.7151698, 50]);\n star.set({\n rotation: {\n x: 0,\n y: 0,\n z: 720\n },\n duration: 20000\n });\n tb.add(star);\n }\n }, {\n key: \"addExtrusionsThreeBox\",\n value: function addExtrusionsThreeBox(coordinates, center) {\n var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;\n var material = new three__WEBPACK_IMPORTED_MODULE_7__.MeshPhongMaterial({\n color: 0x4065c9,\n opacity: 0.5,\n side: three__WEBPACK_IMPORTED_MODULE_7__.FrontSide,\n transparent: true\n });\n // let coords = []\n // data.forEach((b) => {\n // // let center = b.properties.center;\n // // let s = tb.projectedUnitsPerMeter(center[1]);\n // coords.push(b.geometry.coordinates)\n\n // });\n var extrusion = tb.extrusion({\n coordinates: coordinates,\n anchor: 'center',\n geometryOptions: {\n curveSegments: 1,\n depth: height\n },\n materials: material\n }, this.map);\n // extrusion.addTooltip(b.properties.tooltip, true);\n extrusion.setCoords([].concat(_toConsumableArray((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(center)), [0]));\n tb.add(extrusion);\n this.outlineObj(extrusion);\n }\n }, {\n key: \"addExtrusions\",\n value: function addExtrusions(coordinates) {\n var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;\n var opacity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.6;\n var color = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0x3d5dc1;\n var material = new three__WEBPACK_IMPORTED_MODULE_7__.MeshLambertMaterial({\n color: color,\n opacity: opacity,\n side: three__WEBPACK_IMPORTED_MODULE_7__.FrontSide,\n transparent: true\n });\n coordinates.forEach(function (coords) {\n var shape = new three__WEBPACK_IMPORTED_MODULE_7__.Shape();\n if (coords.length <= 2) {\n return;\n }\n coords.forEach(function (point, i) {\n var position = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.projectToWorld)(point);\n if (i == 0) {\n shape.moveTo(position.x, position.y, position.z);\n } else {\n shape.lineTo(position.x, position.y, position.z);\n }\n });\n // const length = 12, width = 8;\n\n // shape.moveTo( 0,0 );\n // shape.lineTo( 0, width );\n // shape.lineTo( length, width );\n // shape.lineTo( length, 0 );\n // shape.lineTo( 0, 0 );\n var geometry = new three__WEBPACK_IMPORTED_MODULE_7__.ExtrudeGeometry(shape, {\n curveSegments: 1,\n depth: height\n });\n var mesh = new three__WEBPACK_IMPORTED_MODULE_7__.Mesh(geometry, material);\n mesh.layers.enable(BLOOM_SCENE);\n group.add(mesh);\n // /group2.add() \n });\n }\n }, {\n key: \"outlineObj\",\n value: function outlineObj(selectedObjects) {\n if (outlinePass) {\n outlineComposer.removePass(outlinePass);\n outlinePass = null;\n }\n // 物体边缘发光通道\n outlinePass = new three_examples_jsm_postprocessing_OutlinePass__WEBPACK_IMPORTED_MODULE_8__.OutlinePass(new three__WEBPACK_IMPORTED_MODULE_7__.Vector2(window.innerWidth, window.innerHeight), scene, camera);\n outlinePass.edgeStrength = 5; // 边框的亮度\n outlinePass.edgeGlow = 0.1; // 光晕[0,1]\n outlinePass.edgeThickness = 0.1; // 边框宽度\n outlinePass.pulsePeriod = 2; // 呼吸闪烁的速度\n outlinePass.visibleEdgeColor.set(0xff4ecfff);\n outlinePass.hiddenEdgeColor.set(0x00ffff);\n outlinePass.selectedObjects = selectedObjects;\n outlineComposer.addPass(outlinePass);\n // 自定义的着色器通道 作为参数\n }\n }, {\n key: \"addLineThreeBox\",\n value: function addLineThreeBox(coordinates, center) {\n var height = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;\n coordinates.forEach(function (coords) {\n var line = tb.line({\n geometry: coords,\n color: 0xe6f2ff,\n width: 2\n });\n //line.setCoords([...transform(center), 0]);\n tb.add(line);\n });\n }\n }, {\n key: \"createLine\",\n value: function createLine(coords) {\n var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var opacity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.5;\n var width = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;\n var color = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0xb6d1fc;\n var straightProject = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.lnglatsToWorld)(coords);\n straightProject.forEach(function (a) {\n return a.z = height;\n });\n var normalized = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.normalizeVertices)(straightProject);\n var flattenedArray = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.flattenVectors)(normalized.vertices);\n var geometry = new three_addons_lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_9__.LineGeometry();\n geometry.setPositions(flattenedArray);\n // Material\n var matLine = new _utils_Materials_line_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]({\n color: 0xb6d1fc,\n linewidth: width,\n dashed: false,\n opacity: opacity,\n transparent: true\n });\n matLine.resolution.set(window.innerWidth, window.innerHeight);\n matLine.isMaterial = true;\n matLine.transparent = true;\n matLine.depthWrite = false;\n\n // Mesh\n var line = new three_addons_lines_Line2_js__WEBPACK_IMPORTED_MODULE_10__.Line2(geometry, matLine);\n line.position.copy(normalized.position);\n line.computeLineDistances();\n //this.createShadow(normalized,100)\n return line;\n }\n }, {\n key: \"createShadow\",\n value: function createShadow(normalized, radius) {\n var color = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0xb6d1f0;\n // var straightProject = lnglatsToWorld(coords); \n // straightProject.forEach(a=>a.z = height) \n // var normalized = normalizeVertices(straightProject);\n var flattenedArray = (0,_utils_mapUtil__WEBPACK_IMPORTED_MODULE_3__.flattenVectors)(normalized.vertices);\n var geometry = new three_addons_lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_9__.LineGeometry();\n geometry.setPositions(flattenedArray);\n // Material\n var matLine = new _utils_Materials_shadow_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]({\n color: color,\n linewidth: radius,\n dashed: false,\n opacity: 1,\n transparent: true\n });\n matLine.resolution.set(window.innerWidth, window.innerHeight);\n matLine.isMaterial = true;\n matLine.transparent = true;\n matLine.depthWrite = false;\n\n // Mesh\n var line = new three_addons_lines_Line2_js__WEBPACK_IMPORTED_MODULE_10__.Line2(geometry, matLine);\n line.position.copy(normalized.position);\n line.computeLineDistances();\n group.add(line);\n }\n }, {\n key: \"addLine\",\n value: function addLine(coordinates) {\n var _this = this;\n var height = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;\n var opacity = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0.5;\n var width = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 2;\n var color = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0xb6d1fc;\n var lines = [];\n coordinates.forEach(function (coords) {\n // let positions = []\n if (coords.length <= 2) {\n return;\n }\n // const geometry = new LineGeometry();\n\n // coords.forEach((point,i)=>{\n // let position= projectToWorld(point)\n // positions.push( position.x,position.y,height);\n // })\n // geometry.setPositions( positions );\n // let matLine = new LineMaterial( {\n // color: 0xffffff,\n // linewidth: 2, // in world units with size attenuation, pixels otherwise \n // } );\n // let line = new Line2( geometry, matLine );\n var line = _this.createLine(coords, height, opacity, width, color);\n line.layers.enable(BLOOM_SCENE);\n group.add(line);\n lines.push(line);\n });\n //this.outlineObj([group])\n }\n\n // init(config){\n // config.height = config.height && config.height>0 ? config.height:100\n // //config.height = 0\n // this.addLine(config.coords,config.height)\n\n // //this.addStart()\n // this.addExtrusions(config.coords,config.height)\n\n // //this.addLine(config.coords,config.center,config.height)\n // }\n }, {\n key: \"setTargetTexture\",\n value: function setTargetTexture(w, h) {\n // let composePlaneGeometry = new THREE.BufferGeometry();\n // composePlaneGeometry.setAttribute( 'position', new THREE.Float32BufferAttribute( [ - 1, 3, 0, - 1, - 1, 0, 3, - 1, 0 ], 3 ) );\n // composePlaneGeometry.setAttribute( 'uv', new THREE.Float32BufferAttribute( [ 0, 2, 0, 0, 2, 0 ], 2 ) );\n var composePlaneGeometry = new three__WEBPACK_IMPORTED_MODULE_7__.PlaneGeometry(w * 10000, h * 10000);\n //debugger\n // materialTarget = new THREE.ShaderMaterial( {\n // \tuniforms: {\n // 'tDiffuse': { value: null },\n // 'opacity': { value: 1 } \n // },\n // \tvertexShader: `\n // varying vec2 vUv; \n // void main() { \n // vUv = uv;\n // gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n // }`,\n // \tfragmentShader: `\n // uniform float opacity;\n // uniform sampler2D tDiffuse;\n // varying vec2 vUv;\n // void main() {\n\n // vec4 texel = texture2D( tDiffuse, vUv );\n // gl_FragColor = opacity * texel;\n\n // }`,\t\t\t\n // \tdepthTest: false,\n // \tdepthWrite: false\n // } );\n materialTarget = new three__WEBPACK_IMPORTED_MODULE_7__.MeshPhongMaterial({\n map: target.texture,\n opacity: 1,\n transparent: true\n });\n var mesh = new three__WEBPACK_IMPORTED_MODULE_7__.Mesh(composePlaneGeometry, materialTarget);\n mesh = tb.Object3D({\n obj: mesh,\n units: 'meters',\n fixedZoom: 15,\n anchor: 'center'\n });\n mesh.setCoords([0, 0]);\n tb.add(mesh);\n group2.add(mesh);\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n tb = new threebox_plugin__WEBPACK_IMPORTED_MODULE_2__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true,\n passiveRendering: false\n });\n var container = map.getCanvas();\n var w = container.clientWidth;\n var h = container.clientHeight;\n this.w = w;\n this.h = h;\n scene = new three__WEBPACK_IMPORTED_MODULE_7__.Scene();\n //sceneTarget.background = new THREE.Color('rgba(0,0,0,0)')\n camera = new three__WEBPACK_IMPORTED_MODULE_7__.PerspectiveCamera(map.transform.fov, w / h, 0.1, 1e21);\n scene.add(group);\n scene.add(new three__WEBPACK_IMPORTED_MODULE_7__.AmbientLight(0xffffff));\n //scene.add(group2)\n\n new _utils_CameraSync__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this.map, camera, group);\n\n //new CameraSync(this.map, camera, group2); \n this.renderer = new three__WEBPACK_IMPORTED_MODULE_7__.WebGLRenderer({\n canvas: map.getCanvas(),\n context: gl,\n antialias: true,\n alpha: true\n });\n this.renderer.outputEncoding = three__WEBPACK_IMPORTED_MODULE_7__.sRGBEncoding;\n this.renderer.autoClear = false;\n scene.add(new three__WEBPACK_IMPORTED_MODULE_7__.AxesHelper(0));\n //scene.background =null;\n //scene.background = new THREE.Color(0x000000);\n //this.renderer.setClearAlpha(0.0); \n // target = new THREE.WebGLRenderTarget(w,h,{encoding: THREE.sRGBEncoding });\n // this.setTargetTexture(w,h)\n //renderScene = new RenderPass(scene, camera);\n //composer2 = new EffectComposer(this.renderer);\n //bloomPass = new UnrealBloomPass(new THREE.Vector2(w/2, h/2), params.strength, params.radius, params.threshold);\n //composer2.addPass(renderScene);\n //composer2.addPass(bloomPass);\n //composer2.renderToScreen = true;\n\n // bloomPass = new UnrealBloomPass(new THREE.Vector2(w/2, h/2), params.strength, params.radius, params.threshold);\n // bloomComposer = new EffectComposer(this.renderer);\n // bloomComposer.renderToScreen = true;\n // bloomComposer.addPass(renderScene);\n // bloomComposer.addPass(bloomPass);\n //outlineComposer = new EffectComposer(this.renderer)\n // bloomLayer.set(BLOOM_SCENE);\n\n // const bloomPass = new OutlinePass(\n // new THREE.Vector2(window.innerWidth, window.innerHeight),\n // scene,\n // camera\n // )\n // bloomPass.edgeStrength = 5 // 边框的亮度\n // bloomPass.edgeGlow = 1 // 光晕[0,1]\n // bloomPass.edgeThickness = 5 // 边框宽度\n // bloomPass.pulsePeriod = 3 // 呼吸闪烁的速度\n // bloomPass.visibleEdgeColor.set(0xff4ecfff)\n // bloomPass.hiddenEdgeColor.set(0x00ffff)\n //bloomPass.selectedObjects = [group]\n\n // const mixPass = new ShaderPass(\n // new THREE.ShaderMaterial({\n // uniforms: {\n // baseTexture: { value: null },\n // bloomTexture: { value: bloomComposer.renderTarget2.texture },\n // },\n // // @ts-ignore\n // vertexShader: document.getElementById('vertexshader').textContent,\n // // @ts-ignore\n // fragmentShader: document.getElementById('fragmentshader').textContent,\n // defines: {},\n // }),\n // 'baseTexture',\n // );\n // mixPass.needsSwap = true;\n\n // const outputPass = new OutputPass();\n\n // composer = new EffectComposer(this.renderer);\n // composer.addPass(renderScene);\n // composer.addPass(mixPass);\n // composer.addPass(outputPass);\n\n //let renderPass = new RenderPass(scene, camera) \n //outlineComposer.addPass(renderPass)\n }\n }, {\n key: \"updatePreview\",\n value: function updatePreview(ImageData) {\n this.ctxpre.clearRect(0, 0, this.previewCanvas.width, this.previewCanvas.height);\n this.ctxpre.putImageData(ImageData, 0, 0);\n }\n }, {\n key: \"flipY\",\n value: function flipY(buffer, width, height) {\n // 每一轮循环 第i行和第j行交换\n for (var i = 0, j = height - 1; i < j; ++i, --j) {\n // 交换两行的数据\n for (var k = 0; k < 4 * width; ++k) {\n var t = buffer[i * width * 4 + k];\n buffer[i * width * 4 + k] = buffer[j * width * 4 + k];\n buffer[j * width * 4 + k] = t;\n }\n }\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n //composer.render()\n // scene.traverse(this.darkenNonBloomed);\n // bloomComposer.render();\n //outlineComposer.render()\n //composer2.render();\n this.renderer.resetState();\n this.renderer.render(scene, camera);\n this.map.triggerRepaint();\n }\n }, {\n key: \"darkenNonBloomed\",\n value: function darkenNonBloomed(obj) {\n // if (obj instanceof THREE.Scene) { \n // obj.background = new THREE.Color(0x000fff)\n // debugger\n // } \n // if (obj.isMesh) {\n\n // //materials[obj.uuid] = obj.material;\n // obj.background = null\n // //obj.material = darkMaterial;\n // }\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/ExtrusionLayer.js?");
4907
4907
 
4908
4908
  /***/ }),
4909
4909
 
@@ -4914,7 +4914,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
4914
4914
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4915
4915
 
4916
4916
  "use strict";
4917
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ PathLineLayer)\n/* harmony export */ });\n/* harmony import */ var 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 mapbox_gl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! mapbox-gl */ \"./lib/mapbox-gl/dist/mapbox-gl.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\n\n\n\nvar tb = {};\nvar PathLineLayer = /*#__PURE__*/function () {\n function PathLineLayer(id, config) {\n _classCallCheck(this, PathLineLayer);\n _defineProperty(this, \"lines\", []);\n this.id = id;\n this.type = 'custom';\n this.renderingMode = '2d';\n }\n return _createClass(PathLineLayer, [{\n key: \"remove\",\n value: function remove() {\n this.lines.forEach(function (a) {\n return tb.remove(a);\n });\n }\n }, {\n key: \"drawLine\",\n value: function drawLine(list) {\n var _this = this;\n this.remove();\n var _lines = [];\n var _line = {\n geometry: [],\n color: 0xffffff,\n width: 20\n };\n for (var i in list) {\n var item = list[i];\n if (i > 0) {\n var pre = list[i - 1];\n if (item.color == pre.color) {\n _line.geometry.push(item.point);\n } else {\n var c = new three__WEBPACK_IMPORTED_MODULE_3__.Color(item.color);\n _lines.push(_line);\n _line = {\n geometry: [],\n color: c,\n width: 20\n };\n }\n if (i == list.length - 1) {\n _lines.push(_line);\n }\n }\n // lineMesh.addEventListener('ObjectMouseOver', ()=>{\n // console.log(999)\n // }, false)\n }\n _lines.forEach(function (line) {\n // var lineOptions = {\n // geometry: line,\n // color: 0xffffff, // color based on latitude of endpoint\n // width: Math.random() + 1 // random width between 1 and 2\n // }\n\n var lineMesh = tb.line(line);\n tb.add(lineMesh);\n _this.lines.push(lineMesh);\n });\n this.map.fitBounds((0,_utils_util_js__WEBPACK_IMPORTED_MODULE_1__.getBBox)(list.map(function (a) {\n return a.point;\n })), {\n padding: {\n top: 45,\n bottom: 45,\n left: 35,\n right: 35\n },\n maxZoom: 11,\n pitch: 0\n });\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n tb = new threebox_plugin__WEBPACK_IMPORTED_MODULE_0__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true,\n passiveRendering: false\n });\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n tb.update();\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/PathLineLayer.js?");
4917
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ PathLineLayer)\n/* harmony export */ });\n/* harmony import */ var 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\n\nvar tb = {};\nvar PathLineLayer = /*#__PURE__*/function () {\n function PathLineLayer(id, config) {\n _classCallCheck(this, PathLineLayer);\n _defineProperty(this, \"lines\", []);\n this.id = id;\n this.type = 'custom';\n this.renderingMode = '2d';\n }\n return _createClass(PathLineLayer, [{\n key: \"remove\",\n value: function remove() {\n this.lines.forEach(function (a) {\n return tb.remove(a);\n });\n }\n }, {\n key: \"drawLine\",\n value: function drawLine(list) {\n var _this = this;\n this.remove();\n var _lines = [];\n var _line = {\n geometry: [],\n color: 0xffffff,\n width: 20\n };\n for (var i in list) {\n var item = list[i];\n if (i > 0) {\n var pre = list[i - 1];\n if (item.color == pre.color) {\n _line.geometry.push(item.point);\n } else {\n var c = new three__WEBPACK_IMPORTED_MODULE_3__.Color(item.color);\n _lines.push(_line);\n _line = {\n geometry: [],\n color: c,\n width: 20\n };\n }\n if (i == list.length - 1) {\n _lines.push(_line);\n }\n }\n // lineMesh.addEventListener('ObjectMouseOver', ()=>{\n // console.log(999)\n // }, false)\n }\n _lines.forEach(function (line) {\n // var lineOptions = {\n // geometry: line,\n // color: 0xffffff, // color based on latitude of endpoint\n // width: Math.random() + 1 // random width between 1 and 2\n // }\n\n var lineMesh = tb.line(line);\n tb.add(lineMesh);\n _this.lines.push(lineMesh);\n });\n this.map.fitBounds((0,_utils_util_js__WEBPACK_IMPORTED_MODULE_1__.getBBox)(list.map(function (a) {\n return a.point;\n })), {\n padding: {\n top: 45,\n bottom: 45,\n left: 35,\n right: 35\n },\n maxZoom: 11,\n pitch: 0\n });\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n this.map = map;\n tb = new threebox_plugin__WEBPACK_IMPORTED_MODULE_0__.Threebox(map, gl,\n //get the context from Mapbox\n {\n defaultLights: true,\n passiveRendering: false\n });\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n tb.update();\n this.map.triggerRepaint();\n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/PathLineLayer.js?");
4918
4918
 
4919
4919
  /***/ }),
4920
4920
 
@@ -4925,7 +4925,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
4925
4925
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4926
4926
 
4927
4927
  "use strict";
4928
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ScanLayer)\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 mapbox_gl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! mapbox-gl */ \"./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 _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\nvar ScanLayer = /*#__PURE__*/function () {\n function ScanLayer(id, _scanInfo) {\n _classCallCheck(this, ScanLayer);\n _defineProperty(this, \"drawArray\", []);\n _defineProperty(this, \"defaultDrawInfo\", {\n id: '',\n image: null,\n coords: [],\n refreshTime: null\n });\n _defineProperty(this, \"opacity\", 1);\n //超时删除时间(秒)\n _defineProperty(this, \"outTime\", 300);\n _defineProperty(this, \"image\", void 0);\n _defineProperty(this, \"positionRect\", void 0);\n _defineProperty(this, \"gl\", void 0);\n _defineProperty(this, \"renderBack\", function () {});\n _defineProperty(this, \"textCtx\", null);\n _defineProperty(this, \"textLayer\", void 0);\n _defineProperty(this, \"timeLabels\", {\n 'type': 'FeatureCollection',\n 'features': []\n });\n this.id = id;\n this.type = 'custom';\n this.renderingMode = '2d';\n this.textCtx = document.createElement(\"canvas\").getContext(\"2d\");\n if (_scanInfo) {\n this.drawList(_scanInfo);\n }\n this.timeClear();\n }\n\n // 将文字放在画布中间 创建文本纹理\n return _createClass(ScanLayer, [{\n key: \"makeTextCanvas\",\n value: function makeTextCanvas(text, style) {\n var _style = {\n fontSize: 16,\n fontFamily: '',\n textAlign: 'center',\n fillStyle: '#000',\n strokeStyle: \"#fff\",\n textBaseline: 'middle',\n lineWidth: 3\n };\n var styleObj = Object.assign({}, _style, style);\n var padding = 2;\n var width = styleObj.fontSize * text.length + padding * 2;\n var height = styleObj.fontSize + padding * 2;\n this.textCtx.canvas.width = width;\n this.textCtx.canvas.height = height;\n this.textCtx.font = \"\".concat(styleObj.fontSize, \"px \").concat(styleObj.fontFamily);\n for (var i in styleObj) {\n if (i == 'fontSize' || i == 'fontFamily') {} else {\n this.textCtx[i] = styleObj[i];\n }\n }\n this.textCtx.clearRect(0, 0, width, height);\n this.textCtx.fillText(text, width / 2, height / 2);\n return this.textCtx.canvas;\n }\n }, {\n key: \"timeClear\",\n value: function timeClear() {\n setInterval(function () {\n var _this = this;\n this.drawArray = this.drawArray.filter(function (a) {\n return (new Date().getTime() - a.refreshTime.getTime()) / 1000 < _this.outTime;\n });\n }.bind(this), 1000);\n }\n // {\n // id:'',\n // image:''\n // }\n //添加图像object\n }, {\n key: \"drawList\",\n value: function drawList(_scanInfo) {\n var _this2 = this;\n var props = ['id', 'image', 'coords'];\n if (_scanInfo instanceof Array) {\n var _iterator = _createForOfIteratorHelper(_scanInfo),\n _step;\n try {\n var _loop = function _loop() {\n var _info = _step.value;\n (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.hasProperty)(_info, props);\n var currIndex = _this2.drawArray.findIndex(function (a) {\n return a.id == _info.id;\n });\n _info.coords = _info.coords.map(function (a) {\n return (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(a);\n });\n if (currIndex < 0) {\n var entity = Object.assign({}, _this2.defaultDrawInfo, _info);\n entity.refreshTime = new Date();\n _this2.drawArray.push(entity);\n if (entity.text) {\n _this2.drawTextByLayer(entity);\n } else {\n _this2.removeText(entity);\n }\n } else {\n var _entity = Object.assign({}, _this2.defaultDrawInfo, _info);\n _entity.refreshTime = new Date();\n _this2.drawArray[currIndex] = _entity;\n if (_entity.text) {\n _this2.drawTextByLayer(_entity);\n } else {\n _this2.removeText(_entity);\n }\n }\n };\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n _loop();\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n } else {\n (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.hasProperty)(_scanInfo, props);\n _scanInfo.coords = _scanInfo.coords.map(function (a) {\n return (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(a);\n });\n var currIndex = this.drawArray.findIndex(function (a) {\n return a.id == _scanInfo.id;\n });\n if (currIndex < 0) {\n var entity = Object.assign({}, this.defaultDrawInfo, _scanInfo);\n entity.refreshTime = new Date();\n this.drawArray.push(entity);\n if (entity.text) {\n this.drawTextByLayer(entity);\n } else {\n this.removeText(entity);\n }\n } else {\n var _entity2 = Object.assign({}, this.defaultDrawInfo, _scanInfo);\n _entity2.refreshTime = new Date();\n this.drawArray[currIndex] = _entity2;\n if (_entity2.text) {\n this.drawTextByLayer(_entity2);\n } else {\n this.removeText(_entity2);\n }\n }\n }\n }\n }, {\n key: \"del\",\n value: function del(id) {\n this.drawArray = this.drawArray.filter(function (a) {\n return a.id != id;\n });\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n //两个着色器\n // const vertexSource = `\n // uniform mat4 u_matrix;\n // void main() {\n // gl_Position = u_matrix * vec4(0.5, 0.5, 0.0, 1.0);\n // gl_PointSize = 20.0;\n // }`;\n\n // const fragmentSource = `\n // void main() {\n // gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n // }`;\n\n var vertexSource = \"\\n uniform mat4 u_matrix;\\n attribute vec3 a_pos;\\n attribute vec2 a_uv;\\n varying vec2 v_uv;\\n void main() {\\n v_uv = a_uv;\\n gl_Position = u_matrix * vec4(a_pos, 1.0);\\n } \\n \";\n var fragmentSource = \"\\n precision mediump float;\\n uniform float opa;\\n varying vec2 v_uv;\\n uniform sampler2D u_sampler;\\n void main() {\\n gl_FragColor = texture2D(u_sampler , v_uv) * opa;\\n }\\n \";\n var vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, vertexSource);\n gl.compileShader(vertexShader);\n var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader, fragmentSource);\n gl.compileShader(fragmentShader);\n this.program = gl.createProgram();\n gl.attachShader(this.program, vertexShader);\n gl.attachShader(this.program, fragmentShader);\n gl.linkProgram(this.program);\n this.aPos = gl.getAttribLocation(this.program, 'a_pos');\n this.aUv = gl.getAttribLocation(this.program, 'a_uv');\n this.opa = gl.getAttribLocation(this.program, 'opa');\n this.uSamplerLoc = gl.getUniformLocation(this.program, 'u_sampler');\n this.gl = gl;\n this.map = map;\n //添加时间图层 消耗内存大 废弃\n var timeTextLayer = this.map.getLayer('timeLabelLayer');\n if (!this.map.getSource('timeLabels')) {\n this.map.addSource('timeLabels', {\n 'type': 'geojson',\n 'data': this.timeLabels,\n 'dynamic': true\n });\n }\n if (!timeTextLayer) {\n this.map.addLayer({\n 'id': 'timeLabelLayer',\n 'type': 'symbol',\n 'source': 'timeLabels',\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 timeTextLayer = this.map.getLayer('timeLabelLayer');\n }\n }\n }, {\n key: \"draw\",\n value: function draw() {\n for (var i in this.drawArray) {\n this.drawArrayItem(this.drawArray[i]);\n }\n }\n }, {\n key: \"drawText\",\n value: function drawText(item) {\n var _item$text, _item$text2;\n var gl = this.gl;\n var scale = 12;\n if (!item.textTextture) {\n item.textTextture = gl.createTexture();\n }\n var center = item.coords[3]; //transform(item.center)\n gl.bindTexture(gl.TEXTURE_2D, item.textTextture);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n var textCanvas = this.makeTextCanvas((_item$text = item.text) === null || _item$text === void 0 ? void 0 : _item$text.label, item === null || item === void 0 || (_item$text2 = item.text) === null || _item$text2 === void 0 ? void 0 : _item$text2.textStyle);\n if (!textCanvas) {\n return;\n }\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, textCanvas);\n item.textBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, item.textBuffer);\n var p1 = mapbox_gl__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MercatorCoordinate.fromLngLat({\n lng: center[0],\n lat: center[1]\n }, 10);\n var p2 = mapbox_gl__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MercatorCoordinate.fromLngLat({\n lng: center[0] + 0.03 * scale,\n lat: center[1]\n }, 10);\n var p3 = mapbox_gl__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MercatorCoordinate.fromLngLat({\n lng: center[0] + 0.03 * scale,\n lat: center[1] + 0.001 * scale\n }, 10);\n var p4 = mapbox_gl__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MercatorCoordinate.fromLngLat({\n lng: center[0],\n lat: center[1] + 0.001 * scale\n }, 10);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n // position, uv\n p1.x, p1.y, p1.z, 0, 0, p2.x, p2.y, p2.z, 1, 0, p3.x, p3.y, p3.z, 1, 1, p1.x, p1.y, p1.z, 0, 0, p3.x, p3.y, p3.z, 1, 1, p4.x, p4.y, p4.z, 0, 1]), gl.STATIC_DRAW);\n gl.bindTexture(gl.TEXTURE_2D, item.textTextture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n\n // 每帧都要绑定 VBO,并启用 vertexAttributes、设置 vertexAttributes 的参数\n gl.bindBuffer(gl.ARRAY_BUFFER, item.textBuffer);\n // gl.enableVertexAttribArray(this.aPos)\n // gl.enableVertexAttribArray(this.aUv)\n // gl.vertexAttribPointer(this.aPos, 3, gl.FLOAT, false, 20, 0)\n // gl.vertexAttribPointer(this.aUv, 2, gl.FLOAT, false, 20, 12)\n\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n\n // 触发绘制\n gl.enableVertexAttribArray(this.aPos);\n gl.enableVertexAttribArray(this.aUv);\n gl.vertexAttribPointer(this.aPos, 3, gl.FLOAT, false, 20, 0);\n gl.vertexAttribPointer(this.aUv, 2, gl.FLOAT, false, 20, 12);\n gl.vertexAttrib1f(this.opa, 1);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n }\n\n //\n }, {\n key: \"drawTextByLayer\",\n value: function drawTextByLayer(item) {\n var _itemIndex = this.timeLabels.features.findIndex(function (a) {\n return a.properties.id == item.id;\n });\n if (_itemIndex < 0) {\n var _item$text3;\n this.timeLabels.features.push({\n 'type': 'Feature',\n 'properties': {\n 'id': item.id,\n 'label': item.text.label,\n 'text-color': item.text.color ? item.text.color : '#0f3ad0',\n 'text-border-color': item.text.borderColor ? item.text.borderColor : '#fff'\n },\n 'geometry': {\n 'type': 'Point',\n 'coordinates': (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(item === null || item === void 0 || (_item$text3 = item.text) === null || _item$text3 === void 0 ? void 0 : _item$text3.coord)\n }\n });\n } else {\n var _item$text4, _item$text5, _item$text6, _item$text7, _item$text8;\n this.timeLabels.features[_itemIndex] = {\n 'type': 'Feature',\n 'properties': {\n 'id': item.id,\n 'label': item.text.label,\n 'text-color': (_item$text4 = item.text) !== null && _item$text4 !== void 0 && _item$text4.color ? (_item$text5 = item.text) === null || _item$text5 === void 0 ? void 0 : _item$text5.color : '#0f3ad0',\n 'text-border-color': (_item$text6 = item.text) !== null && _item$text6 !== void 0 && _item$text6.borderColor ? (_item$text7 = item.text) === null || _item$text7 === void 0 ? void 0 : _item$text7.borderColor : '#fff'\n },\n 'geometry': {\n 'type': 'Point',\n 'coordinates': (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(item === null || item === void 0 || (_item$text8 = item.text) === null || _item$text8 === void 0 ? void 0 : _item$text8.coord)\n }\n };\n }\n }\n }, {\n key: \"removeText\",\n value: function removeText(item) {\n var _itemIndex = this.timeLabels.features.findIndex(function (a) {\n return a.properties.id == item.id;\n });\n if (_itemIndex >= 0) {\n this.timeLabels.features = this.timeLabels.features.filter(function (a) {\n return a.properties.id != item.id;\n });\n }\n }\n }, {\n key: \"drawArrayItem\",\n value: function drawArrayItem(item) {\n if (!(item !== null && item !== void 0 && item.image)) {\n return;\n }\n // if(!item?.text){\n // this.removeText(item)\n // }\n // if(item?.text?.type == 'layer'){\n // this.drawTextByLayer(item)\n // }\n // if(item?.text){\n // this.drawText(item)\n // }\n var gl = this.gl;\n if (!item.texture) {\n item.texture = gl.createTexture();\n }\n gl.bindTexture(gl.TEXTURE_2D, item.texture);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n // 上载数据\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, item.image);\n item.buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, item.buffer);\n var p1 = mapbox_gl__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MercatorCoordinate.fromLngLat({\n lng: item.coords[0][0],\n lat: item.coords[0][1]\n }, 10);\n var p2 = mapbox_gl__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MercatorCoordinate.fromLngLat({\n lng: item.coords[1][0],\n lat: item.coords[1][1]\n }, 10);\n var p3 = mapbox_gl__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MercatorCoordinate.fromLngLat({\n lng: item.coords[2][0],\n lat: item.coords[2][1]\n }, 10);\n var p4 = mapbox_gl__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MercatorCoordinate.fromLngLat({\n lng: item.coords[3][0],\n lat: item.coords[3][1]\n }, 10);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n // position, uv\n p1.x, p1.y, p1.z, 0, 0, p2.x, p2.y, p2.z, 1, 0, p3.x, p3.y, p3.z, 1, 1, p1.x, p1.y, p1.z, 0, 0, p3.x, p3.y, p3.z, 1, 1, p4.x, p4.y, p4.z, 0, 1]), gl.STATIC_DRAW);\n gl.bindTexture(gl.TEXTURE_2D, item.texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n\n // 每帧都要绑定 VBO,并启用 vertexAttributes、设置 vertexAttributes 的参数\n gl.bindBuffer(gl.ARRAY_BUFFER, item.buffer);\n // gl.enableVertexAttribArray(this.aPos)\n // gl.enableVertexAttribArray(this.aUv)\n // gl.vertexAttribPointer(this.aPos, 3, gl.FLOAT, false, 20, 0)\n // gl.vertexAttribPointer(this.aUv, 2, gl.FLOAT, false, 20, 12)\n\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n\n // 触发绘制\n gl.enableVertexAttribArray(this.aPos);\n gl.enableVertexAttribArray(this.aUv);\n gl.vertexAttribPointer(this.aPos, 3, gl.FLOAT, false, 20, 0);\n gl.vertexAttribPointer(this.aUv, 2, gl.FLOAT, false, 20, 12);\n gl.vertexAttrib1f(this.opa, 1);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n if (this.drawArray.length == 0) return;\n gl.useProgram(this.program);\n // 每帧都要传递 uniform\n gl.uniformMatrix4fv(gl.getUniformLocation(this.program, 'u_matrix'), false, matrix);\n gl.uniform1f(gl.getUniformLocation(this.program, 'opa'), this.opacity);\n this.map.getSource('timeLabels').setData(this.timeLabels);\n this.draw();\n\n // gl.useProgram(this.program)\n // // 每帧都要传递 uniform\n // gl.uniformMatrix4fv(\n // gl.getUniformLocation(this.program, 'u_matrix'),\n // false,\n // matrix\n // )\n // // 每帧都要绑定纹理参数\n // gl.bindTexture(gl.TEXTURE_2D, this.texture)\n // gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE)\n // gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE)\n // gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST)\n // gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST)\n\n // // 每帧都要绑定 VBO,并启用 vertexAttributes、设置 vertexAttributes 的参数\n // gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer)\n\n // 如果你用不着透明度,可以不执行这两行\n // gl.enable(gl.BLEND)\n // gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)\n\n // 触发绘制\n //gl.drawArrays(gl.TRIANGLES, 0, 6)\n // 每帧都要指定用哪个着色器程序 \n if (this.renderBack != null) {\n if (this.renderBack) this.renderBack();\n }\n //this.map.triggerRepaint(); \n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/ScanLayer.js?");
4928
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ ScanLayer)\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\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\nvar ScanLayer = /*#__PURE__*/function () {\n function ScanLayer(id, _scanInfo) {\n _classCallCheck(this, ScanLayer);\n _defineProperty(this, \"drawArray\", []);\n _defineProperty(this, \"defaultDrawInfo\", {\n id: '',\n image: null,\n coords: [],\n refreshTime: null\n });\n _defineProperty(this, \"opacity\", 1);\n //超时删除时间(秒)\n _defineProperty(this, \"outTime\", 300);\n _defineProperty(this, \"image\", void 0);\n _defineProperty(this, \"positionRect\", void 0);\n _defineProperty(this, \"gl\", void 0);\n _defineProperty(this, \"renderBack\", function () {});\n _defineProperty(this, \"textCtx\", null);\n _defineProperty(this, \"textLayer\", void 0);\n _defineProperty(this, \"timeLabels\", {\n 'type': 'FeatureCollection',\n 'features': []\n });\n this.id = id;\n this.type = 'custom';\n this.renderingMode = '2d';\n this.textCtx = document.createElement(\"canvas\").getContext(\"2d\");\n if (_scanInfo) {\n this.drawList(_scanInfo);\n }\n this.timeClear();\n }\n\n // 将文字放在画布中间 创建文本纹理\n return _createClass(ScanLayer, [{\n key: \"makeTextCanvas\",\n value: function makeTextCanvas(text, style) {\n var _style = {\n fontSize: 16,\n fontFamily: '',\n textAlign: 'center',\n fillStyle: '#000',\n strokeStyle: \"#fff\",\n textBaseline: 'middle',\n lineWidth: 3\n };\n var styleObj = Object.assign({}, _style, style);\n var padding = 2;\n var width = styleObj.fontSize * text.length + padding * 2;\n var height = styleObj.fontSize + padding * 2;\n this.textCtx.canvas.width = width;\n this.textCtx.canvas.height = height;\n this.textCtx.font = \"\".concat(styleObj.fontSize, \"px \").concat(styleObj.fontFamily);\n for (var i in styleObj) {\n if (i == 'fontSize' || i == 'fontFamily') {} else {\n this.textCtx[i] = styleObj[i];\n }\n }\n this.textCtx.clearRect(0, 0, width, height);\n this.textCtx.fillText(text, width / 2, height / 2);\n return this.textCtx.canvas;\n }\n }, {\n key: \"timeClear\",\n value: function timeClear() {\n setInterval(function () {\n var _this = this;\n this.drawArray = this.drawArray.filter(function (a) {\n return (new Date().getTime() - a.refreshTime.getTime()) / 1000 < _this.outTime;\n });\n }.bind(this), 1000);\n }\n // {\n // id:'',\n // image:''\n // }\n //添加图像object\n }, {\n key: \"drawList\",\n value: function drawList(_scanInfo) {\n var _this2 = this;\n var props = ['id', 'image', 'coords'];\n if (_scanInfo instanceof Array) {\n var _iterator = _createForOfIteratorHelper(_scanInfo),\n _step;\n try {\n var _loop = function _loop() {\n var _info = _step.value;\n (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.hasProperty)(_info, props);\n var currIndex = _this2.drawArray.findIndex(function (a) {\n return a.id == _info.id;\n });\n _info.coords = _info.coords.map(function (a) {\n return (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(a);\n });\n if (currIndex < 0) {\n var entity = Object.assign({}, _this2.defaultDrawInfo, _info);\n entity.refreshTime = new Date();\n _this2.drawArray.push(entity);\n if (entity.text) {\n _this2.drawTextByLayer(entity);\n } else {\n _this2.removeText(entity);\n }\n } else {\n var _entity = Object.assign({}, _this2.defaultDrawInfo, _info);\n _entity.refreshTime = new Date();\n _this2.drawArray[currIndex] = _entity;\n if (_entity.text) {\n _this2.drawTextByLayer(_entity);\n } else {\n _this2.removeText(_entity);\n }\n }\n };\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n _loop();\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n } else {\n (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.hasProperty)(_scanInfo, props);\n _scanInfo.coords = _scanInfo.coords.map(function (a) {\n return (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(a);\n });\n var currIndex = this.drawArray.findIndex(function (a) {\n return a.id == _scanInfo.id;\n });\n if (currIndex < 0) {\n var entity = Object.assign({}, this.defaultDrawInfo, _scanInfo);\n entity.refreshTime = new Date();\n this.drawArray.push(entity);\n if (entity.text) {\n this.drawTextByLayer(entity);\n } else {\n this.removeText(entity);\n }\n } else {\n var _entity2 = Object.assign({}, this.defaultDrawInfo, _scanInfo);\n _entity2.refreshTime = new Date();\n this.drawArray[currIndex] = _entity2;\n if (_entity2.text) {\n this.drawTextByLayer(_entity2);\n } else {\n this.removeText(_entity2);\n }\n }\n }\n }\n }, {\n key: \"del\",\n value: function del(id) {\n this.drawArray = this.drawArray.filter(function (a) {\n return a.id != id;\n });\n }\n }, {\n key: \"onAdd\",\n value: function onAdd(map, gl) {\n //两个着色器\n // const vertexSource = `\n // uniform mat4 u_matrix;\n // void main() {\n // gl_Position = u_matrix * vec4(0.5, 0.5, 0.0, 1.0);\n // gl_PointSize = 20.0;\n // }`;\n\n // const fragmentSource = `\n // void main() {\n // gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);\n // }`;\n\n var vertexSource = \"\\n uniform mat4 u_matrix;\\n attribute vec3 a_pos;\\n attribute vec2 a_uv;\\n varying vec2 v_uv;\\n void main() {\\n v_uv = a_uv;\\n gl_Position = u_matrix * vec4(a_pos, 1.0);\\n } \\n \";\n var fragmentSource = \"\\n precision mediump float;\\n uniform float opa;\\n varying vec2 v_uv;\\n uniform sampler2D u_sampler;\\n void main() {\\n gl_FragColor = texture2D(u_sampler , v_uv) * opa;\\n }\\n \";\n var vertexShader = gl.createShader(gl.VERTEX_SHADER);\n gl.shaderSource(vertexShader, vertexSource);\n gl.compileShader(vertexShader);\n var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);\n gl.shaderSource(fragmentShader, fragmentSource);\n gl.compileShader(fragmentShader);\n this.program = gl.createProgram();\n gl.attachShader(this.program, vertexShader);\n gl.attachShader(this.program, fragmentShader);\n gl.linkProgram(this.program);\n this.aPos = gl.getAttribLocation(this.program, 'a_pos');\n this.aUv = gl.getAttribLocation(this.program, 'a_uv');\n this.opa = gl.getAttribLocation(this.program, 'opa');\n this.uSamplerLoc = gl.getUniformLocation(this.program, 'u_sampler');\n this.gl = gl;\n this.map = map;\n //添加时间图层 消耗内存大 废弃\n var timeTextLayer = this.map.getLayer('timeLabelLayer');\n if (!this.map.getSource('timeLabels')) {\n this.map.addSource('timeLabels', {\n 'type': 'geojson',\n 'data': this.timeLabels,\n 'dynamic': true\n });\n }\n if (!timeTextLayer) {\n this.map.addLayer({\n 'id': 'timeLabelLayer',\n 'type': 'symbol',\n 'source': 'timeLabels',\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 timeTextLayer = this.map.getLayer('timeLabelLayer');\n }\n }\n }, {\n key: \"draw\",\n value: function draw() {\n for (var i in this.drawArray) {\n this.drawArrayItem(this.drawArray[i]);\n }\n }\n }, {\n key: \"drawText\",\n value: function drawText(item) {\n var _item$text, _item$text2;\n var gl = this.gl;\n var scale = 12;\n if (!item.textTextture) {\n item.textTextture = gl.createTexture();\n }\n var center = item.coords[3]; //transform(item.center)\n gl.bindTexture(gl.TEXTURE_2D, item.textTextture);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n var textCanvas = this.makeTextCanvas((_item$text = item.text) === null || _item$text === void 0 ? void 0 : _item$text.label, item === null || item === void 0 || (_item$text2 = item.text) === null || _item$text2 === void 0 ? void 0 : _item$text2.textStyle);\n if (!textCanvas) {\n return;\n }\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, textCanvas);\n item.textBuffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, item.textBuffer);\n var p1 = _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MercatorCoordinate.fromLngLat({\n lng: center[0],\n lat: center[1]\n }, 10);\n var p2 = _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MercatorCoordinate.fromLngLat({\n lng: center[0] + 0.03 * scale,\n lat: center[1]\n }, 10);\n var p3 = _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MercatorCoordinate.fromLngLat({\n lng: center[0] + 0.03 * scale,\n lat: center[1] + 0.001 * scale\n }, 10);\n var p4 = _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MercatorCoordinate.fromLngLat({\n lng: center[0],\n lat: center[1] + 0.001 * scale\n }, 10);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n // position, uv\n p1.x, p1.y, p1.z, 0, 0, p2.x, p2.y, p2.z, 1, 0, p3.x, p3.y, p3.z, 1, 1, p1.x, p1.y, p1.z, 0, 0, p3.x, p3.y, p3.z, 1, 1, p4.x, p4.y, p4.z, 0, 1]), gl.STATIC_DRAW);\n gl.bindTexture(gl.TEXTURE_2D, item.textTextture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n\n // 每帧都要绑定 VBO,并启用 vertexAttributes、设置 vertexAttributes 的参数\n gl.bindBuffer(gl.ARRAY_BUFFER, item.textBuffer);\n // gl.enableVertexAttribArray(this.aPos)\n // gl.enableVertexAttribArray(this.aUv)\n // gl.vertexAttribPointer(this.aPos, 3, gl.FLOAT, false, 20, 0)\n // gl.vertexAttribPointer(this.aUv, 2, gl.FLOAT, false, 20, 12)\n\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n\n // 触发绘制\n gl.enableVertexAttribArray(this.aPos);\n gl.enableVertexAttribArray(this.aUv);\n gl.vertexAttribPointer(this.aPos, 3, gl.FLOAT, false, 20, 0);\n gl.vertexAttribPointer(this.aUv, 2, gl.FLOAT, false, 20, 12);\n gl.vertexAttrib1f(this.opa, 1);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n }\n\n //\n }, {\n key: \"drawTextByLayer\",\n value: function drawTextByLayer(item) {\n var _itemIndex = this.timeLabels.features.findIndex(function (a) {\n return a.properties.id == item.id;\n });\n if (_itemIndex < 0) {\n var _item$text3;\n this.timeLabels.features.push({\n 'type': 'Feature',\n 'properties': {\n 'id': item.id,\n 'label': item.text.label,\n 'text-color': item.text.color ? item.text.color : '#0f3ad0',\n 'text-border-color': item.text.borderColor ? item.text.borderColor : '#fff'\n },\n 'geometry': {\n 'type': 'Point',\n 'coordinates': (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(item === null || item === void 0 || (_item$text3 = item.text) === null || _item$text3 === void 0 ? void 0 : _item$text3.coord)\n }\n });\n } else {\n var _item$text4, _item$text5, _item$text6, _item$text7, _item$text8;\n this.timeLabels.features[_itemIndex] = {\n 'type': 'Feature',\n 'properties': {\n 'id': item.id,\n 'label': item.text.label,\n 'text-color': (_item$text4 = item.text) !== null && _item$text4 !== void 0 && _item$text4.color ? (_item$text5 = item.text) === null || _item$text5 === void 0 ? void 0 : _item$text5.color : '#0f3ad0',\n 'text-border-color': (_item$text6 = item.text) !== null && _item$text6 !== void 0 && _item$text6.borderColor ? (_item$text7 = item.text) === null || _item$text7 === void 0 ? void 0 : _item$text7.borderColor : '#fff'\n },\n 'geometry': {\n 'type': 'Point',\n 'coordinates': (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(item === null || item === void 0 || (_item$text8 = item.text) === null || _item$text8 === void 0 ? void 0 : _item$text8.coord)\n }\n };\n }\n }\n }, {\n key: \"removeText\",\n value: function removeText(item) {\n var _itemIndex = this.timeLabels.features.findIndex(function (a) {\n return a.properties.id == item.id;\n });\n if (_itemIndex >= 0) {\n this.timeLabels.features = this.timeLabels.features.filter(function (a) {\n return a.properties.id != item.id;\n });\n }\n }\n }, {\n key: \"drawArrayItem\",\n value: function drawArrayItem(item) {\n if (!(item !== null && item !== void 0 && item.image)) {\n return;\n }\n // if(!item?.text){\n // this.removeText(item)\n // }\n // if(item?.text?.type == 'layer'){\n // this.drawTextByLayer(item)\n // }\n // if(item?.text){\n // this.drawText(item)\n // }\n var gl = this.gl;\n if (!item.texture) {\n item.texture = gl.createTexture();\n }\n gl.bindTexture(gl.TEXTURE_2D, item.texture);\n gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, true);\n // 上载数据\n gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, item.image);\n item.buffer = gl.createBuffer();\n gl.bindBuffer(gl.ARRAY_BUFFER, item.buffer);\n var p1 = _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MercatorCoordinate.fromLngLat({\n lng: item.coords[0][0],\n lat: item.coords[0][1]\n }, 10);\n var p2 = _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MercatorCoordinate.fromLngLat({\n lng: item.coords[1][0],\n lat: item.coords[1][1]\n }, 10);\n var p3 = _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MercatorCoordinate.fromLngLat({\n lng: item.coords[2][0],\n lat: item.coords[2][1]\n }, 10);\n var p4 = _lib_mapbox_gl_dist_mapbox_gl_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MercatorCoordinate.fromLngLat({\n lng: item.coords[3][0],\n lat: item.coords[3][1]\n }, 10);\n gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([\n // position, uv\n p1.x, p1.y, p1.z, 0, 0, p2.x, p2.y, p2.z, 1, 0, p3.x, p3.y, p3.z, 1, 1, p1.x, p1.y, p1.z, 0, 0, p3.x, p3.y, p3.z, 1, 1, p4.x, p4.y, p4.z, 0, 1]), gl.STATIC_DRAW);\n gl.bindTexture(gl.TEXTURE_2D, item.texture);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n\n // 每帧都要绑定 VBO,并启用 vertexAttributes、设置 vertexAttributes 的参数\n gl.bindBuffer(gl.ARRAY_BUFFER, item.buffer);\n // gl.enableVertexAttribArray(this.aPos)\n // gl.enableVertexAttribArray(this.aUv)\n // gl.vertexAttribPointer(this.aPos, 3, gl.FLOAT, false, 20, 0)\n // gl.vertexAttribPointer(this.aUv, 2, gl.FLOAT, false, 20, 12)\n\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA);\n\n // 触发绘制\n gl.enableVertexAttribArray(this.aPos);\n gl.enableVertexAttribArray(this.aUv);\n gl.vertexAttribPointer(this.aPos, 3, gl.FLOAT, false, 20, 0);\n gl.vertexAttribPointer(this.aUv, 2, gl.FLOAT, false, 20, 12);\n gl.vertexAttrib1f(this.opa, 1);\n gl.drawArrays(gl.TRIANGLES, 0, 6);\n }\n }, {\n key: \"render\",\n value: function render(gl, matrix) {\n if (this.drawArray.length == 0) return;\n gl.useProgram(this.program);\n // 每帧都要传递 uniform\n gl.uniformMatrix4fv(gl.getUniformLocation(this.program, 'u_matrix'), false, matrix);\n gl.uniform1f(gl.getUniformLocation(this.program, 'opa'), this.opacity);\n this.map.getSource('timeLabels').setData(this.timeLabels);\n this.draw();\n\n // gl.useProgram(this.program)\n // // 每帧都要传递 uniform\n // gl.uniformMatrix4fv(\n // gl.getUniformLocation(this.program, 'u_matrix'),\n // false,\n // matrix\n // )\n // // 每帧都要绑定纹理参数\n // gl.bindTexture(gl.TEXTURE_2D, this.texture)\n // gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE)\n // gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE)\n // gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST)\n // gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST)\n\n // // 每帧都要绑定 VBO,并启用 vertexAttributes、设置 vertexAttributes 的参数\n // gl.bindBuffer(gl.ARRAY_BUFFER, this.buffer)\n\n // 如果你用不着透明度,可以不执行这两行\n // gl.enable(gl.BLEND)\n // gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)\n\n // 触发绘制\n //gl.drawArrays(gl.TRIANGLES, 0, 6)\n // 每帧都要指定用哪个着色器程序 \n if (this.renderBack != null) {\n if (this.renderBack) this.renderBack();\n }\n //this.map.triggerRepaint(); \n }\n }]);\n}();\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/layer/ScanLayer.js?");
4929
4929
 
4930
4930
  /***/ }),
4931
4931
 
@@ -4947,7 +4947,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
4947
4947
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
4948
4948
 
4949
4949
  "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 _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 drawImageList(list) {\n var _this = this;\n for (var i in list) {\n this.update(list[i]);\n //this.drawArray.push(list[i])\n }\n var _loop = function _loop(_i) {\n var _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 };\n for (var _i in this.drawArray) {\n _loop(_i);\n }\n this.drawArray = this.drawArray.filter(function (a) {\n return a;\n });\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 update(point) {\n var texture;\n point.text = point.text ? point.text : '';\n if (point.image) {\n var _w = point.distance * point.rp * 2;\n var 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 } 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 //texture.flipX = true; \n var 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 var _point = this.drawArray[index];\n _point.mesh.model.material.map = texture;\n _point.mesh.label.element.innerHTML = point.text;\n } else {\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 mesh.label.element.innerHTML = point.text;\n point.mesh = mesh;\n this.drawArray.push(point);\n }\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?");
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?");
4951
4951
 
4952
4952
  /***/ }),
4953
4953
 
@@ -5068,7 +5068,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
5068
5068
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5069
5069
 
5070
5070
  "use strict";
5071
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GetPointByRawData: () => (/* binding */ GetPointByRawData),\n/* harmony export */ dataURLtoBlob: () => (/* binding */ dataURLtoBlob),\n/* harmony export */ downloadFile: () => (/* binding */ downloadFile),\n/* harmony export */ downloadFileByBase64: () => (/* binding */ downloadFileByBase64),\n/* harmony export */ downloadFileByBlob: () => (/* binding */ downloadFileByBlob),\n/* harmony export */ getBBox: () => (/* binding */ getBBox),\n/* harmony export */ getLayerMapPosition: () => (/* binding */ getLayerMapPosition),\n/* harmony export */ getPointDistance: () => (/* binding */ getPointDistance),\n/* harmony export */ guid: () => (/* binding */ guid),\n/* harmony export */ hasProperty: () => (/* binding */ hasProperty),\n/* harmony export */ midPoint: () => (/* binding */ midPoint),\n/* harmony export */ sleep: () => (/* binding */ sleep),\n/* harmony export */ transform: () => (/* binding */ transform)\n/* harmony export */ });\n/* harmony import */ var gcoord__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gcoord */ \"./node_modules/gcoord/dist/gcoord.esm-bundler.js\");\n/* harmony import */ var _turf_turf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/turf */ \"./node_modules/@turf/turf/dist/es/index.js\");\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\n\n\nfunction getBBox(pointList) {\n var line = _turf_turf__WEBPACK_IMPORTED_MODULE_0__.lineString(pointList);\n return _turf_turf__WEBPACK_IMPORTED_MODULE_0__.bbox(line);\n}\nfunction getPointDistance(point1, point2) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n units: \"kilometers\"\n };\n var from = _turf_turf__WEBPACK_IMPORTED_MODULE_0__.point(point1);\n var to = _turf_turf__WEBPACK_IMPORTED_MODULE_0__.point(point2);\n return _turf_turf__WEBPACK_IMPORTED_MODULE_0__.distance(from, to, options);\n}\nfunction transform(lnglat, r) {\n var coord1 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : gcoord__WEBPACK_IMPORTED_MODULE_1__[\"default\"].WGS84;\n var coord2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : gcoord__WEBPACK_IMPORTED_MODULE_1__[\"default\"].GCJ02;\n if (r) {\n return gcoord__WEBPACK_IMPORTED_MODULE_1__[\"default\"].transform(lnglat, coord1, coord2);\n }\n return gcoord__WEBPACK_IMPORTED_MODULE_1__[\"default\"].transform(lnglat, coord2, coord1);\n}\nfunction midPoint(lnglat1, lnglat2) {\n var point1 = _turf_turf__WEBPACK_IMPORTED_MODULE_0__.point(lnglat1);\n var point2 = _turf_turf__WEBPACK_IMPORTED_MODULE_0__.point(lnglat2);\n return _turf_turf__WEBPACK_IMPORTED_MODULE_0__.midpoint(point1, point2);\n}\nfunction hasProperty(object, props) {\n if (props.length == 0) throw new Error('parmas props length is 0');\n var _iterator = _createForOfIteratorHelper(props),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var prop = _step.value;\n if (!object.hasOwnProperty(prop)) {\n throw new Error(\"object property not contain \".concat(prop));\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n}\nfunction GetPointByRawData(origin, distance, vAngle, hAngle) {\n var num = 6371.137;\n var d = origin.lat * Math.PI / 180;\n var num2 = origin.lng * Math.PI / 180;\n var d2 = Math.round(distance * Math.cos(vAngle * Math.PI / 180) * 1000) / 1000 / num;\n var mapPoint = {};\n var d3 = hAngle * Math.PI / 180;\n mapPoint.lat = Math.asin(Math.sin(d) * Math.cos(d2) + Math.cos(d) * Math.sin(d2) * Math.cos(d3));\n mapPoint.lng = (num2 + Math.atan2(Math.sin(d3) * Math.sin(d2) * Math.cos(d), Math.cos(d2) - Math.sin(d) * Math.sin(mapPoint.lat))) * 180 / Math.PI;\n mapPoint.lat = mapPoint.lat * 180 / Math.PI;\n return mapPoint;\n}\nfunction getLayerMapPosition(scanDis, center) {\n var vAngle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 90;\n var r = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 600 / 600;\n var dis = scanDis * Math.sqrt(2) * r; // 斜边长度(公里) \n var leftTop = GetPointByRawData({\n lng: center[0],\n lat: center[1]\n }, dis, vAngle - 90, 225);\n var rightBottom = GetPointByRawData({\n lng: center[0],\n lat: center[1]\n }, dis, vAngle - 90, 45);\n var bounds = [[leftTop.lng, leftTop.lat], [rightBottom.lng, leftTop.lat], [rightBottom.lng, rightBottom.lat], [leftTop.lng, rightBottom.lat]];\n return bounds;\n}\nfunction dataURLtoBlob(dataurl) {\n var arr = dataurl.split(','),\n mime = arr[0].match(/:(.*?);/)[1],\n bstr = atob(arr[1]),\n n = bstr.length,\n u8arr = new Uint8Array(n);\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n return new Blob([u8arr], {\n type: mime\n });\n}\nfunction downloadFile(url, name) {\n var a = document.createElement(\"a\");\n a.setAttribute(\"href\", url);\n a.setAttribute(\"download\", name);\n a.setAttribute(\"target\", \"_blank\");\n var clickEvent = document.createEvent(\"MouseEvents\");\n clickEvent.initEvent(\"click\", true, true);\n a.dispatchEvent(clickEvent);\n}\nfunction downloadFileByBlob(blob, name) {\n var url = window.URL.createObjectURL(blob); // 生成文件在浏览器中的链接\n var a = document.createElement('a');\n a.href = url;\n a.download = name; // 文件名\n a.style.display = 'none';\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url); // 清除文件链接\n}\nfunction downloadFileByBase64(base64, name) {\n var myBlob = dataURLtoBlob(base64);\n var myUrl = URL.createObjectURL(myBlob);\n downloadFile(myUrl, name);\n}\n\n/**\r\n* 生成GUID\r\n*/\nfunction guid() {\n function S4() {\n return ((1 + Math.random()) * 0x10000 | 0).toString(16).substring(1);\n }\n return S4() + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + S4() + S4();\n}\nfunction sleep(ms) {\n return new Promise(function (resolve) {\n return setTimeout(resolve, ms);\n });\n}\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/utils/util.js?");
5071
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GetPointByRawData: () => (/* binding */ GetPointByRawData),\n/* harmony export */ dataURLtoBlob: () => (/* binding */ dataURLtoBlob),\n/* harmony export */ downloadFile: () => (/* binding */ downloadFile),\n/* harmony export */ downloadFileBlobByBase64: () => (/* binding */ downloadFileBlobByBase64),\n/* harmony export */ downloadFileByBase64: () => (/* binding */ downloadFileByBase64),\n/* harmony export */ downloadFileByBlob: () => (/* binding */ downloadFileByBlob),\n/* harmony export */ getBBox: () => (/* binding */ getBBox),\n/* harmony export */ getLayerMapPosition: () => (/* binding */ getLayerMapPosition),\n/* harmony export */ getPointDistance: () => (/* binding */ getPointDistance),\n/* harmony export */ guid: () => (/* binding */ guid),\n/* harmony export */ hasProperty: () => (/* binding */ hasProperty),\n/* harmony export */ midPoint: () => (/* binding */ midPoint),\n/* harmony export */ sleep: () => (/* binding */ sleep),\n/* harmony export */ transform: () => (/* binding */ transform)\n/* harmony export */ });\n/* harmony import */ var gcoord__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gcoord */ \"./node_modules/gcoord/dist/gcoord.esm-bundler.js\");\n/* harmony import */ var _turf_turf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @turf/turf */ \"./node_modules/@turf/turf/dist/es/index.js\");\nfunction _createForOfIteratorHelper(r, e) { var t = \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && \"number\" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t[\"return\"] || t[\"return\"](); } finally { if (u) throw o; } } }; }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\n\n\nfunction getBBox(pointList) {\n var line = _turf_turf__WEBPACK_IMPORTED_MODULE_0__.lineString(pointList);\n return _turf_turf__WEBPACK_IMPORTED_MODULE_0__.bbox(line);\n}\nfunction getPointDistance(point1, point2) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\n units: \"kilometers\"\n };\n var from = _turf_turf__WEBPACK_IMPORTED_MODULE_0__.point(point1);\n var to = _turf_turf__WEBPACK_IMPORTED_MODULE_0__.point(point2);\n return _turf_turf__WEBPACK_IMPORTED_MODULE_0__.distance(from, to, options);\n}\nfunction transform(lnglat, r) {\n var coord1 = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : gcoord__WEBPACK_IMPORTED_MODULE_1__[\"default\"].WGS84;\n var coord2 = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : gcoord__WEBPACK_IMPORTED_MODULE_1__[\"default\"].GCJ02;\n if (r) {\n return gcoord__WEBPACK_IMPORTED_MODULE_1__[\"default\"].transform(lnglat, coord1, coord2);\n }\n return gcoord__WEBPACK_IMPORTED_MODULE_1__[\"default\"].transform(lnglat, coord2, coord1);\n}\nfunction midPoint(lnglat1, lnglat2) {\n var point1 = _turf_turf__WEBPACK_IMPORTED_MODULE_0__.point(lnglat1);\n var point2 = _turf_turf__WEBPACK_IMPORTED_MODULE_0__.point(lnglat2);\n return _turf_turf__WEBPACK_IMPORTED_MODULE_0__.midpoint(point1, point2);\n}\nfunction hasProperty(object, props) {\n if (props.length == 0) throw new Error('parmas props length is 0');\n var _iterator = _createForOfIteratorHelper(props),\n _step;\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var prop = _step.value;\n if (!object.hasOwnProperty(prop)) {\n throw new Error(\"object property not contain \".concat(prop));\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n}\nfunction GetPointByRawData(origin, distance, vAngle, hAngle) {\n var num = 6371.137;\n var d = origin.lat * Math.PI / 180;\n var num2 = origin.lng * Math.PI / 180;\n var d2 = Math.round(distance * Math.cos(vAngle * Math.PI / 180) * 1000) / 1000 / num;\n var mapPoint = {};\n var d3 = hAngle * Math.PI / 180;\n mapPoint.lat = Math.asin(Math.sin(d) * Math.cos(d2) + Math.cos(d) * Math.sin(d2) * Math.cos(d3));\n mapPoint.lng = (num2 + Math.atan2(Math.sin(d3) * Math.sin(d2) * Math.cos(d), Math.cos(d2) - Math.sin(d) * Math.sin(mapPoint.lat))) * 180 / Math.PI;\n mapPoint.lat = mapPoint.lat * 180 / Math.PI;\n return mapPoint;\n}\nfunction getLayerMapPosition(scanDis, center) {\n var vAngle = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 90;\n var r = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 600 / 600;\n var dis = scanDis * Math.sqrt(2) * r; // 斜边长度(公里) \n var leftTop = GetPointByRawData({\n lng: center[0],\n lat: center[1]\n }, dis, vAngle - 90, 225);\n var rightBottom = GetPointByRawData({\n lng: center[0],\n lat: center[1]\n }, dis, vAngle - 90, 45);\n var bounds = [[leftTop.lng, leftTop.lat], [rightBottom.lng, leftTop.lat], [rightBottom.lng, rightBottom.lat], [leftTop.lng, rightBottom.lat]];\n return bounds;\n}\nfunction dataURLtoBlob(dataurl) {\n var arr = dataurl.split(','),\n mime = arr[0].match(/:(.*?);/)[1],\n bstr = atob(arr[1]),\n n = bstr.length,\n u8arr = new Uint8Array(n);\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n return new Blob([u8arr], {\n type: mime\n });\n}\nfunction downloadFile(url, name) {\n var a = document.createElement(\"a\");\n a.setAttribute(\"href\", url);\n a.setAttribute(\"download\", name);\n a.setAttribute(\"target\", \"_blank\");\n var clickEvent = document.createEvent(\"MouseEvents\");\n clickEvent.initEvent(\"click\", true, true);\n a.dispatchEvent(clickEvent);\n}\nfunction downloadFileByBlob(blob, name) {\n var url = window.URL.createObjectURL(blob); // 生成文件在浏览器中的链接\n var a = document.createElement('a');\n a.href = url;\n a.download = name; // 文件名\n a.style.display = 'none';\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n window.URL.revokeObjectURL(url); // 清除文件链接\n}\nfunction downloadFileByBase64(base64, name) {\n var myBlob = dataURLtoBlob(base64);\n var myUrl = URL.createObjectURL(myBlob);\n downloadFile(myUrl, name);\n}\nfunction downloadFileBlobByBase64(base64) {\n return dataURLtoBlob(base64);\n}\n\n/**\r\n* 生成GUID\r\n*/\nfunction guid() {\n function S4() {\n return ((1 + Math.random()) * 0x10000 | 0).toString(16).substring(1);\n }\n return S4() + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + S4() + S4();\n}\nfunction sleep(ms) {\n return new Promise(function (resolve) {\n return setTimeout(resolve, ms);\n });\n}\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/utils/util.js?");
5072
5072
 
5073
5073
  /***/ }),
5074
5074
 
@@ -13796,6 +13796,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
13796
13796
 
13797
13797
  /***/ }),
13798
13798
 
13799
+ /***/ "./node_modules/three/examples/jsm/controls/OrbitControls.js":
13800
+ /*!*******************************************************************!*\
13801
+ !*** ./node_modules/three/examples/jsm/controls/OrbitControls.js ***!
13802
+ \*******************************************************************/
13803
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13804
+
13805
+ "use strict";
13806
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ OrbitControls: () => (/* binding */ OrbitControls)\n/* harmony export */ });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\n\n// OrbitControls performs orbiting, dollying (zooming), and panning.\n// Unlike TrackballControls, it maintains the \"up\" direction object.up (+Y by default).\n//\n// Orbit - left mouse / touch: one-finger move\n// Zoom - middle mouse, or mousewheel / touch: two-finger spread or squish\n// Pan - right mouse, or left mouse + ctrl/meta/shiftKey, or arrow keys / touch: two-finger move\n\nconst _changeEvent = { type: 'change' };\nconst _startEvent = { type: 'start' };\nconst _endEvent = { type: 'end' };\nconst _ray = new three__WEBPACK_IMPORTED_MODULE_0__.Ray();\nconst _plane = new three__WEBPACK_IMPORTED_MODULE_0__.Plane();\nconst _TILT_LIMIT = Math.cos( 70 * three__WEBPACK_IMPORTED_MODULE_0__.MathUtils.DEG2RAD );\n\nconst _v = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3();\nconst _twoPI = 2 * Math.PI;\n\nconst _STATE = {\n\tNONE: - 1,\n\tROTATE: 0,\n\tDOLLY: 1,\n\tPAN: 2,\n\tTOUCH_ROTATE: 3,\n\tTOUCH_PAN: 4,\n\tTOUCH_DOLLY_PAN: 5,\n\tTOUCH_DOLLY_ROTATE: 6\n};\nconst _EPS = 0.000001;\n\nclass OrbitControls extends three__WEBPACK_IMPORTED_MODULE_0__.Controls {\n\n\tconstructor( object, domElement = null ) {\n\n\t\tsuper( object, domElement );\n\n\t\tthis.state = _STATE.NONE;\n\n\t\t// Set to false to disable this control\n\t\tthis.enabled = true;\n\n\t\t// \"target\" sets the location of focus, where the object orbits around\n\t\tthis.target = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3();\n\n\t\t// Sets the 3D cursor (similar to Blender), from which the maxTargetRadius takes effect\n\t\tthis.cursor = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3();\n\n\t\t// How far you can dolly in and out ( PerspectiveCamera only )\n\t\tthis.minDistance = 0;\n\t\tthis.maxDistance = Infinity;\n\n\t\t// How far you can zoom in and out ( OrthographicCamera only )\n\t\tthis.minZoom = 0;\n\t\tthis.maxZoom = Infinity;\n\n\t\t// Limit camera target within a spherical area around the cursor\n\t\tthis.minTargetRadius = 0;\n\t\tthis.maxTargetRadius = Infinity;\n\n\t\t// How far you can orbit vertically, upper and lower limits.\n\t\t// Range is 0 to Math.PI radians.\n\t\tthis.minPolarAngle = 0; // radians\n\t\tthis.maxPolarAngle = Math.PI; // radians\n\n\t\t// How far you can orbit horizontally, upper and lower limits.\n\t\t// If set, the interval [ min, max ] must be a sub-interval of [ - 2 PI, 2 PI ], with ( max - min < 2 PI )\n\t\tthis.minAzimuthAngle = - Infinity; // radians\n\t\tthis.maxAzimuthAngle = Infinity; // radians\n\n\t\t// Set to true to enable damping (inertia)\n\t\t// If damping is enabled, you must call controls.update() in your animation loop\n\t\tthis.enableDamping = false;\n\t\tthis.dampingFactor = 0.05;\n\n\t\t// This option actually enables dollying in and out; left as \"zoom\" for backwards compatibility.\n\t\t// Set to false to disable zooming\n\t\tthis.enableZoom = true;\n\t\tthis.zoomSpeed = 1.0;\n\n\t\t// Set to false to disable rotating\n\t\tthis.enableRotate = true;\n\t\tthis.rotateSpeed = 1.0;\n\n\t\t// Set to false to disable panning\n\t\tthis.enablePan = true;\n\t\tthis.panSpeed = 1.0;\n\t\tthis.screenSpacePanning = true; // if false, pan orthogonal to world-space direction camera.up\n\t\tthis.keyPanSpeed = 7.0;\t// pixels moved per arrow key push\n\t\tthis.zoomToCursor = false;\n\n\t\t// Set to true to automatically rotate around the target\n\t\t// If auto-rotate is enabled, you must call controls.update() in your animation loop\n\t\tthis.autoRotate = false;\n\t\tthis.autoRotateSpeed = 2.0; // 30 seconds per orbit when fps is 60\n\n\t\t// The four arrow keys\n\t\tthis.keys = { LEFT: 'ArrowLeft', UP: 'ArrowUp', RIGHT: 'ArrowRight', BOTTOM: 'ArrowDown' };\n\n\t\t// Mouse buttons\n\t\tthis.mouseButtons = { LEFT: three__WEBPACK_IMPORTED_MODULE_0__.MOUSE.ROTATE, MIDDLE: three__WEBPACK_IMPORTED_MODULE_0__.MOUSE.DOLLY, RIGHT: three__WEBPACK_IMPORTED_MODULE_0__.MOUSE.PAN };\n\n\t\t// Touch fingers\n\t\tthis.touches = { ONE: three__WEBPACK_IMPORTED_MODULE_0__.TOUCH.ROTATE, TWO: three__WEBPACK_IMPORTED_MODULE_0__.TOUCH.DOLLY_PAN };\n\n\t\t// for reset\n\t\tthis.target0 = this.target.clone();\n\t\tthis.position0 = this.object.position.clone();\n\t\tthis.zoom0 = this.object.zoom;\n\n\t\t// the target DOM element for key events\n\t\tthis._domElementKeyEvents = null;\n\n\t\t// internals\n\n\t\tthis._lastPosition = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3();\n\t\tthis._lastQuaternion = new three__WEBPACK_IMPORTED_MODULE_0__.Quaternion();\n\t\tthis._lastTargetPosition = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3();\n\n\t\t// so camera.up is the orbit axis\n\t\tthis._quat = new three__WEBPACK_IMPORTED_MODULE_0__.Quaternion().setFromUnitVectors( object.up, new three__WEBPACK_IMPORTED_MODULE_0__.Vector3( 0, 1, 0 ) );\n\t\tthis._quatInverse = this._quat.clone().invert();\n\n\t\t// current position in spherical coordinates\n\t\tthis._spherical = new three__WEBPACK_IMPORTED_MODULE_0__.Spherical();\n\t\tthis._sphericalDelta = new three__WEBPACK_IMPORTED_MODULE_0__.Spherical();\n\n\t\tthis._scale = 1;\n\t\tthis._panOffset = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3();\n\n\t\tthis._rotateStart = new three__WEBPACK_IMPORTED_MODULE_0__.Vector2();\n\t\tthis._rotateEnd = new three__WEBPACK_IMPORTED_MODULE_0__.Vector2();\n\t\tthis._rotateDelta = new three__WEBPACK_IMPORTED_MODULE_0__.Vector2();\n\n\t\tthis._panStart = new three__WEBPACK_IMPORTED_MODULE_0__.Vector2();\n\t\tthis._panEnd = new three__WEBPACK_IMPORTED_MODULE_0__.Vector2();\n\t\tthis._panDelta = new three__WEBPACK_IMPORTED_MODULE_0__.Vector2();\n\n\t\tthis._dollyStart = new three__WEBPACK_IMPORTED_MODULE_0__.Vector2();\n\t\tthis._dollyEnd = new three__WEBPACK_IMPORTED_MODULE_0__.Vector2();\n\t\tthis._dollyDelta = new three__WEBPACK_IMPORTED_MODULE_0__.Vector2();\n\n\t\tthis._dollyDirection = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3();\n\t\tthis._mouse = new three__WEBPACK_IMPORTED_MODULE_0__.Vector2();\n\t\tthis._performCursorZoom = false;\n\n\t\tthis._pointers = [];\n\t\tthis._pointerPositions = {};\n\n\t\tthis._controlActive = false;\n\n\t\t// event listeners\n\n\t\tthis._onPointerMove = onPointerMove.bind( this );\n\t\tthis._onPointerDown = onPointerDown.bind( this );\n\t\tthis._onPointerUp = onPointerUp.bind( this );\n\t\tthis._onContextMenu = onContextMenu.bind( this );\n\t\tthis._onMouseWheel = onMouseWheel.bind( this );\n\t\tthis._onKeyDown = onKeyDown.bind( this );\n\n\t\tthis._onTouchStart = onTouchStart.bind( this );\n\t\tthis._onTouchMove = onTouchMove.bind( this );\n\n\t\tthis._onMouseDown = onMouseDown.bind( this );\n\t\tthis._onMouseMove = onMouseMove.bind( this );\n\n\t\tthis._interceptControlDown = interceptControlDown.bind( this );\n\t\tthis._interceptControlUp = interceptControlUp.bind( this );\n\n\t\t//\n\n\t\tif ( this.domElement !== null ) {\n\n\t\t\tthis.connect();\n\n\t\t}\n\n\t\tthis.update();\n\n\t}\n\n\tconnect() {\n\n\t\tthis.domElement.addEventListener( 'pointerdown', this._onPointerDown );\n\t\tthis.domElement.addEventListener( 'pointercancel', this._onPointerUp );\n\n\t\tthis.domElement.addEventListener( 'contextmenu', this._onContextMenu );\n\t\tthis.domElement.addEventListener( 'wheel', this._onMouseWheel, { passive: false } );\n\n\t\tconst document = this.domElement.getRootNode(); // offscreen canvas compatibility\n\t\tdocument.addEventListener( 'keydown', this._interceptControlDown, { passive: true, capture: true } );\n\n\t\tthis.domElement.style.touchAction = 'none'; // disable touch scroll\n\n\t}\n\n\tdisconnect() {\n\n\t\tthis.domElement.removeEventListener( 'pointerdown', this._onPointerDown );\n\t\tthis.domElement.removeEventListener( 'pointermove', this._onPointerMove );\n\t\tthis.domElement.removeEventListener( 'pointerup', this._onPointerUp );\n\t\tthis.domElement.removeEventListener( 'pointercancel', this._onPointerUp );\n\n\t\tthis.domElement.removeEventListener( 'wheel', this._onMouseWheel );\n\t\tthis.domElement.removeEventListener( 'contextmenu', this._onContextMenu );\n\n\t\tthis.stopListenToKeyEvents();\n\n\t\tconst document = this.domElement.getRootNode(); // offscreen canvas compatibility\n\t\tdocument.removeEventListener( 'keydown', this._interceptControlDown, { capture: true } );\n\n\t\tthis.domElement.style.touchAction = 'auto';\n\n\t}\n\n\tdispose() {\n\n\t\tthis.disconnect();\n\n\t}\n\n\tgetPolarAngle() {\n\n\t\treturn this._spherical.phi;\n\n\t}\n\n\tgetAzimuthalAngle() {\n\n\t\treturn this._spherical.theta;\n\n\t}\n\n\tgetDistance() {\n\n\t\treturn this.object.position.distanceTo( this.target );\n\n\t}\n\n\tlistenToKeyEvents( domElement ) {\n\n\t\tdomElement.addEventListener( 'keydown', this._onKeyDown );\n\t\tthis._domElementKeyEvents = domElement;\n\n\t}\n\n\tstopListenToKeyEvents() {\n\n\t\tif ( this._domElementKeyEvents !== null ) {\n\n\t\t\tthis._domElementKeyEvents.removeEventListener( 'keydown', this._onKeyDown );\n\t\t\tthis._domElementKeyEvents = null;\n\n\t\t}\n\n\t}\n\n\tsaveState() {\n\n\t\tthis.target0.copy( this.target );\n\t\tthis.position0.copy( this.object.position );\n\t\tthis.zoom0 = this.object.zoom;\n\n\t}\n\n\treset() {\n\n\t\tthis.target.copy( this.target0 );\n\t\tthis.object.position.copy( this.position0 );\n\t\tthis.object.zoom = this.zoom0;\n\n\t\tthis.object.updateProjectionMatrix();\n\t\tthis.dispatchEvent( _changeEvent );\n\n\t\tthis.update();\n\n\t\tthis.state = _STATE.NONE;\n\n\t}\n\n\tupdate( deltaTime = null ) {\n\n\t\tconst position = this.object.position;\n\n\t\t_v.copy( position ).sub( this.target );\n\n\t\t// rotate offset to \"y-axis-is-up\" space\n\t\t_v.applyQuaternion( this._quat );\n\n\t\t// angle from z-axis around y-axis\n\t\tthis._spherical.setFromVector3( _v );\n\n\t\tif ( this.autoRotate && this.state === _STATE.NONE ) {\n\n\t\t\tthis._rotateLeft( this._getAutoRotationAngle( deltaTime ) );\n\n\t\t}\n\n\t\tif ( this.enableDamping ) {\n\n\t\t\tthis._spherical.theta += this._sphericalDelta.theta * this.dampingFactor;\n\t\t\tthis._spherical.phi += this._sphericalDelta.phi * this.dampingFactor;\n\n\t\t} else {\n\n\t\t\tthis._spherical.theta += this._sphericalDelta.theta;\n\t\t\tthis._spherical.phi += this._sphericalDelta.phi;\n\n\t\t}\n\n\t\t// restrict theta to be between desired limits\n\n\t\tlet min = this.minAzimuthAngle;\n\t\tlet max = this.maxAzimuthAngle;\n\n\t\tif ( isFinite( min ) && isFinite( max ) ) {\n\n\t\t\tif ( min < - Math.PI ) min += _twoPI; else if ( min > Math.PI ) min -= _twoPI;\n\n\t\t\tif ( max < - Math.PI ) max += _twoPI; else if ( max > Math.PI ) max -= _twoPI;\n\n\t\t\tif ( min <= max ) {\n\n\t\t\t\tthis._spherical.theta = Math.max( min, Math.min( max, this._spherical.theta ) );\n\n\t\t\t} else {\n\n\t\t\t\tthis._spherical.theta = ( this._spherical.theta > ( min + max ) / 2 ) ?\n\t\t\t\t\tMath.max( min, this._spherical.theta ) :\n\t\t\t\t\tMath.min( max, this._spherical.theta );\n\n\t\t\t}\n\n\t\t}\n\n\t\t// restrict phi to be between desired limits\n\t\tthis._spherical.phi = Math.max( this.minPolarAngle, Math.min( this.maxPolarAngle, this._spherical.phi ) );\n\n\t\tthis._spherical.makeSafe();\n\n\n\t\t// move target to panned location\n\n\t\tif ( this.enableDamping === true ) {\n\n\t\t\tthis.target.addScaledVector( this._panOffset, this.dampingFactor );\n\n\t\t} else {\n\n\t\t\tthis.target.add( this._panOffset );\n\n\t\t}\n\n\t\t// Limit the target distance from the cursor to create a sphere around the center of interest\n\t\tthis.target.sub( this.cursor );\n\t\tthis.target.clampLength( this.minTargetRadius, this.maxTargetRadius );\n\t\tthis.target.add( this.cursor );\n\n\t\tlet zoomChanged = false;\n\t\t// adjust the camera position based on zoom only if we're not zooming to the cursor or if it's an ortho camera\n\t\t// we adjust zoom later in these cases\n\t\tif ( this.zoomToCursor && this._performCursorZoom || this.object.isOrthographicCamera ) {\n\n\t\t\tthis._spherical.radius = this._clampDistance( this._spherical.radius );\n\n\t\t} else {\n\n\t\t\tconst prevRadius = this._spherical.radius;\n\t\t\tthis._spherical.radius = this._clampDistance( this._spherical.radius * this._scale );\n\t\t\tzoomChanged = prevRadius != this._spherical.radius;\n\n\t\t}\n\n\t\t_v.setFromSpherical( this._spherical );\n\n\t\t// rotate offset back to \"camera-up-vector-is-up\" space\n\t\t_v.applyQuaternion( this._quatInverse );\n\n\t\tposition.copy( this.target ).add( _v );\n\n\t\tthis.object.lookAt( this.target );\n\n\t\tif ( this.enableDamping === true ) {\n\n\t\t\tthis._sphericalDelta.theta *= ( 1 - this.dampingFactor );\n\t\t\tthis._sphericalDelta.phi *= ( 1 - this.dampingFactor );\n\n\t\t\tthis._panOffset.multiplyScalar( 1 - this.dampingFactor );\n\n\t\t} else {\n\n\t\t\tthis._sphericalDelta.set( 0, 0, 0 );\n\n\t\t\tthis._panOffset.set( 0, 0, 0 );\n\n\t\t}\n\n\t\t// adjust camera position\n\t\tif ( this.zoomToCursor && this._performCursorZoom ) {\n\n\t\t\tlet newRadius = null;\n\t\t\tif ( this.object.isPerspectiveCamera ) {\n\n\t\t\t\t// move the camera down the pointer ray\n\t\t\t\t// this method avoids floating point error\n\t\t\t\tconst prevRadius = _v.length();\n\t\t\t\tnewRadius = this._clampDistance( prevRadius * this._scale );\n\n\t\t\t\tconst radiusDelta = prevRadius - newRadius;\n\t\t\t\tthis.object.position.addScaledVector( this._dollyDirection, radiusDelta );\n\t\t\t\tthis.object.updateMatrixWorld();\n\n\t\t\t\tzoomChanged = !! radiusDelta;\n\n\t\t\t} else if ( this.object.isOrthographicCamera ) {\n\n\t\t\t\t// adjust the ortho camera position based on zoom changes\n\t\t\t\tconst mouseBefore = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3( this._mouse.x, this._mouse.y, 0 );\n\t\t\t\tmouseBefore.unproject( this.object );\n\n\t\t\t\tconst prevZoom = this.object.zoom;\n\t\t\t\tthis.object.zoom = Math.max( this.minZoom, Math.min( this.maxZoom, this.object.zoom / this._scale ) );\n\t\t\t\tthis.object.updateProjectionMatrix();\n\n\t\t\t\tzoomChanged = prevZoom !== this.object.zoom;\n\n\t\t\t\tconst mouseAfter = new three__WEBPACK_IMPORTED_MODULE_0__.Vector3( this._mouse.x, this._mouse.y, 0 );\n\t\t\t\tmouseAfter.unproject( this.object );\n\n\t\t\t\tthis.object.position.sub( mouseAfter ).add( mouseBefore );\n\t\t\t\tthis.object.updateMatrixWorld();\n\n\t\t\t\tnewRadius = _v.length();\n\n\t\t\t} else {\n\n\t\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled.' );\n\t\t\t\tthis.zoomToCursor = false;\n\n\t\t\t}\n\n\t\t\t// handle the placement of the target\n\t\t\tif ( newRadius !== null ) {\n\n\t\t\t\tif ( this.screenSpacePanning ) {\n\n\t\t\t\t\t// position the orbit target in front of the new camera position\n\t\t\t\t\tthis.target.set( 0, 0, - 1 )\n\t\t\t\t\t\t.transformDirection( this.object.matrix )\n\t\t\t\t\t\t.multiplyScalar( newRadius )\n\t\t\t\t\t\t.add( this.object.position );\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// get the ray and translation plane to compute target\n\t\t\t\t\t_ray.origin.copy( this.object.position );\n\t\t\t\t\t_ray.direction.set( 0, 0, - 1 ).transformDirection( this.object.matrix );\n\n\t\t\t\t\t// if the camera is 20 degrees above the horizon then don't adjust the focus target to avoid\n\t\t\t\t\t// extremely large values\n\t\t\t\t\tif ( Math.abs( this.object.up.dot( _ray.direction ) ) < _TILT_LIMIT ) {\n\n\t\t\t\t\t\tthis.object.lookAt( this.target );\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\t_plane.setFromNormalAndCoplanarPoint( this.object.up, this.target );\n\t\t\t\t\t\t_ray.intersectPlane( _plane, this.target );\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else if ( this.object.isOrthographicCamera ) {\n\n\t\t\tconst prevZoom = this.object.zoom;\n\t\t\tthis.object.zoom = Math.max( this.minZoom, Math.min( this.maxZoom, this.object.zoom / this._scale ) );\n\n\t\t\tif ( prevZoom !== this.object.zoom ) {\n\n\t\t\t\tthis.object.updateProjectionMatrix();\n\t\t\t\tzoomChanged = true;\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis._scale = 1;\n\t\tthis._performCursorZoom = false;\n\n\t\t// update condition is:\n\t\t// min(camera displacement, camera rotation in radians)^2 > EPS\n\t\t// using small-angle approximation cos(x/2) = 1 - x^2 / 8\n\n\t\tif ( zoomChanged ||\n\t\t\tthis._lastPosition.distanceToSquared( this.object.position ) > _EPS ||\n\t\t\t8 * ( 1 - this._lastQuaternion.dot( this.object.quaternion ) ) > _EPS ||\n\t\t\tthis._lastTargetPosition.distanceToSquared( this.target ) > _EPS ) {\n\n\t\t\tthis.dispatchEvent( _changeEvent );\n\n\t\t\tthis._lastPosition.copy( this.object.position );\n\t\t\tthis._lastQuaternion.copy( this.object.quaternion );\n\t\t\tthis._lastTargetPosition.copy( this.target );\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\t_getAutoRotationAngle( deltaTime ) {\n\n\t\tif ( deltaTime !== null ) {\n\n\t\t\treturn ( _twoPI / 60 * this.autoRotateSpeed ) * deltaTime;\n\n\t\t} else {\n\n\t\t\treturn _twoPI / 60 / 60 * this.autoRotateSpeed;\n\n\t\t}\n\n\t}\n\n\t_getZoomScale( delta ) {\n\n\t\tconst normalizedDelta = Math.abs( delta * 0.01 );\n\t\treturn Math.pow( 0.95, this.zoomSpeed * normalizedDelta );\n\n\t}\n\n\t_rotateLeft( angle ) {\n\n\t\tthis._sphericalDelta.theta -= angle;\n\n\t}\n\n\t_rotateUp( angle ) {\n\n\t\tthis._sphericalDelta.phi -= angle;\n\n\t}\n\n\t_panLeft( distance, objectMatrix ) {\n\n\t\t_v.setFromMatrixColumn( objectMatrix, 0 ); // get X column of objectMatrix\n\t\t_v.multiplyScalar( - distance );\n\n\t\tthis._panOffset.add( _v );\n\n\t}\n\n\t_panUp( distance, objectMatrix ) {\n\n\t\tif ( this.screenSpacePanning === true ) {\n\n\t\t\t_v.setFromMatrixColumn( objectMatrix, 1 );\n\n\t\t} else {\n\n\t\t\t_v.setFromMatrixColumn( objectMatrix, 0 );\n\t\t\t_v.crossVectors( this.object.up, _v );\n\n\t\t}\n\n\t\t_v.multiplyScalar( distance );\n\n\t\tthis._panOffset.add( _v );\n\n\t}\n\n\t// deltaX and deltaY are in pixels; right and down are positive\n\t_pan( deltaX, deltaY ) {\n\n\t\tconst element = this.domElement;\n\n\t\tif ( this.object.isPerspectiveCamera ) {\n\n\t\t\t// perspective\n\t\t\tconst position = this.object.position;\n\t\t\t_v.copy( position ).sub( this.target );\n\t\t\tlet targetDistance = _v.length();\n\n\t\t\t// half of the fov is center to top of screen\n\t\t\ttargetDistance *= Math.tan( ( this.object.fov / 2 ) * Math.PI / 180.0 );\n\n\t\t\t// we use only clientHeight here so aspect ratio does not distort speed\n\t\t\tthis._panLeft( 2 * deltaX * targetDistance / element.clientHeight, this.object.matrix );\n\t\t\tthis._panUp( 2 * deltaY * targetDistance / element.clientHeight, this.object.matrix );\n\n\t\t} else if ( this.object.isOrthographicCamera ) {\n\n\t\t\t// orthographic\n\t\t\tthis._panLeft( deltaX * ( this.object.right - this.object.left ) / this.object.zoom / element.clientWidth, this.object.matrix );\n\t\t\tthis._panUp( deltaY * ( this.object.top - this.object.bottom ) / this.object.zoom / element.clientHeight, this.object.matrix );\n\n\t\t} else {\n\n\t\t\t// camera neither orthographic nor perspective\n\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - pan disabled.' );\n\t\t\tthis.enablePan = false;\n\n\t\t}\n\n\t}\n\n\t_dollyOut( dollyScale ) {\n\n\t\tif ( this.object.isPerspectiveCamera || this.object.isOrthographicCamera ) {\n\n\t\t\tthis._scale /= dollyScale;\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );\n\t\t\tthis.enableZoom = false;\n\n\t\t}\n\n\t}\n\n\t_dollyIn( dollyScale ) {\n\n\t\tif ( this.object.isPerspectiveCamera || this.object.isOrthographicCamera ) {\n\n\t\t\tthis._scale *= dollyScale;\n\n\t\t} else {\n\n\t\t\tconsole.warn( 'WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled.' );\n\t\t\tthis.enableZoom = false;\n\n\t\t}\n\n\t}\n\n\t_updateZoomParameters( x, y ) {\n\n\t\tif ( ! this.zoomToCursor ) {\n\n\t\t\treturn;\n\n\t\t}\n\n\t\tthis._performCursorZoom = true;\n\n\t\tconst rect = this.domElement.getBoundingClientRect();\n\t\tconst dx = x - rect.left;\n\t\tconst dy = y - rect.top;\n\t\tconst w = rect.width;\n\t\tconst h = rect.height;\n\n\t\tthis._mouse.x = ( dx / w ) * 2 - 1;\n\t\tthis._mouse.y = - ( dy / h ) * 2 + 1;\n\n\t\tthis._dollyDirection.set( this._mouse.x, this._mouse.y, 1 ).unproject( this.object ).sub( this.object.position ).normalize();\n\n\t}\n\n\t_clampDistance( dist ) {\n\n\t\treturn Math.max( this.minDistance, Math.min( this.maxDistance, dist ) );\n\n\t}\n\n\t//\n\t// event callbacks - update the object state\n\t//\n\n\t_handleMouseDownRotate( event ) {\n\n\t\tthis._rotateStart.set( event.clientX, event.clientY );\n\n\t}\n\n\t_handleMouseDownDolly( event ) {\n\n\t\tthis._updateZoomParameters( event.clientX, event.clientX );\n\t\tthis._dollyStart.set( event.clientX, event.clientY );\n\n\t}\n\n\t_handleMouseDownPan( event ) {\n\n\t\tthis._panStart.set( event.clientX, event.clientY );\n\n\t}\n\n\t_handleMouseMoveRotate( event ) {\n\n\t\tthis._rotateEnd.set( event.clientX, event.clientY );\n\n\t\tthis._rotateDelta.subVectors( this._rotateEnd, this._rotateStart ).multiplyScalar( this.rotateSpeed );\n\n\t\tconst element = this.domElement;\n\n\t\tthis._rotateLeft( _twoPI * this._rotateDelta.x / element.clientHeight ); // yes, height\n\n\t\tthis._rotateUp( _twoPI * this._rotateDelta.y / element.clientHeight );\n\n\t\tthis._rotateStart.copy( this._rotateEnd );\n\n\t\tthis.update();\n\n\t}\n\n\t_handleMouseMoveDolly( event ) {\n\n\t\tthis._dollyEnd.set( event.clientX, event.clientY );\n\n\t\tthis._dollyDelta.subVectors( this._dollyEnd, this._dollyStart );\n\n\t\tif ( this._dollyDelta.y > 0 ) {\n\n\t\t\tthis._dollyOut( this._getZoomScale( this._dollyDelta.y ) );\n\n\t\t} else if ( this._dollyDelta.y < 0 ) {\n\n\t\t\tthis._dollyIn( this._getZoomScale( this._dollyDelta.y ) );\n\n\t\t}\n\n\t\tthis._dollyStart.copy( this._dollyEnd );\n\n\t\tthis.update();\n\n\t}\n\n\t_handleMouseMovePan( event ) {\n\n\t\tthis._panEnd.set( event.clientX, event.clientY );\n\n\t\tthis._panDelta.subVectors( this._panEnd, this._panStart ).multiplyScalar( this.panSpeed );\n\n\t\tthis._pan( this._panDelta.x, this._panDelta.y );\n\n\t\tthis._panStart.copy( this._panEnd );\n\n\t\tthis.update();\n\n\t}\n\n\t_handleMouseWheel( event ) {\n\n\t\tthis._updateZoomParameters( event.clientX, event.clientY );\n\n\t\tif ( event.deltaY < 0 ) {\n\n\t\t\tthis._dollyIn( this._getZoomScale( event.deltaY ) );\n\n\t\t} else if ( event.deltaY > 0 ) {\n\n\t\t\tthis._dollyOut( this._getZoomScale( event.deltaY ) );\n\n\t\t}\n\n\t\tthis.update();\n\n\t}\n\n\t_handleKeyDown( event ) {\n\n\t\tlet needsUpdate = false;\n\n\t\tswitch ( event.code ) {\n\n\t\t\tcase this.keys.UP:\n\n\t\t\t\tif ( event.ctrlKey || event.metaKey || event.shiftKey ) {\n\n\t\t\t\t\tthis._rotateUp( _twoPI * this.rotateSpeed / this.domElement.clientHeight );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._pan( 0, this.keyPanSpeed );\n\n\t\t\t\t}\n\n\t\t\t\tneedsUpdate = true;\n\t\t\t\tbreak;\n\n\t\t\tcase this.keys.BOTTOM:\n\n\t\t\t\tif ( event.ctrlKey || event.metaKey || event.shiftKey ) {\n\n\t\t\t\t\tthis._rotateUp( - _twoPI * this.rotateSpeed / this.domElement.clientHeight );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._pan( 0, - this.keyPanSpeed );\n\n\t\t\t\t}\n\n\t\t\t\tneedsUpdate = true;\n\t\t\t\tbreak;\n\n\t\t\tcase this.keys.LEFT:\n\n\t\t\t\tif ( event.ctrlKey || event.metaKey || event.shiftKey ) {\n\n\t\t\t\t\tthis._rotateLeft( _twoPI * this.rotateSpeed / this.domElement.clientHeight );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._pan( this.keyPanSpeed, 0 );\n\n\t\t\t\t}\n\n\t\t\t\tneedsUpdate = true;\n\t\t\t\tbreak;\n\n\t\t\tcase this.keys.RIGHT:\n\n\t\t\t\tif ( event.ctrlKey || event.metaKey || event.shiftKey ) {\n\n\t\t\t\t\tthis._rotateLeft( - _twoPI * this.rotateSpeed / this.domElement.clientHeight );\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis._pan( - this.keyPanSpeed, 0 );\n\n\t\t\t\t}\n\n\t\t\t\tneedsUpdate = true;\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\tif ( needsUpdate ) {\n\n\t\t\t// prevent the browser from scrolling on cursor keys\n\t\t\tevent.preventDefault();\n\n\t\t\tthis.update();\n\n\t\t}\n\n\n\t}\n\n\t_handleTouchStartRotate( event ) {\n\n\t\tif ( this._pointers.length === 1 ) {\n\n\t\t\tthis._rotateStart.set( event.pageX, event.pageY );\n\n\t\t} else {\n\n\t\t\tconst position = this._getSecondPointerPosition( event );\n\n\t\t\tconst x = 0.5 * ( event.pageX + position.x );\n\t\t\tconst y = 0.5 * ( event.pageY + position.y );\n\n\t\t\tthis._rotateStart.set( x, y );\n\n\t\t}\n\n\t}\n\n\t_handleTouchStartPan( event ) {\n\n\t\tif ( this._pointers.length === 1 ) {\n\n\t\t\tthis._panStart.set( event.pageX, event.pageY );\n\n\t\t} else {\n\n\t\t\tconst position = this._getSecondPointerPosition( event );\n\n\t\t\tconst x = 0.5 * ( event.pageX + position.x );\n\t\t\tconst y = 0.5 * ( event.pageY + position.y );\n\n\t\t\tthis._panStart.set( x, y );\n\n\t\t}\n\n\t}\n\n\t_handleTouchStartDolly( event ) {\n\n\t\tconst position = this._getSecondPointerPosition( event );\n\n\t\tconst dx = event.pageX - position.x;\n\t\tconst dy = event.pageY - position.y;\n\n\t\tconst distance = Math.sqrt( dx * dx + dy * dy );\n\n\t\tthis._dollyStart.set( 0, distance );\n\n\t}\n\n\t_handleTouchStartDollyPan( event ) {\n\n\t\tif ( this.enableZoom ) this._handleTouchStartDolly( event );\n\n\t\tif ( this.enablePan ) this._handleTouchStartPan( event );\n\n\t}\n\n\t_handleTouchStartDollyRotate( event ) {\n\n\t\tif ( this.enableZoom ) this._handleTouchStartDolly( event );\n\n\t\tif ( this.enableRotate ) this._handleTouchStartRotate( event );\n\n\t}\n\n\t_handleTouchMoveRotate( event ) {\n\n\t\tif ( this._pointers.length == 1 ) {\n\n\t\t\tthis._rotateEnd.set( event.pageX, event.pageY );\n\n\t\t} else {\n\n\t\t\tconst position = this._getSecondPointerPosition( event );\n\n\t\t\tconst x = 0.5 * ( event.pageX + position.x );\n\t\t\tconst y = 0.5 * ( event.pageY + position.y );\n\n\t\t\tthis._rotateEnd.set( x, y );\n\n\t\t}\n\n\t\tthis._rotateDelta.subVectors( this._rotateEnd, this._rotateStart ).multiplyScalar( this.rotateSpeed );\n\n\t\tconst element = this.domElement;\n\n\t\tthis._rotateLeft( _twoPI * this._rotateDelta.x / element.clientHeight ); // yes, height\n\n\t\tthis._rotateUp( _twoPI * this._rotateDelta.y / element.clientHeight );\n\n\t\tthis._rotateStart.copy( this._rotateEnd );\n\n\t}\n\n\t_handleTouchMovePan( event ) {\n\n\t\tif ( this._pointers.length === 1 ) {\n\n\t\t\tthis._panEnd.set( event.pageX, event.pageY );\n\n\t\t} else {\n\n\t\t\tconst position = this._getSecondPointerPosition( event );\n\n\t\t\tconst x = 0.5 * ( event.pageX + position.x );\n\t\t\tconst y = 0.5 * ( event.pageY + position.y );\n\n\t\t\tthis._panEnd.set( x, y );\n\n\t\t}\n\n\t\tthis._panDelta.subVectors( this._panEnd, this._panStart ).multiplyScalar( this.panSpeed );\n\n\t\tthis._pan( this._panDelta.x, this._panDelta.y );\n\n\t\tthis._panStart.copy( this._panEnd );\n\n\t}\n\n\t_handleTouchMoveDolly( event ) {\n\n\t\tconst position = this._getSecondPointerPosition( event );\n\n\t\tconst dx = event.pageX - position.x;\n\t\tconst dy = event.pageY - position.y;\n\n\t\tconst distance = Math.sqrt( dx * dx + dy * dy );\n\n\t\tthis._dollyEnd.set( 0, distance );\n\n\t\tthis._dollyDelta.set( 0, Math.pow( this._dollyEnd.y / this._dollyStart.y, this.zoomSpeed ) );\n\n\t\tthis._dollyOut( this._dollyDelta.y );\n\n\t\tthis._dollyStart.copy( this._dollyEnd );\n\n\t\tconst centerX = ( event.pageX + position.x ) * 0.5;\n\t\tconst centerY = ( event.pageY + position.y ) * 0.5;\n\n\t\tthis._updateZoomParameters( centerX, centerY );\n\n\t}\n\n\t_handleTouchMoveDollyPan( event ) {\n\n\t\tif ( this.enableZoom ) this._handleTouchMoveDolly( event );\n\n\t\tif ( this.enablePan ) this._handleTouchMovePan( event );\n\n\t}\n\n\t_handleTouchMoveDollyRotate( event ) {\n\n\t\tif ( this.enableZoom ) this._handleTouchMoveDolly( event );\n\n\t\tif ( this.enableRotate ) this._handleTouchMoveRotate( event );\n\n\t}\n\n\t// pointers\n\n\t_addPointer( event ) {\n\n\t\tthis._pointers.push( event.pointerId );\n\n\t}\n\n\t_removePointer( event ) {\n\n\t\tdelete this._pointerPositions[ event.pointerId ];\n\n\t\tfor ( let i = 0; i < this._pointers.length; i ++ ) {\n\n\t\t\tif ( this._pointers[ i ] == event.pointerId ) {\n\n\t\t\t\tthis._pointers.splice( i, 1 );\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t_isTrackingPointer( event ) {\n\n\t\tfor ( let i = 0; i < this._pointers.length; i ++ ) {\n\n\t\t\tif ( this._pointers[ i ] == event.pointerId ) return true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}\n\n\t_trackPointer( event ) {\n\n\t\tlet position = this._pointerPositions[ event.pointerId ];\n\n\t\tif ( position === undefined ) {\n\n\t\t\tposition = new three__WEBPACK_IMPORTED_MODULE_0__.Vector2();\n\t\t\tthis._pointerPositions[ event.pointerId ] = position;\n\n\t\t}\n\n\t\tposition.set( event.pageX, event.pageY );\n\n\t}\n\n\t_getSecondPointerPosition( event ) {\n\n\t\tconst pointerId = ( event.pointerId === this._pointers[ 0 ] ) ? this._pointers[ 1 ] : this._pointers[ 0 ];\n\n\t\treturn this._pointerPositions[ pointerId ];\n\n\t}\n\n\t//\n\n\t_customWheelEvent( event ) {\n\n\t\tconst mode = event.deltaMode;\n\n\t\t// minimal wheel event altered to meet delta-zoom demand\n\t\tconst newEvent = {\n\t\t\tclientX: event.clientX,\n\t\t\tclientY: event.clientY,\n\t\t\tdeltaY: event.deltaY,\n\t\t};\n\n\t\tswitch ( mode ) {\n\n\t\t\tcase 1: // LINE_MODE\n\t\t\t\tnewEvent.deltaY *= 16;\n\t\t\t\tbreak;\n\n\t\t\tcase 2: // PAGE_MODE\n\t\t\t\tnewEvent.deltaY *= 100;\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\t// detect if event was triggered by pinching\n\t\tif ( event.ctrlKey && ! this._controlActive ) {\n\n\t\t\tnewEvent.deltaY *= 10;\n\n\t\t}\n\n\t\treturn newEvent;\n\n\t}\n\n}\n\nfunction onPointerDown( event ) {\n\n\tif ( this.enabled === false ) return;\n\n\tif ( this._pointers.length === 0 ) {\n\n\t\tthis.domElement.setPointerCapture( event.pointerId );\n\n\t\tthis.domElement.addEventListener( 'pointermove', this._onPointerMove );\n\t\tthis.domElement.addEventListener( 'pointerup', this._onPointerUp );\n\n\t}\n\n\t//\n\n\tif ( this._isTrackingPointer( event ) ) return;\n\n\t//\n\n\tthis._addPointer( event );\n\n\tif ( event.pointerType === 'touch' ) {\n\n\t\tthis._onTouchStart( event );\n\n\t} else {\n\n\t\tthis._onMouseDown( event );\n\n\t}\n\n}\n\nfunction onPointerMove( event ) {\n\n\tif ( this.enabled === false ) return;\n\n\tif ( event.pointerType === 'touch' ) {\n\n\t\tthis._onTouchMove( event );\n\n\t} else {\n\n\t\tthis._onMouseMove( event );\n\n\t}\n\n}\n\nfunction onPointerUp( event ) {\n\n\tthis._removePointer( event );\n\n\tswitch ( this._pointers.length ) {\n\n\t\tcase 0:\n\n\t\t\tthis.domElement.releasePointerCapture( event.pointerId );\n\n\t\t\tthis.domElement.removeEventListener( 'pointermove', this._onPointerMove );\n\t\t\tthis.domElement.removeEventListener( 'pointerup', this._onPointerUp );\n\n\t\t\tthis.dispatchEvent( _endEvent );\n\n\t\t\tthis.state = _STATE.NONE;\n\n\t\t\tbreak;\n\n\t\tcase 1:\n\n\t\t\tconst pointerId = this._pointers[ 0 ];\n\t\t\tconst position = this._pointerPositions[ pointerId ];\n\n\t\t\t// minimal placeholder event - allows state correction on pointer-up\n\t\t\tthis._onTouchStart( { pointerId: pointerId, pageX: position.x, pageY: position.y } );\n\n\t\t\tbreak;\n\n\t}\n\n}\n\nfunction onMouseDown( event ) {\n\n\tlet mouseAction;\n\n\tswitch ( event.button ) {\n\n\t\tcase 0:\n\n\t\t\tmouseAction = this.mouseButtons.LEFT;\n\t\t\tbreak;\n\n\t\tcase 1:\n\n\t\t\tmouseAction = this.mouseButtons.MIDDLE;\n\t\t\tbreak;\n\n\t\tcase 2:\n\n\t\t\tmouseAction = this.mouseButtons.RIGHT;\n\t\t\tbreak;\n\n\t\tdefault:\n\n\t\t\tmouseAction = - 1;\n\n\t}\n\n\tswitch ( mouseAction ) {\n\n\t\tcase three__WEBPACK_IMPORTED_MODULE_0__.MOUSE.DOLLY:\n\n\t\t\tif ( this.enableZoom === false ) return;\n\n\t\t\tthis._handleMouseDownDolly( event );\n\n\t\t\tthis.state = _STATE.DOLLY;\n\n\t\t\tbreak;\n\n\t\tcase three__WEBPACK_IMPORTED_MODULE_0__.MOUSE.ROTATE:\n\n\t\t\tif ( event.ctrlKey || event.metaKey || event.shiftKey ) {\n\n\t\t\t\tif ( this.enablePan === false ) return;\n\n\t\t\t\tthis._handleMouseDownPan( event );\n\n\t\t\t\tthis.state = _STATE.PAN;\n\n\t\t\t} else {\n\n\t\t\t\tif ( this.enableRotate === false ) return;\n\n\t\t\t\tthis._handleMouseDownRotate( event );\n\n\t\t\t\tthis.state = _STATE.ROTATE;\n\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase three__WEBPACK_IMPORTED_MODULE_0__.MOUSE.PAN:\n\n\t\t\tif ( event.ctrlKey || event.metaKey || event.shiftKey ) {\n\n\t\t\t\tif ( this.enableRotate === false ) return;\n\n\t\t\t\tthis._handleMouseDownRotate( event );\n\n\t\t\t\tthis.state = _STATE.ROTATE;\n\n\t\t\t} else {\n\n\t\t\t\tif ( this.enablePan === false ) return;\n\n\t\t\t\tthis._handleMouseDownPan( event );\n\n\t\t\t\tthis.state = _STATE.PAN;\n\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tdefault:\n\n\t\t\tthis.state = _STATE.NONE;\n\n\t}\n\n\tif ( this.state !== _STATE.NONE ) {\n\n\t\tthis.dispatchEvent( _startEvent );\n\n\t}\n\n}\n\nfunction onMouseMove( event ) {\n\n\tswitch ( this.state ) {\n\n\t\tcase _STATE.ROTATE:\n\n\t\t\tif ( this.enableRotate === false ) return;\n\n\t\t\tthis._handleMouseMoveRotate( event );\n\n\t\t\tbreak;\n\n\t\tcase _STATE.DOLLY:\n\n\t\t\tif ( this.enableZoom === false ) return;\n\n\t\t\tthis._handleMouseMoveDolly( event );\n\n\t\t\tbreak;\n\n\t\tcase _STATE.PAN:\n\n\t\t\tif ( this.enablePan === false ) return;\n\n\t\t\tthis._handleMouseMovePan( event );\n\n\t\t\tbreak;\n\n\t}\n\n}\n\nfunction onMouseWheel( event ) {\n\n\tif ( this.enabled === false || this.enableZoom === false || this.state !== _STATE.NONE ) return;\n\n\tevent.preventDefault();\n\n\tthis.dispatchEvent( _startEvent );\n\n\tthis._handleMouseWheel( this._customWheelEvent( event ) );\n\n\tthis.dispatchEvent( _endEvent );\n\n}\n\nfunction onKeyDown( event ) {\n\n\tif ( this.enabled === false || this.enablePan === false ) return;\n\n\tthis._handleKeyDown( event );\n\n}\n\nfunction onTouchStart( event ) {\n\n\tthis._trackPointer( event );\n\n\tswitch ( this._pointers.length ) {\n\n\t\tcase 1:\n\n\t\t\tswitch ( this.touches.ONE ) {\n\n\t\t\t\tcase three__WEBPACK_IMPORTED_MODULE_0__.TOUCH.ROTATE:\n\n\t\t\t\t\tif ( this.enableRotate === false ) return;\n\n\t\t\t\t\tthis._handleTouchStartRotate( event );\n\n\t\t\t\t\tthis.state = _STATE.TOUCH_ROTATE;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase three__WEBPACK_IMPORTED_MODULE_0__.TOUCH.PAN:\n\n\t\t\t\t\tif ( this.enablePan === false ) return;\n\n\t\t\t\t\tthis._handleTouchStartPan( event );\n\n\t\t\t\t\tthis.state = _STATE.TOUCH_PAN;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tthis.state = _STATE.NONE;\n\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase 2:\n\n\t\t\tswitch ( this.touches.TWO ) {\n\n\t\t\t\tcase three__WEBPACK_IMPORTED_MODULE_0__.TOUCH.DOLLY_PAN:\n\n\t\t\t\t\tif ( this.enableZoom === false && this.enablePan === false ) return;\n\n\t\t\t\t\tthis._handleTouchStartDollyPan( event );\n\n\t\t\t\t\tthis.state = _STATE.TOUCH_DOLLY_PAN;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase three__WEBPACK_IMPORTED_MODULE_0__.TOUCH.DOLLY_ROTATE:\n\n\t\t\t\t\tif ( this.enableZoom === false && this.enableRotate === false ) return;\n\n\t\t\t\t\tthis._handleTouchStartDollyRotate( event );\n\n\t\t\t\t\tthis.state = _STATE.TOUCH_DOLLY_ROTATE;\n\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tthis.state = _STATE.NONE;\n\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tdefault:\n\n\t\t\tthis.state = _STATE.NONE;\n\n\t}\n\n\tif ( this.state !== _STATE.NONE ) {\n\n\t\tthis.dispatchEvent( _startEvent );\n\n\t}\n\n}\n\nfunction onTouchMove( event ) {\n\n\tthis._trackPointer( event );\n\n\tswitch ( this.state ) {\n\n\t\tcase _STATE.TOUCH_ROTATE:\n\n\t\t\tif ( this.enableRotate === false ) return;\n\n\t\t\tthis._handleTouchMoveRotate( event );\n\n\t\t\tthis.update();\n\n\t\t\tbreak;\n\n\t\tcase _STATE.TOUCH_PAN:\n\n\t\t\tif ( this.enablePan === false ) return;\n\n\t\t\tthis._handleTouchMovePan( event );\n\n\t\t\tthis.update();\n\n\t\t\tbreak;\n\n\t\tcase _STATE.TOUCH_DOLLY_PAN:\n\n\t\t\tif ( this.enableZoom === false && this.enablePan === false ) return;\n\n\t\t\tthis._handleTouchMoveDollyPan( event );\n\n\t\t\tthis.update();\n\n\t\t\tbreak;\n\n\t\tcase _STATE.TOUCH_DOLLY_ROTATE:\n\n\t\t\tif ( this.enableZoom === false && this.enableRotate === false ) return;\n\n\t\t\tthis._handleTouchMoveDollyRotate( event );\n\n\t\t\tthis.update();\n\n\t\t\tbreak;\n\n\t\tdefault:\n\n\t\t\tthis.state = _STATE.NONE;\n\n\t}\n\n}\n\nfunction onContextMenu( event ) {\n\n\tif ( this.enabled === false ) return;\n\n\tevent.preventDefault();\n\n}\n\nfunction interceptControlDown( event ) {\n\n\tif ( event.key === 'Control' ) {\n\n\t\tthis._controlActive = true;\n\n\t\tconst document = this.domElement.getRootNode(); // offscreen canvas compatibility\n\n\t\tdocument.addEventListener( 'keyup', this._interceptControlUp, { passive: true, capture: true } );\n\n\t}\n\n}\n\nfunction interceptControlUp( event ) {\n\n\tif ( event.key === 'Control' ) {\n\n\t\tthis._controlActive = false;\n\n\t\tconst document = this.domElement.getRootNode(); // offscreen canvas compatibility\n\n\t\tdocument.removeEventListener( 'keyup', this._interceptControlUp, { passive: true, capture: true } );\n\n\t}\n\n}\n\n\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./node_modules/three/examples/jsm/controls/OrbitControls.js?");
13807
+
13808
+ /***/ }),
13809
+
13799
13810
  /***/ "./node_modules/three/examples/jsm/controls/TrackballControls.js":
13800
13811
  /*!***********************************************************************!*\
13801
13812
  !*** ./node_modules/three/examples/jsm/controls/TrackballControls.js ***!
@@ -13862,6 +13873,28 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
13862
13873
 
13863
13874
  /***/ }),
13864
13875
 
13876
+ /***/ "./node_modules/three/examples/jsm/postprocessing/EffectComposer.js":
13877
+ /*!**************************************************************************!*\
13878
+ !*** ./node_modules/three/examples/jsm/postprocessing/EffectComposer.js ***!
13879
+ \**************************************************************************/
13880
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13881
+
13882
+ "use strict";
13883
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EffectComposer: () => (/* binding */ EffectComposer)\n/* harmony export */ });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _shaders_CopyShader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shaders/CopyShader.js */ \"./node_modules/three/examples/jsm/shaders/CopyShader.js\");\n/* harmony import */ var _ShaderPass_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ShaderPass.js */ \"./node_modules/three/examples/jsm/postprocessing/ShaderPass.js\");\n/* harmony import */ var _MaskPass_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./MaskPass.js */ \"./node_modules/three/examples/jsm/postprocessing/MaskPass.js\");\n\n\n\n\n\n\nclass EffectComposer {\n\n\tconstructor( renderer, renderTarget ) {\n\n\t\tthis.renderer = renderer;\n\n\t\tthis._pixelRatio = renderer.getPixelRatio();\n\n\t\tif ( renderTarget === undefined ) {\n\n\t\t\tconst size = renderer.getSize( new three__WEBPACK_IMPORTED_MODULE_0__.Vector2() );\n\t\t\tthis._width = size.width;\n\t\t\tthis._height = size.height;\n\n\t\t\trenderTarget = new three__WEBPACK_IMPORTED_MODULE_0__.WebGLRenderTarget( this._width * this._pixelRatio, this._height * this._pixelRatio, { type: three__WEBPACK_IMPORTED_MODULE_0__.HalfFloatType } );\n\t\t\trenderTarget.texture.name = 'EffectComposer.rt1';\n\n\t\t} else {\n\n\t\t\tthis._width = renderTarget.width;\n\t\t\tthis._height = renderTarget.height;\n\n\t\t}\n\n\t\tthis.renderTarget1 = renderTarget;\n\t\tthis.renderTarget2 = renderTarget.clone();\n\t\tthis.renderTarget2.texture.name = 'EffectComposer.rt2';\n\n\t\tthis.writeBuffer = this.renderTarget1;\n\t\tthis.readBuffer = this.renderTarget2;\n\n\t\tthis.renderToScreen = true;\n\n\t\tthis.passes = [];\n\n\t\tthis.copyPass = new _ShaderPass_js__WEBPACK_IMPORTED_MODULE_1__.ShaderPass( _shaders_CopyShader_js__WEBPACK_IMPORTED_MODULE_2__.CopyShader );\n\t\tthis.copyPass.material.blending = three__WEBPACK_IMPORTED_MODULE_0__.NoBlending;\n\n\t\tthis.clock = new three__WEBPACK_IMPORTED_MODULE_0__.Clock();\n\n\t}\n\n\tswapBuffers() {\n\n\t\tconst tmp = this.readBuffer;\n\t\tthis.readBuffer = this.writeBuffer;\n\t\tthis.writeBuffer = tmp;\n\n\t}\n\n\taddPass( pass ) {\n\n\t\tthis.passes.push( pass );\n\t\tpass.setSize( this._width * this._pixelRatio, this._height * this._pixelRatio );\n\n\t}\n\n\tinsertPass( pass, index ) {\n\n\t\tthis.passes.splice( index, 0, pass );\n\t\tpass.setSize( this._width * this._pixelRatio, this._height * this._pixelRatio );\n\n\t}\n\n\tremovePass( pass ) {\n\n\t\tconst index = this.passes.indexOf( pass );\n\n\t\tif ( index !== - 1 ) {\n\n\t\t\tthis.passes.splice( index, 1 );\n\n\t\t}\n\n\t}\n\n\tisLastEnabledPass( passIndex ) {\n\n\t\tfor ( let i = passIndex + 1; i < this.passes.length; i ++ ) {\n\n\t\t\tif ( this.passes[ i ].enabled ) {\n\n\t\t\t\treturn false;\n\n\t\t\t}\n\n\t\t}\n\n\t\treturn true;\n\n\t}\n\n\trender( deltaTime ) {\n\n\t\t// deltaTime value is in seconds\n\n\t\tif ( deltaTime === undefined ) {\n\n\t\t\tdeltaTime = this.clock.getDelta();\n\n\t\t}\n\n\t\tconst currentRenderTarget = this.renderer.getRenderTarget();\n\n\t\tlet maskActive = false;\n\n\t\tfor ( let i = 0, il = this.passes.length; i < il; i ++ ) {\n\n\t\t\tconst pass = this.passes[ i ];\n\n\t\t\tif ( pass.enabled === false ) continue;\n\n\t\t\tpass.renderToScreen = ( this.renderToScreen && this.isLastEnabledPass( i ) );\n\t\t\tpass.render( this.renderer, this.writeBuffer, this.readBuffer, deltaTime, maskActive );\n\n\t\t\tif ( pass.needsSwap ) {\n\n\t\t\t\tif ( maskActive ) {\n\n\t\t\t\t\tconst context = this.renderer.getContext();\n\t\t\t\t\tconst stencil = this.renderer.state.buffers.stencil;\n\n\t\t\t\t\t//context.stencilFunc( context.NOTEQUAL, 1, 0xffffffff );\n\t\t\t\t\tstencil.setFunc( context.NOTEQUAL, 1, 0xffffffff );\n\n\t\t\t\t\tthis.copyPass.render( this.renderer, this.writeBuffer, this.readBuffer, deltaTime );\n\n\t\t\t\t\t//context.stencilFunc( context.EQUAL, 1, 0xffffffff );\n\t\t\t\t\tstencil.setFunc( context.EQUAL, 1, 0xffffffff );\n\n\t\t\t\t}\n\n\t\t\t\tthis.swapBuffers();\n\n\t\t\t}\n\n\t\t\tif ( _MaskPass_js__WEBPACK_IMPORTED_MODULE_3__.MaskPass !== undefined ) {\n\n\t\t\t\tif ( pass instanceof _MaskPass_js__WEBPACK_IMPORTED_MODULE_3__.MaskPass ) {\n\n\t\t\t\t\tmaskActive = true;\n\n\t\t\t\t} else if ( pass instanceof _MaskPass_js__WEBPACK_IMPORTED_MODULE_3__.ClearMaskPass ) {\n\n\t\t\t\t\tmaskActive = false;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t\tthis.renderer.setRenderTarget( currentRenderTarget );\n\n\t}\n\n\treset( renderTarget ) {\n\n\t\tif ( renderTarget === undefined ) {\n\n\t\t\tconst size = this.renderer.getSize( new three__WEBPACK_IMPORTED_MODULE_0__.Vector2() );\n\t\t\tthis._pixelRatio = this.renderer.getPixelRatio();\n\t\t\tthis._width = size.width;\n\t\t\tthis._height = size.height;\n\n\t\t\trenderTarget = this.renderTarget1.clone();\n\t\t\trenderTarget.setSize( this._width * this._pixelRatio, this._height * this._pixelRatio );\n\n\t\t}\n\n\t\tthis.renderTarget1.dispose();\n\t\tthis.renderTarget2.dispose();\n\t\tthis.renderTarget1 = renderTarget;\n\t\tthis.renderTarget2 = renderTarget.clone();\n\n\t\tthis.writeBuffer = this.renderTarget1;\n\t\tthis.readBuffer = this.renderTarget2;\n\n\t}\n\n\tsetSize( width, height ) {\n\n\t\tthis._width = width;\n\t\tthis._height = height;\n\n\t\tconst effectiveWidth = this._width * this._pixelRatio;\n\t\tconst effectiveHeight = this._height * this._pixelRatio;\n\n\t\tthis.renderTarget1.setSize( effectiveWidth, effectiveHeight );\n\t\tthis.renderTarget2.setSize( effectiveWidth, effectiveHeight );\n\n\t\tfor ( let i = 0; i < this.passes.length; i ++ ) {\n\n\t\t\tthis.passes[ i ].setSize( effectiveWidth, effectiveHeight );\n\n\t\t}\n\n\t}\n\n\tsetPixelRatio( pixelRatio ) {\n\n\t\tthis._pixelRatio = pixelRatio;\n\n\t\tthis.setSize( this._width, this._height );\n\n\t}\n\n\tdispose() {\n\n\t\tthis.renderTarget1.dispose();\n\t\tthis.renderTarget2.dispose();\n\n\t\tthis.copyPass.dispose();\n\n\t}\n\n}\n\n\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./node_modules/three/examples/jsm/postprocessing/EffectComposer.js?");
13884
+
13885
+ /***/ }),
13886
+
13887
+ /***/ "./node_modules/three/examples/jsm/postprocessing/MaskPass.js":
13888
+ /*!********************************************************************!*\
13889
+ !*** ./node_modules/three/examples/jsm/postprocessing/MaskPass.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 */ ClearMaskPass: () => (/* binding */ ClearMaskPass),\n/* harmony export */ MaskPass: () => (/* binding */ MaskPass)\n/* harmony export */ });\n/* harmony import */ var _Pass_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Pass.js */ \"./node_modules/three/examples/jsm/postprocessing/Pass.js\");\n\n\nclass MaskPass extends _Pass_js__WEBPACK_IMPORTED_MODULE_0__.Pass {\n\n\tconstructor( scene, camera ) {\n\n\t\tsuper();\n\n\t\tthis.scene = scene;\n\t\tthis.camera = camera;\n\n\t\tthis.clear = true;\n\t\tthis.needsSwap = false;\n\n\t\tthis.inverse = false;\n\n\t}\n\n\trender( renderer, writeBuffer, readBuffer /*, deltaTime, maskActive */ ) {\n\n\t\tconst context = renderer.getContext();\n\t\tconst state = renderer.state;\n\n\t\t// don't update color or depth\n\n\t\tstate.buffers.color.setMask( false );\n\t\tstate.buffers.depth.setMask( false );\n\n\t\t// lock buffers\n\n\t\tstate.buffers.color.setLocked( true );\n\t\tstate.buffers.depth.setLocked( true );\n\n\t\t// set up stencil\n\n\t\tlet writeValue, clearValue;\n\n\t\tif ( this.inverse ) {\n\n\t\t\twriteValue = 0;\n\t\t\tclearValue = 1;\n\n\t\t} else {\n\n\t\t\twriteValue = 1;\n\t\t\tclearValue = 0;\n\n\t\t}\n\n\t\tstate.buffers.stencil.setTest( true );\n\t\tstate.buffers.stencil.setOp( context.REPLACE, context.REPLACE, context.REPLACE );\n\t\tstate.buffers.stencil.setFunc( context.ALWAYS, writeValue, 0xffffffff );\n\t\tstate.buffers.stencil.setClear( clearValue );\n\t\tstate.buffers.stencil.setLocked( true );\n\n\t\t// draw into the stencil buffer\n\n\t\trenderer.setRenderTarget( readBuffer );\n\t\tif ( this.clear ) renderer.clear();\n\t\trenderer.render( this.scene, this.camera );\n\n\t\trenderer.setRenderTarget( writeBuffer );\n\t\tif ( this.clear ) renderer.clear();\n\t\trenderer.render( this.scene, this.camera );\n\n\t\t// unlock color and depth buffer and make them writable for subsequent rendering/clearing\n\n\t\tstate.buffers.color.setLocked( false );\n\t\tstate.buffers.depth.setLocked( false );\n\n\t\tstate.buffers.color.setMask( true );\n\t\tstate.buffers.depth.setMask( true );\n\n\t\t// only render where stencil is set to 1\n\n\t\tstate.buffers.stencil.setLocked( false );\n\t\tstate.buffers.stencil.setFunc( context.EQUAL, 1, 0xffffffff ); // draw if == 1\n\t\tstate.buffers.stencil.setOp( context.KEEP, context.KEEP, context.KEEP );\n\t\tstate.buffers.stencil.setLocked( true );\n\n\t}\n\n}\n\nclass ClearMaskPass extends _Pass_js__WEBPACK_IMPORTED_MODULE_0__.Pass {\n\n\tconstructor() {\n\n\t\tsuper();\n\n\t\tthis.needsSwap = false;\n\n\t}\n\n\trender( renderer /*, writeBuffer, readBuffer, deltaTime, maskActive */ ) {\n\n\t\trenderer.state.buffers.stencil.setLocked( false );\n\t\trenderer.state.buffers.stencil.setTest( false );\n\n\t}\n\n}\n\n\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./node_modules/three/examples/jsm/postprocessing/MaskPass.js?");
13895
+
13896
+ /***/ }),
13897
+
13865
13898
  /***/ "./node_modules/three/examples/jsm/postprocessing/OutlinePass.js":
13866
13899
  /*!***********************************************************************!*\
13867
13900
  !*** ./node_modules/three/examples/jsm/postprocessing/OutlinePass.js ***!
@@ -13884,6 +13917,39 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
13884
13917
 
13885
13918
  /***/ }),
13886
13919
 
13920
+ /***/ "./node_modules/three/examples/jsm/postprocessing/RenderPass.js":
13921
+ /*!**********************************************************************!*\
13922
+ !*** ./node_modules/three/examples/jsm/postprocessing/RenderPass.js ***!
13923
+ \**********************************************************************/
13924
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13925
+
13926
+ "use strict";
13927
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ RenderPass: () => (/* binding */ RenderPass)\n/* harmony export */ });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _Pass_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Pass.js */ \"./node_modules/three/examples/jsm/postprocessing/Pass.js\");\n\n\n\nclass RenderPass extends _Pass_js__WEBPACK_IMPORTED_MODULE_0__.Pass {\n\n\tconstructor( scene, camera, overrideMaterial = null, clearColor = null, clearAlpha = null ) {\n\n\t\tsuper();\n\n\t\tthis.scene = scene;\n\t\tthis.camera = camera;\n\n\t\tthis.overrideMaterial = overrideMaterial;\n\n\t\tthis.clearColor = clearColor;\n\t\tthis.clearAlpha = clearAlpha;\n\n\t\tthis.clear = true;\n\t\tthis.clearDepth = false;\n\t\tthis.needsSwap = false;\n\t\tthis._oldClearColor = new three__WEBPACK_IMPORTED_MODULE_1__.Color();\n\n\t}\n\n\trender( renderer, writeBuffer, readBuffer /*, deltaTime, maskActive */ ) {\n\n\t\tconst oldAutoClear = renderer.autoClear;\n\t\trenderer.autoClear = false;\n\n\t\tlet oldClearAlpha, oldOverrideMaterial;\n\n\t\tif ( this.overrideMaterial !== null ) {\n\n\t\t\toldOverrideMaterial = this.scene.overrideMaterial;\n\n\t\t\tthis.scene.overrideMaterial = this.overrideMaterial;\n\n\t\t}\n\n\t\tif ( this.clearColor !== null ) {\n\n\t\t\trenderer.getClearColor( this._oldClearColor );\n\t\t\trenderer.setClearColor( this.clearColor, renderer.getClearAlpha() );\n\n\t\t}\n\n\t\tif ( this.clearAlpha !== null ) {\n\n\t\t\toldClearAlpha = renderer.getClearAlpha();\n\t\t\trenderer.setClearAlpha( this.clearAlpha );\n\n\t\t}\n\n\t\tif ( this.clearDepth == true ) {\n\n\t\t\trenderer.clearDepth();\n\n\t\t}\n\n\t\trenderer.setRenderTarget( this.renderToScreen ? null : readBuffer );\n\n\t\tif ( this.clear === true ) {\n\n\t\t\t// TODO: Avoid using autoClear properties, see https://github.com/mrdoob/three.js/pull/15571#issuecomment-465669600\n\t\t\trenderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil );\n\n\t\t}\n\n\t\trenderer.render( this.scene, this.camera );\n\n\t\t// restore\n\n\t\tif ( this.clearColor !== null ) {\n\n\t\t\trenderer.setClearColor( this._oldClearColor );\n\n\t\t}\n\n\t\tif ( this.clearAlpha !== null ) {\n\n\t\t\trenderer.setClearAlpha( oldClearAlpha );\n\n\t\t}\n\n\t\tif ( this.overrideMaterial !== null ) {\n\n\t\t\tthis.scene.overrideMaterial = oldOverrideMaterial;\n\n\t\t}\n\n\t\trenderer.autoClear = oldAutoClear;\n\n\t}\n\n}\n\n\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./node_modules/three/examples/jsm/postprocessing/RenderPass.js?");
13928
+
13929
+ /***/ }),
13930
+
13931
+ /***/ "./node_modules/three/examples/jsm/postprocessing/ShaderPass.js":
13932
+ /*!**********************************************************************!*\
13933
+ !*** ./node_modules/three/examples/jsm/postprocessing/ShaderPass.js ***!
13934
+ \**********************************************************************/
13935
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13936
+
13937
+ "use strict";
13938
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ShaderPass: () => (/* binding */ ShaderPass)\n/* harmony export */ });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _Pass_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Pass.js */ \"./node_modules/three/examples/jsm/postprocessing/Pass.js\");\n\n\n\nclass ShaderPass extends _Pass_js__WEBPACK_IMPORTED_MODULE_0__.Pass {\n\n\tconstructor( shader, textureID ) {\n\n\t\tsuper();\n\n\t\tthis.textureID = ( textureID !== undefined ) ? textureID : 'tDiffuse';\n\n\t\tif ( shader instanceof three__WEBPACK_IMPORTED_MODULE_1__.ShaderMaterial ) {\n\n\t\t\tthis.uniforms = shader.uniforms;\n\n\t\t\tthis.material = shader;\n\n\t\t} else if ( shader ) {\n\n\t\t\tthis.uniforms = three__WEBPACK_IMPORTED_MODULE_1__.UniformsUtils.clone( shader.uniforms );\n\n\t\t\tthis.material = new three__WEBPACK_IMPORTED_MODULE_1__.ShaderMaterial( {\n\n\t\t\t\tname: ( shader.name !== undefined ) ? shader.name : 'unspecified',\n\t\t\t\tdefines: Object.assign( {}, shader.defines ),\n\t\t\t\tuniforms: this.uniforms,\n\t\t\t\tvertexShader: shader.vertexShader,\n\t\t\t\tfragmentShader: shader.fragmentShader\n\n\t\t\t} );\n\n\t\t}\n\n\t\tthis.fsQuad = new _Pass_js__WEBPACK_IMPORTED_MODULE_0__.FullScreenQuad( this.material );\n\n\t}\n\n\trender( renderer, writeBuffer, readBuffer /*, deltaTime, maskActive */ ) {\n\n\t\tif ( this.uniforms[ this.textureID ] ) {\n\n\t\t\tthis.uniforms[ this.textureID ].value = readBuffer.texture;\n\n\t\t}\n\n\t\tthis.fsQuad.material = this.material;\n\n\t\tif ( this.renderToScreen ) {\n\n\t\t\trenderer.setRenderTarget( null );\n\t\t\tthis.fsQuad.render( renderer );\n\n\t\t} else {\n\n\t\t\trenderer.setRenderTarget( writeBuffer );\n\t\t\t// TODO: Avoid using autoClear properties, see https://github.com/mrdoob/three.js/pull/15571#issuecomment-465669600\n\t\t\tif ( this.clear ) renderer.clear( renderer.autoClearColor, renderer.autoClearDepth, renderer.autoClearStencil );\n\t\t\tthis.fsQuad.render( renderer );\n\n\t\t}\n\n\t}\n\n\tdispose() {\n\n\t\tthis.material.dispose();\n\n\t\tthis.fsQuad.dispose();\n\n\t}\n\n}\n\n\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./node_modules/three/examples/jsm/postprocessing/ShaderPass.js?");
13939
+
13940
+ /***/ }),
13941
+
13942
+ /***/ "./node_modules/three/examples/jsm/postprocessing/UnrealBloomPass.js":
13943
+ /*!***************************************************************************!*\
13944
+ !*** ./node_modules/three/examples/jsm/postprocessing/UnrealBloomPass.js ***!
13945
+ \***************************************************************************/
13946
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13947
+
13948
+ "use strict";
13949
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ UnrealBloomPass: () => (/* binding */ UnrealBloomPass)\n/* harmony export */ });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var _Pass_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Pass.js */ \"./node_modules/three/examples/jsm/postprocessing/Pass.js\");\n/* harmony import */ var _shaders_CopyShader_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shaders/CopyShader.js */ \"./node_modules/three/examples/jsm/shaders/CopyShader.js\");\n/* harmony import */ var _shaders_LuminosityHighPassShader_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shaders/LuminosityHighPassShader.js */ \"./node_modules/three/examples/jsm/shaders/LuminosityHighPassShader.js\");\n\n\n\n\n\nclass UnrealBloomPass extends _Pass_js__WEBPACK_IMPORTED_MODULE_0__.Pass {\n\n\tconstructor( resolution, strength, radius, threshold ) {\n\n\t\tsuper();\n\n\t\tthis.strength = ( strength !== undefined ) ? strength : 1;\n\t\tthis.radius = radius;\n\t\tthis.threshold = threshold;\n\t\tthis.resolution = ( resolution !== undefined ) ? new three__WEBPACK_IMPORTED_MODULE_1__.Vector2( resolution.x, resolution.y ) : new three__WEBPACK_IMPORTED_MODULE_1__.Vector2( 256, 256 );\n\n\t\t// create color only once here, reuse it later inside the render function\n\t\tthis.clearColor = new three__WEBPACK_IMPORTED_MODULE_1__.Color( 0, 0, 0 );\n\n\t\tthis.renderTargetsHorizontal = [];\n\t\tthis.renderTargetsVertical = [];\n\t\tthis.nMips = 5;\n\t\tlet resx = Math.round( this.resolution.x / 2 );\n\t\tlet resy = Math.round( this.resolution.y / 2 );\n\t\tthis.renderTargetBright = new three__WEBPACK_IMPORTED_MODULE_1__.WebGLRenderTarget( resx, resy);\n\t\tthis.renderTargetBright.texture.name = 'UnrealBloomPass.bright';\n\t\tthis.renderTargetBright.texture.generateMipmaps = false;\n\n\t\tfor ( let i = 0; i < this.nMips; i ++ ) {\n\n\t\t\tconst renderTargetHorizonal = new three__WEBPACK_IMPORTED_MODULE_1__.WebGLRenderTarget( resx, resy );\n\n\t\t\trenderTargetHorizonal.texture.name = 'UnrealBloomPass.h' + i;\n\t\t\trenderTargetHorizonal.texture.generateMipmaps = false;\n\n\t\t\tthis.renderTargetsHorizontal.push( renderTargetHorizonal );\n\n\t\t\tconst renderTargetVertical = new three__WEBPACK_IMPORTED_MODULE_1__.WebGLRenderTarget( resx, resy );\n\n\t\t\trenderTargetVertical.texture.name = 'UnrealBloomPass.v' + i;\n\t\t\trenderTargetVertical.texture.generateMipmaps = false;\n\n\t\t\tthis.renderTargetsVertical.push( renderTargetVertical );\n\n\t\t\tresx = Math.round( resx / 2 );\n\n\t\t\tresy = Math.round( resy / 2 );\n\n\t\t}\n\n\t\t// luminosity high pass material\n\n\t\tif ( _shaders_LuminosityHighPassShader_js__WEBPACK_IMPORTED_MODULE_2__.LuminosityHighPassShader === undefined )\n\t\t\tconsole.error( 'THREE.UnrealBloomPass relies on LuminosityHighPassShader' );\n\n\t\tconst highPassShader = _shaders_LuminosityHighPassShader_js__WEBPACK_IMPORTED_MODULE_2__.LuminosityHighPassShader;\n\t\tthis.highPassUniforms = three__WEBPACK_IMPORTED_MODULE_1__.UniformsUtils.clone( highPassShader.uniforms );\n\n\t\tthis.highPassUniforms[ 'luminosityThreshold' ].value = threshold;\n\t\tthis.highPassUniforms[ 'smoothWidth' ].value = 0.01;\n\n\t\tthis.materialHighPassFilter = new three__WEBPACK_IMPORTED_MODULE_1__.ShaderMaterial( {\n\t\t\tuniforms: this.highPassUniforms,\n\t\t\tvertexShader: highPassShader.vertexShader,\n\t\t\tfragmentShader: highPassShader.fragmentShader,\n\t\t\tdefines: {}\n\t\t} );\n\n\t\t// Gaussian Blur Materials\n\t\tthis.separableBlurMaterials = [];\n\t\tconst kernelSizeArray = [ 3, 5, 7, 9, 11 ];\n\t\tresx = Math.round( this.resolution.x / 2 );\n\t\tresy = Math.round( this.resolution.y / 2 );\n\n\t\tfor ( let i = 0; i < this.nMips; i ++ ) {\n\n\t\t\tthis.separableBlurMaterials.push( this.getSeperableBlurMaterial( kernelSizeArray[ i ] ) );\n\n\t\t\tthis.separableBlurMaterials[ i ].uniforms[ 'texSize' ].value = new three__WEBPACK_IMPORTED_MODULE_1__.Vector2( resx, resy );\n\n\t\t\tresx = Math.round( resx / 2 );\n\n\t\t\tresy = Math.round( resy / 2 );\n\n\t\t}\n\n\t\t// Composite material\n\t\tthis.compositeMaterial = this.getCompositeMaterial( this.nMips );\n\t\tthis.compositeMaterial.uniforms[ 'blurTexture1' ].value = this.renderTargetsVertical[ 0 ].texture;\n\t\tthis.compositeMaterial.uniforms[ 'blurTexture2' ].value = this.renderTargetsVertical[ 1 ].texture;\n\t\tthis.compositeMaterial.uniforms[ 'blurTexture3' ].value = this.renderTargetsVertical[ 2 ].texture;\n\t\tthis.compositeMaterial.uniforms[ 'blurTexture4' ].value = this.renderTargetsVertical[ 3 ].texture;\n\t\tthis.compositeMaterial.uniforms[ 'blurTexture5' ].value = this.renderTargetsVertical[ 4 ].texture;\n\t\tthis.compositeMaterial.uniforms[ 'bloomStrength' ].value = strength;\n\t\tthis.compositeMaterial.uniforms[ 'bloomRadius' ].value = 0.1;\n\t\tthis.compositeMaterial.needsUpdate = true;\n\n\t\tconst bloomFactors = [ 1.0, 0.8, 0.6, 0.4, 0.2 ];\n\t\tthis.compositeMaterial.uniforms[ 'bloomFactors' ].value = bloomFactors;\n\t\tthis.bloomTintColors = [ new three__WEBPACK_IMPORTED_MODULE_1__.Vector3( 1, 1, 1 ), new three__WEBPACK_IMPORTED_MODULE_1__.Vector3( 1, 1, 1 ), new three__WEBPACK_IMPORTED_MODULE_1__.Vector3( 1, 1, 1 ), new three__WEBPACK_IMPORTED_MODULE_1__.Vector3( 1, 1, 1 ), new three__WEBPACK_IMPORTED_MODULE_1__.Vector3( 1, 1, 1 ) ];\n\t\tthis.compositeMaterial.uniforms[ 'bloomTintColors' ].value = this.bloomTintColors;\n\n\t\t// copy material\n\t\tif ( _shaders_CopyShader_js__WEBPACK_IMPORTED_MODULE_3__.CopyShader === undefined ) {\n\n\t\t\tconsole.error( 'THREE.UnrealBloomPass relies on CopyShader' );\n\n\t\t}\n\n\t\tconst copyShader = _shaders_CopyShader_js__WEBPACK_IMPORTED_MODULE_3__.CopyShader;\n\n\t\tthis.copyUniforms = three__WEBPACK_IMPORTED_MODULE_1__.UniformsUtils.clone( copyShader.uniforms );\n\t\tthis.copyUniforms[ 'opacity' ].value = 1.0;\n\n\t\tthis.materialCopy = new three__WEBPACK_IMPORTED_MODULE_1__.ShaderMaterial( {\n\t\t\tuniforms: this.copyUniforms,\n\t\t\tvertexShader: copyShader.vertexShader,\n\t\t\tfragmentShader: copyShader.fragmentShader,\n\t\t\tblending: three__WEBPACK_IMPORTED_MODULE_1__.AdditiveBlending,\n\t\t\tdepthTest: false,\n\t\t\tdepthWrite: false,\n\t\t\ttransparent: true\n\t\t} );\n\n\t\tthis.enabled = true;\n\t\tthis.needsSwap = false;\n\n\t\tthis._oldClearColor = new three__WEBPACK_IMPORTED_MODULE_1__.Color();\n\t\tthis.oldClearAlpha = 1;\n\n\t\tthis.basic = new three__WEBPACK_IMPORTED_MODULE_1__.MeshBasicMaterial({\n\t\t\ttransparent:true\n\t\t});\n\n\t\tthis.fsQuad = new _Pass_js__WEBPACK_IMPORTED_MODULE_0__.FullScreenQuad( null );\n\n\t}\n\n\tdispose() {\n\n\t\tfor ( let i = 0; i < this.renderTargetsHorizontal.length; i ++ ) {\n\n\t\t\tthis.renderTargetsHorizontal[ i ].dispose();\n\n\t\t}\n\n\t\tfor ( let i = 0; i < this.renderTargetsVertical.length; i ++ ) {\n\n\t\t\tthis.renderTargetsVertical[ i ].dispose();\n\n\t\t}\n\n\t\tthis.renderTargetBright.dispose();\n\n\t\t//\n\n\t\tfor ( let i = 0; i < this.separableBlurMaterials.length; i ++ ) {\n\n\t\t\tthis.separableBlurMaterials[ i ].dispose();\n\n\t\t}\n\n\t\tthis.compositeMaterial.dispose();\n\t\tthis.materialCopy.dispose();\n\t\tthis.basic.dispose();\n\n\t\t//\n\n\t\tthis.fsQuad.dispose();\n\n\t}\n\n\tsetSize( width, height ) {\n\n\t\tlet resx = Math.round( width / 2 );\n\t\tlet resy = Math.round( height / 2 );\n\n\t\tthis.renderTargetBright.setSize( resx, resy );\n\n\t\tfor ( let i = 0; i < this.nMips; i ++ ) {\n\n\t\t\tthis.renderTargetsHorizontal[ i ].setSize( resx, resy );\n\t\t\tthis.renderTargetsVertical[ i ].setSize( resx, resy );\n\n\t\t\tthis.separableBlurMaterials[ i ].uniforms[ 'texSize' ].value = new three__WEBPACK_IMPORTED_MODULE_1__.Vector2( resx, resy );\n\n\t\t\tresx = Math.round( resx / 2 );\n\t\t\tresy = Math.round( resy / 2 );\n\n\t\t}\n\n\t}\n\n\trender( renderer, writeBuffer, readBuffer, deltaTime, maskActive ) {\n\n\t\trenderer.getClearColor( this._oldClearColor );\n\t\tthis.oldClearAlpha = renderer.getClearAlpha();\n\t\tconst oldAutoClear = renderer.autoClear;\n\t\trenderer.autoClear = false;\n\n\t\trenderer.setClearColor( this.clearColor, 0 );\n\n\t\tif ( maskActive ) renderer.state.buffers.stencil.setTest( false );\n\n\t\t// Render input to screen\n\n\t\tif ( this.renderToScreen ) {\n\n\t\t\tthis.fsQuad.material = this.basic;\n\t\t\tthis.basic.map = readBuffer.texture;\n\n\t\t\trenderer.setRenderTarget( null );\n\t\t\trenderer.clear();\n\t\t\tthis.fsQuad.render( renderer );\n\n\t\t}\n\n\t\t// 1. Extract Bright Areas\n\n\t\tthis.highPassUniforms[ 'tDiffuse' ].value = readBuffer.texture;\n\t\tthis.highPassUniforms[ 'luminosityThreshold' ].value = this.threshold;\n\t\tthis.fsQuad.material = this.materialHighPassFilter;\n\n\t\trenderer.setRenderTarget( this.renderTargetBright );\n\t\trenderer.clear();\n\t\tthis.fsQuad.render( renderer );\n\n\t\t// 2. Blur All the mips progressively\n\n\t\tlet inputRenderTarget = this.renderTargetBright;\n\n\t\tfor ( let i = 0; i < this.nMips; i ++ ) {\n\n\t\t\tthis.fsQuad.material = this.separableBlurMaterials[ i ];\n\n\t\t\tthis.separableBlurMaterials[ i ].uniforms[ 'colorTexture' ].value = inputRenderTarget.texture;\n\t\t\tthis.separableBlurMaterials[ i ].uniforms[ 'direction' ].value = UnrealBloomPass.BlurDirectionX;\n\t\t\trenderer.setRenderTarget( this.renderTargetsHorizontal[ i ] );\n\t\t\trenderer.clear();\n\t\t\tthis.fsQuad.render( renderer );\n\n\t\t\tthis.separableBlurMaterials[ i ].uniforms[ 'colorTexture' ].value = this.renderTargetsHorizontal[ i ].texture;\n\t\t\tthis.separableBlurMaterials[ i ].uniforms[ 'direction' ].value = UnrealBloomPass.BlurDirectionY;\n\t\t\trenderer.setRenderTarget( this.renderTargetsVertical[ i ] );\n\t\t\trenderer.clear();\n\t\t\tthis.fsQuad.render( renderer );\n\n\t\t\tinputRenderTarget = this.renderTargetsVertical[ i ];\n\n\t\t}\n\n\t\t// Composite All the mips\n\n\t\tthis.fsQuad.material = this.compositeMaterial;\n\t\tthis.compositeMaterial.uniforms[ 'bloomStrength' ].value = this.strength;\n\t\tthis.compositeMaterial.uniforms[ 'bloomRadius' ].value = this.radius;\n\t\tthis.compositeMaterial.uniforms[ 'bloomTintColors' ].value = this.bloomTintColors;\n\n\t\trenderer.setRenderTarget( this.renderTargetsHorizontal[ 0 ] );\n\t\trenderer.clear();\n\t\tthis.fsQuad.render( renderer );\n\n\t\t// Blend it additively over the input texture\n\n\t\tthis.fsQuad.material = this.materialCopy;\n\t\tthis.copyUniforms[ 'tDiffuse' ].value = this.renderTargetsHorizontal[ 0 ].texture;\n\n\t\tif ( maskActive ) renderer.state.buffers.stencil.setTest( true );\n\n\t\tif ( this.renderToScreen ) {\n\n\t\t\trenderer.setRenderTarget( null );\n\t\t\tthis.fsQuad.render( renderer );\n\n\t\t} else {\n\n\t\t\trenderer.setRenderTarget( readBuffer );\n\t\t\tthis.fsQuad.render( renderer );\n\n\t\t}\n\n\t\t// Restore renderer settings\n\n\t\trenderer.setClearColor( this._oldClearColor, this.oldClearAlpha );\n\t\trenderer.autoClear = oldAutoClear;\n\n\t}\n\n\tgetSeperableBlurMaterial( kernelRadius ) {\n\n\t\treturn new three__WEBPACK_IMPORTED_MODULE_1__.ShaderMaterial( {\n\n\t\t\tdefines: {\n\t\t\t\t'KERNEL_RADIUS': kernelRadius,\n\t\t\t\t'SIGMA': kernelRadius\n\t\t\t},\n\n\t\t\tuniforms: {\n\t\t\t\t'colorTexture': { value: null },\n\t\t\t\t'texSize': { value: new three__WEBPACK_IMPORTED_MODULE_1__.Vector2( 0.5, 0.5 ) },\n\t\t\t\t'direction': { value: new three__WEBPACK_IMPORTED_MODULE_1__.Vector2( 0.5, 0.5 ) }\n\t\t\t},\n\n\t\t\tvertexShader:\n\t\t\t\t`varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}`,\n\n\t\t\tfragmentShader:\n\t\t\t\t`#include <common>\n\t\t\t\tvarying vec2 vUv;\n\t\t\t\tuniform sampler2D colorTexture;\n\t\t\t\tuniform vec2 texSize;\n\t\t\t\tuniform vec2 direction;\n\n\t\t\t\tfloat gaussianPdf(in float x, in float sigma) {\n\t\t\t\t\treturn 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma;\n\t\t\t\t}\n\t\t\t\tvoid main() {\n\t\t\t\t\tvec2 invSize = 1.0 / texSize;\n\t\t\t\t\tfloat fSigma = float(SIGMA);\n\t\t\t\t\tfloat weightSum = gaussianPdf(0.0, fSigma);\n\t\t\t\t\tfloat alphaSum = 0.0;\n\t\t\t\t\tvec3 diffuseSum = texture2D( colorTexture, vUv).rgb * weightSum;\n\t\t\t\t\tfor( int i = 1; i < KERNEL_RADIUS; i ++ ) {\n\t\t\t\t\t\tfloat x = float(i);\n\t\t\t\t\t\tfloat w = gaussianPdf(x, fSigma);\n\t\t\t\t\t\tvec2 uvOffset = direction * invSize * x;\n\t\t\t\t\t\tvec4 sample1 = texture2D( colorTexture, vUv + uvOffset);\n\t\t\t\t\t\tvec4 sample2 = texture2D( colorTexture, vUv - uvOffset);\n\t\t\t\t\t\tdiffuseSum += (sample1.rgb + sample2.rgb) * w;\n\t\t\t\t\t\talphaSum += (sample1.a + sample2.a) * w;\n\t\t\t\t\t\tweightSum += 2.0 * w;\n\t\t\t\t\t}\n\t\t\t\t\tgl_FragColor = vec4(diffuseSum/weightSum, alphaSum/weightSum);\n\t\t\t\t}`\n\t\t} );\n\n\t}\n\n\tgetCompositeMaterial( nMips ) {\n\n\t\treturn new three__WEBPACK_IMPORTED_MODULE_1__.ShaderMaterial( {\n\n\t\t\tdefines: {\n\t\t\t\t'NUM_MIPS': nMips\n\t\t\t},\n\n\t\t\tuniforms: {\n\t\t\t\t'blurTexture1': { value: null },\n\t\t\t\t'blurTexture2': { value: null },\n\t\t\t\t'blurTexture3': { value: null },\n\t\t\t\t'blurTexture4': { value: null },\n\t\t\t\t'blurTexture5': { value: null },\n\t\t\t\t'bloomStrength': { value: 1.0 },\n\t\t\t\t'bloomFactors': { value: null },\n\t\t\t\t'bloomTintColors': { value: null },\n\t\t\t\t'bloomRadius': { value: 0.0 }\n\t\t\t},\n\n\t\t\tvertexShader:\n\t\t\t\t`varying vec2 vUv;\n\t\t\t\tvoid main() {\n\t\t\t\t\tvUv = uv;\n\t\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\t\t}`,\n\n\t\t\tfragmentShader:\n\t\t\t\t`varying vec2 vUv;\n\t\t\t\tuniform sampler2D blurTexture1;\n\t\t\t\tuniform sampler2D blurTexture2;\n\t\t\t\tuniform sampler2D blurTexture3;\n\t\t\t\tuniform sampler2D blurTexture4;\n\t\t\t\tuniform sampler2D blurTexture5;\n\t\t\t\tuniform float bloomStrength;\n\t\t\t\tuniform float bloomRadius;\n\t\t\t\tuniform float bloomFactors[NUM_MIPS];\n\t\t\t\tuniform vec3 bloomTintColors[NUM_MIPS];\n\n\t\t\t\tfloat lerpBloomFactor(const in float factor) {\n\t\t\t\t\tfloat mirrorFactor = 1.2 - factor;\n\t\t\t\t\treturn mix(factor, mirrorFactor, bloomRadius);\n\t\t\t\t}\n\n\t\t\t\tvoid main() {\n\t\t\t\t\tgl_FragColor = bloomStrength * ( lerpBloomFactor(bloomFactors[0]) * vec4(bloomTintColors[0], 1.0) * texture2D(blurTexture1, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[1]) * vec4(bloomTintColors[1], 1.0) * texture2D(blurTexture2, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[2]) * vec4(bloomTintColors[2], 1.0) * texture2D(blurTexture3, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[3]) * vec4(bloomTintColors[3], 1.0) * texture2D(blurTexture4, vUv) +\n\t\t\t\t\t\tlerpBloomFactor(bloomFactors[4]) * vec4(bloomTintColors[4], 1.0) * texture2D(blurTexture5, vUv) );\n\t\t\t\t}`\n\t\t} );\n\n\t}\n\n}\n\nUnrealBloomPass.BlurDirectionX = new three__WEBPACK_IMPORTED_MODULE_1__.Vector2( 1.0, 0.0 );\nUnrealBloomPass.BlurDirectionY = new three__WEBPACK_IMPORTED_MODULE_1__.Vector2( 0.0, 1.0 );\n\n\n\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./node_modules/three/examples/jsm/postprocessing/UnrealBloomPass.js?");
13950
+
13951
+ /***/ }),
13952
+
13887
13953
  /***/ "./node_modules/three/examples/jsm/shaders/CopyShader.js":
13888
13954
  /*!***************************************************************!*\
13889
13955
  !*** ./node_modules/three/examples/jsm/shaders/CopyShader.js ***!
@@ -13895,6 +13961,39 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
13895
13961
 
13896
13962
  /***/ }),
13897
13963
 
13964
+ /***/ "./node_modules/three/examples/jsm/shaders/FXAAShader.js":
13965
+ /*!***************************************************************!*\
13966
+ !*** ./node_modules/three/examples/jsm/shaders/FXAAShader.js ***!
13967
+ \***************************************************************/
13968
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13969
+
13970
+ "use strict";
13971
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ FXAAShader: () => (/* binding */ FXAAShader)\n/* harmony export */ });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\n\nconst FXAAShader = {\n\n\tname: 'FXAAShader',\n\n\tuniforms: {\n\n\t\t'tDiffuse': { value: null },\n\t\t'resolution': { value: new three__WEBPACK_IMPORTED_MODULE_0__.Vector2( 1 / 1024, 1 / 512 ) }\n\n\t},\n\n\tvertexShader: /* glsl */`\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}`,\n\n\tfragmentShader: /* glsl */`\n\n\t\t// FXAA algorithm from NVIDIA, C# implementation by Jasper Flick, GLSL port by Dave Hoskins\n\t\t// http://developer.download.nvidia.com/assets/gamedev/files/sdk/11/FXAA_WhitePaper.pdf\n\t\t// https://catlikecoding.com/unity/tutorials/advanced-rendering/fxaa/\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform vec2 resolution;\n\t\tvarying vec2 vUv;\n\n\t\t#define EDGE_STEP_COUNT 6\n\t\t#define EDGE_GUESS 8.0\n\t\t#define EDGE_STEPS 1.0, 1.5, 2.0, 2.0, 2.0, 4.0\n\t\tconst float edgeSteps[EDGE_STEP_COUNT] = float[EDGE_STEP_COUNT]( EDGE_STEPS );\n\n\t\tfloat _ContrastThreshold = 0.0312;\n\t\tfloat _RelativeThreshold = 0.063;\n\t\tfloat _SubpixelBlending = 1.0;\n\n\t\tvec4 Sample( sampler2D tex2D, vec2 uv ) {\n\n\t\t\treturn texture( tex2D, uv );\n\n\t\t}\n\n\t\tfloat SampleLuminance( sampler2D tex2D, vec2 uv ) {\n\n\t\t\treturn dot( Sample( tex2D, uv ).rgb, vec3( 0.3, 0.59, 0.11 ) );\n\n\t\t}\n\n\t\tfloat SampleLuminance( sampler2D tex2D, vec2 texSize, vec2 uv, float uOffset, float vOffset ) {\n\n\t\t\tuv += texSize * vec2(uOffset, vOffset);\n\t\t\treturn SampleLuminance(tex2D, uv);\n\n\t\t}\n\n\t\tstruct LuminanceData {\n\n\t\t\tfloat m, n, e, s, w;\n\t\t\tfloat ne, nw, se, sw;\n\t\t\tfloat highest, lowest, contrast;\n\n\t\t};\n\n\t\tLuminanceData SampleLuminanceNeighborhood( sampler2D tex2D, vec2 texSize, vec2 uv ) {\n\n\t\t\tLuminanceData l;\n\t\t\tl.m = SampleLuminance( tex2D, uv );\n\t\t\tl.n = SampleLuminance( tex2D, texSize, uv, 0.0, 1.0 );\n\t\t\tl.e = SampleLuminance( tex2D, texSize, uv, 1.0, 0.0 );\n\t\t\tl.s = SampleLuminance( tex2D, texSize, uv, 0.0, -1.0 );\n\t\t\tl.w = SampleLuminance( tex2D, texSize, uv, -1.0, 0.0 );\n\n\t\t\tl.ne = SampleLuminance( tex2D, texSize, uv, 1.0, 1.0 );\n\t\t\tl.nw = SampleLuminance( tex2D, texSize, uv, -1.0, 1.0 );\n\t\t\tl.se = SampleLuminance( tex2D, texSize, uv, 1.0, -1.0 );\n\t\t\tl.sw = SampleLuminance( tex2D, texSize, uv, -1.0, -1.0 );\n\n\t\t\tl.highest = max( max( max( max( l.n, l.e ), l.s ), l.w ), l.m );\n\t\t\tl.lowest = min( min( min( min( l.n, l.e ), l.s ), l.w ), l.m );\n\t\t\tl.contrast = l.highest - l.lowest;\n\t\t\treturn l;\n\n\t\t}\n\n\t\tbool ShouldSkipPixel( LuminanceData l ) {\n\n\t\t\tfloat threshold = max( _ContrastThreshold, _RelativeThreshold * l.highest );\n\t\t\treturn l.contrast < threshold;\n\n\t\t}\n\n\t\tfloat DeterminePixelBlendFactor( LuminanceData l ) {\n\n\t\t\tfloat f = 2.0 * ( l.n + l.e + l.s + l.w );\n\t\t\tf += l.ne + l.nw + l.se + l.sw;\n\t\t\tf *= 1.0 / 12.0;\n\t\t\tf = abs( f - l.m );\n\t\t\tf = clamp( f / l.contrast, 0.0, 1.0 );\n\n\t\t\tfloat blendFactor = smoothstep( 0.0, 1.0, f );\n\t\t\treturn blendFactor * blendFactor * _SubpixelBlending;\n\n\t\t}\n\n\t\tstruct EdgeData {\n\n\t\t\tbool isHorizontal;\n\t\t\tfloat pixelStep;\n\t\t\tfloat oppositeLuminance, gradient;\n\n\t\t};\n\n\t\tEdgeData DetermineEdge( vec2 texSize, LuminanceData l ) {\n\n\t\t\tEdgeData e;\n\t\t\tfloat horizontal =\n\t\t\t\tabs( l.n + l.s - 2.0 * l.m ) * 2.0 +\n\t\t\t\tabs( l.ne + l.se - 2.0 * l.e ) +\n\t\t\t\tabs( l.nw + l.sw - 2.0 * l.w );\n\t\t\tfloat vertical =\n\t\t\t\tabs( l.e + l.w - 2.0 * l.m ) * 2.0 +\n\t\t\t\tabs( l.ne + l.nw - 2.0 * l.n ) +\n\t\t\t\tabs( l.se + l.sw - 2.0 * l.s );\n\t\t\te.isHorizontal = horizontal >= vertical;\n\n\t\t\tfloat pLuminance = e.isHorizontal ? l.n : l.e;\n\t\t\tfloat nLuminance = e.isHorizontal ? l.s : l.w;\n\t\t\tfloat pGradient = abs( pLuminance - l.m );\n\t\t\tfloat nGradient = abs( nLuminance - l.m );\n\n\t\t\te.pixelStep = e.isHorizontal ? texSize.y : texSize.x;\n\t\t\t\n\t\t\tif (pGradient < nGradient) {\n\n\t\t\t\te.pixelStep = -e.pixelStep;\n\t\t\t\te.oppositeLuminance = nLuminance;\n\t\t\t\te.gradient = nGradient;\n\n\t\t\t} else {\n\n\t\t\t\te.oppositeLuminance = pLuminance;\n\t\t\t\te.gradient = pGradient;\n\n\t\t\t}\n\n\t\t\treturn e;\n\n\t\t}\n\n\t\tfloat DetermineEdgeBlendFactor( sampler2D tex2D, vec2 texSize, LuminanceData l, EdgeData e, vec2 uv ) {\n\n\t\t\tvec2 uvEdge = uv;\n\t\t\tvec2 edgeStep;\n\t\t\tif (e.isHorizontal) {\n\n\t\t\t\tuvEdge.y += e.pixelStep * 0.5;\n\t\t\t\tedgeStep = vec2( texSize.x, 0.0 );\n\n\t\t\t} else {\n\n\t\t\t\tuvEdge.x += e.pixelStep * 0.5;\n\t\t\t\tedgeStep = vec2( 0.0, texSize.y );\n\n\t\t\t}\n\n\t\t\tfloat edgeLuminance = ( l.m + e.oppositeLuminance ) * 0.5;\n\t\t\tfloat gradientThreshold = e.gradient * 0.25;\n\n\t\t\tvec2 puv = uvEdge + edgeStep * edgeSteps[0];\n\t\t\tfloat pLuminanceDelta = SampleLuminance( tex2D, puv ) - edgeLuminance;\n\t\t\tbool pAtEnd = abs( pLuminanceDelta ) >= gradientThreshold;\n\n\t\t\tfor ( int i = 1; i < EDGE_STEP_COUNT && !pAtEnd; i++ ) {\n\n\t\t\t\tpuv += edgeStep * edgeSteps[i];\n\t\t\t\tpLuminanceDelta = SampleLuminance( tex2D, puv ) - edgeLuminance;\n\t\t\t\tpAtEnd = abs( pLuminanceDelta ) >= gradientThreshold;\n\n\t\t\t}\n\n\t\t\tif ( !pAtEnd ) {\n\n\t\t\t\tpuv += edgeStep * EDGE_GUESS;\n\n\t\t\t}\n\n\t\t\tvec2 nuv = uvEdge - edgeStep * edgeSteps[0];\n\t\t\tfloat nLuminanceDelta = SampleLuminance( tex2D, nuv ) - edgeLuminance;\n\t\t\tbool nAtEnd = abs( nLuminanceDelta ) >= gradientThreshold;\n\n\t\t\tfor ( int i = 1; i < EDGE_STEP_COUNT && !nAtEnd; i++ ) {\n\n\t\t\t\tnuv -= edgeStep * edgeSteps[i];\n\t\t\t\tnLuminanceDelta = SampleLuminance( tex2D, nuv ) - edgeLuminance;\n\t\t\t\tnAtEnd = abs( nLuminanceDelta ) >= gradientThreshold;\n\n\t\t\t}\n\n\t\t\tif ( !nAtEnd ) {\n\n\t\t\t\tnuv -= edgeStep * EDGE_GUESS;\n\n\t\t\t}\n\n\t\t\tfloat pDistance, nDistance;\n\t\t\tif ( e.isHorizontal ) {\n\n\t\t\t\tpDistance = puv.x - uv.x;\n\t\t\t\tnDistance = uv.x - nuv.x;\n\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\tpDistance = puv.y - uv.y;\n\t\t\t\tnDistance = uv.y - nuv.y;\n\n\t\t\t}\n\n\t\t\tfloat shortestDistance;\n\t\t\tbool deltaSign;\n\t\t\tif ( pDistance <= nDistance ) {\n\n\t\t\t\tshortestDistance = pDistance;\n\t\t\t\tdeltaSign = pLuminanceDelta >= 0.0;\n\n\t\t\t} else {\n\n\t\t\t\tshortestDistance = nDistance;\n\t\t\t\tdeltaSign = nLuminanceDelta >= 0.0;\n\n\t\t\t}\n\n\t\t\tif ( deltaSign == ( l.m - edgeLuminance >= 0.0 ) ) {\n\n\t\t\t\treturn 0.0;\n\n\t\t\t}\n\n\t\t\treturn 0.5 - shortestDistance / ( pDistance + nDistance );\n\n\t\t}\n\n\t\tvec4 ApplyFXAA( sampler2D tex2D, vec2 texSize, vec2 uv ) {\n\n\t\t\tLuminanceData luminance = SampleLuminanceNeighborhood( tex2D, texSize, uv );\n\t\t\tif ( ShouldSkipPixel( luminance ) ) {\n\n\t\t\t\treturn Sample( tex2D, uv );\n\n\t\t\t}\n\n\t\t\tfloat pixelBlend = DeterminePixelBlendFactor( luminance );\n\t\t\tEdgeData edge = DetermineEdge( texSize, luminance );\n\t\t\tfloat edgeBlend = DetermineEdgeBlendFactor( tex2D, texSize, luminance, edge, uv );\n\t\t\tfloat finalBlend = max( pixelBlend, edgeBlend );\n\n\t\t\tif (edge.isHorizontal) {\n\n\t\t\t\tuv.y += edge.pixelStep * finalBlend;\n\n\t\t\t} else {\n\n\t\t\t\tuv.x += edge.pixelStep * finalBlend;\n\n\t\t\t}\n\n\t\t\treturn Sample( tex2D, uv );\n\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tgl_FragColor = ApplyFXAA( tDiffuse, resolution.xy, vUv );\n\t\t\t\n\t\t}`\n\n};\n\n\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./node_modules/three/examples/jsm/shaders/FXAAShader.js?");
13972
+
13973
+ /***/ }),
13974
+
13975
+ /***/ "./node_modules/three/examples/jsm/shaders/GammaCorrectionShader.js":
13976
+ /*!**************************************************************************!*\
13977
+ !*** ./node_modules/three/examples/jsm/shaders/GammaCorrectionShader.js ***!
13978
+ \**************************************************************************/
13979
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13980
+
13981
+ "use strict";
13982
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ GammaCorrectionShader: () => (/* binding */ GammaCorrectionShader)\n/* harmony export */ });\n/**\n * Gamma Correction Shader\n * http://en.wikipedia.org/wiki/gamma_correction\n */\n\nconst GammaCorrectionShader = {\n\n\tname: 'GammaCorrectionShader',\n\n\tuniforms: {\n\n\t\t'tDiffuse': { value: null }\n\n\t},\n\n\tvertexShader: /* glsl */`\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}`,\n\n\tfragmentShader: /* glsl */`\n\n\t\tuniform sampler2D tDiffuse;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 tex = texture2D( tDiffuse, vUv );\n\n\t\t\tgl_FragColor = sRGBTransferOETF( tex );\n\n\t\t}`\n\n};\n\n\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./node_modules/three/examples/jsm/shaders/GammaCorrectionShader.js?");
13983
+
13984
+ /***/ }),
13985
+
13986
+ /***/ "./node_modules/three/examples/jsm/shaders/LuminosityHighPassShader.js":
13987
+ /*!*****************************************************************************!*\
13988
+ !*** ./node_modules/three/examples/jsm/shaders/LuminosityHighPassShader.js ***!
13989
+ \*****************************************************************************/
13990
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
13991
+
13992
+ "use strict";
13993
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LuminosityHighPassShader: () => (/* binding */ LuminosityHighPassShader)\n/* harmony export */ });\n/* harmony import */ var three__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n\n\n/**\n * Luminosity\n * http://en.wikipedia.org/wiki/Luminosity\n */\n\nconst LuminosityHighPassShader = {\n\n\tname: 'LuminosityHighPassShader',\n\n\tshaderID: 'luminosityHighPass',\n\n\tuniforms: {\n\n\t\t'tDiffuse': { value: null },\n\t\t'luminosityThreshold': { value: 1.0 },\n\t\t'smoothWidth': { value: 1.0 },\n\t\t'defaultColor': { value: new three__WEBPACK_IMPORTED_MODULE_0__.Color( 0x000000 ) },\n\t\t'defaultOpacity': { value: 0.0 }\n\n\t},\n\n\tvertexShader: /* glsl */`\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvUv = uv;\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t}`,\n\n\tfragmentShader: /* glsl */`\n\n\t\tuniform sampler2D tDiffuse;\n\t\tuniform vec3 defaultColor;\n\t\tuniform float defaultOpacity;\n\t\tuniform float luminosityThreshold;\n\t\tuniform float smoothWidth;\n\n\t\tvarying vec2 vUv;\n\n\t\tvoid main() {\n\n\t\t\tvec4 texel = texture2D( tDiffuse, vUv );\n\n\t\t\tfloat v = luminance( texel.xyz );\n\n\t\t\tvec4 outputColor = vec4( defaultColor.rgb, defaultOpacity );\n\n\t\t\tfloat alpha = smoothstep( luminosityThreshold, luminosityThreshold + smoothWidth, v );\n\n\t\t\tgl_FragColor = mix( outputColor, texel, alpha );\n\n\t\t}`\n\n};\n\n\n\n\n//# sourceURL=webpack://@ohuoy/easymap/./node_modules/three/examples/jsm/shaders/LuminosityHighPassShader.js?");
13994
+
13995
+ /***/ }),
13996
+
13898
13997
  /***/ "./node_modules/tslib/tslib.es6.mjs":
13899
13998
  /*!******************************************!*\
13900
13999
  !*** ./node_modules/tslib/tslib.es6.mjs ***!