@ohuoy/easymap 1.0.18 → 1.0.19
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 +12 -1
- package/dist/example - /345/211/257/346/234/254/bundle.js" +12 -1
- package/dist/example - /345/211/257/346/234/254/index.html" +85 -9
- package/main.js +6 -1
- package/package.json +1 -1
- package/src/components/layer/ThreeScanLayer.js +68 -2
- package/src/components/mapOutScreen.js +181 -0
package/dist/bundle.js
CHANGED
|
@@ -4661,7 +4661,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
4661
4661
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4662
4662
|
|
|
4663
4663
|
"use strict";
|
|
4664
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EasyMap: () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.EasyMap),\n/* harmony export */ EffectComposer: () => (/* reexport safe */
|
|
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_11__.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_18__.FXAAShader),\n/* harmony export */ FontLoader: () => (/* reexport safe */ three_addons_loaders_FontLoader_js__WEBPACK_IMPORTED_MODULE_17__.FontLoader),\n/* harmony export */ GammaCorrectionShader: () => (/* reexport safe */ three_examples_jsm_shaders_GammaCorrectionShader_js__WEBPACK_IMPORTED_MODULE_19__.GammaCorrectionShader),\n/* harmony export */ Line2: () => (/* reexport safe */ three_addons_lines_Line2_js__WEBPACK_IMPORTED_MODULE_6__.Line2),\n/* harmony export */ LineGeometry: () => (/* reexport safe */ three_addons_lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_15__.LineGeometry),\n/* harmony export */ LineMaterial: () => (/* reexport safe */ three_examples_jsm_lines_LineMaterial_js__WEBPACK_IMPORTED_MODULE_16__.LineMaterial),\n/* harmony export */ OrbitControls: () => (/* reexport safe */ three_addons_controls_OrbitControls_js__WEBPACK_IMPORTED_MODULE_7__.OrbitControls),\n/* harmony export */ OutlinePass: () => (/* reexport safe */ three_examples_jsm_postprocessing_OutlinePass_js__WEBPACK_IMPORTED_MODULE_14__.OutlinePass),\n/* harmony export */ RenderPass: () => (/* reexport safe */ three_examples_jsm_postprocessing_RenderPass_js__WEBPACK_IMPORTED_MODULE_12__.RenderPass),\n/* harmony export */ ShaderPass: () => (/* reexport safe */ three_examples_jsm_postprocessing_ShaderPass_js__WEBPACK_IMPORTED_MODULE_13__.ShaderPass),\n/* harmony export */ Three: () => (/* reexport module object */ three__WEBPACK_IMPORTED_MODULE_9__),\n/* harmony export */ TrackballControls: () => (/* reexport safe */ three_addons_controls_TrackballControls_js__WEBPACK_IMPORTED_MODULE_10__.TrackballControls),\n/* harmony export */ UnrealBloomPass: () => (/* reexport safe */ three_examples_jsm_postprocessing_UnrealBloomPass__WEBPACK_IMPORTED_MODULE_8__.UnrealBloomPass),\n/* harmony export */ ant7: () => (/* reexport module object */ _lib_antv_l7__WEBPACK_IMPORTED_MODULE_4__),\n/* harmony export */ mapOutScreen: () => (/* reexport safe */ _src_components_mapOutScreen_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]),\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_9__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var three_addons_controls_TrackballControls_js__WEBPACK_IMPORTED_MODULE_10__ = __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_7__ = __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_11__ = __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_12__ = __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_13__ = __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_14__ = __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_18__ = __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_8__ = __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_15__ = __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_6__ = __webpack_require__(/*! three/addons/lines/Line2.js */ \"./node_modules/three/examples/jsm/lines/Line2.js\");\n/* harmony import */ var three_examples_jsm_lines_LineMaterial_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! three/examples/jsm/lines/LineMaterial.js */ \"./node_modules/three/examples/jsm/lines/LineMaterial.js\");\n/* harmony import */ var three_addons_loaders_FontLoader_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! three/addons/loaders/FontLoader.js */ \"./node_modules/three/examples/jsm/loaders/FontLoader.js\");\n/* harmony import */ var three_examples_jsm_shaders_GammaCorrectionShader_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! three/examples/jsm/shaders/GammaCorrectionShader.js */ \"./node_modules/three/examples/jsm/shaders/GammaCorrectionShader.js\");\n/* harmony import */ var _src_components_mapOutScreen_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./src/components/mapOutScreen.js */ \"./src/components/mapOutScreen.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nwindow.EasyMap = _index__WEBPACK_IMPORTED_MODULE_0__.EasyMap;\nwindow.EmComponents = _src_components_index__WEBPACK_IMPORTED_MODULE_1__;\nwindow.EmUtils = _src_utils_util__WEBPACK_IMPORTED_MODULE_2__;\nwindow.mapOutScreen = _src_components_mapOutScreen_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\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\n//# sourceURL=webpack://@ohuoy/easymap/./main.js?");
|
|
4665
4665
|
|
|
4666
4666
|
/***/ }),
|
|
4667
4667
|
|
|
@@ -4984,6 +4984,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
4984
4984
|
|
|
4985
4985
|
/***/ }),
|
|
4986
4986
|
|
|
4987
|
+
/***/ "./src/components/mapOutScreen.js":
|
|
4988
|
+
/*!****************************************!*\
|
|
4989
|
+
!*** ./src/components/mapOutScreen.js ***!
|
|
4990
|
+
\****************************************/
|
|
4991
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4992
|
+
|
|
4993
|
+
"use strict";
|
|
4994
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\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_antv_l7__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../lib/@antv/l7 */ \"./lib/@antv/l7/es/index.js\");\n/* harmony import */ var _lib_antv_l7_maps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../lib/@antv/l7-maps */ \"./lib/@antv/l7-maps/es/mapbox/index.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\nvar mapOutScreen = /*#__PURE__*/function () {\n function mapOutScreen(center, distance) {\n var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\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 _classCallCheck(this, mapOutScreen);\n _defineProperty(this, \"config\", void 0);\n _defineProperty(this, \"center\", void 0);\n _defineProperty(this, \"distance\", void 0);\n _defineProperty(this, \"target\", void 0);\n _defineProperty(this, \"map\", void 0);\n this.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 if (!this.config.target) {\n this.target = document.createElement('div');\n } else {\n this.target = this.config.target;\n }\n var pix = this.config.pix;\n this.distance = distance;\n this.center = center;\n this.target.style = \"width:\".concat(pix.w, \"px;height:\").concat(pix.h, \"px;z-index:-1;\");\n document.body.appendChild(this.target);\n }\n return _createClass(mapOutScreen, [{\n key: \"getImageList\",\n value: function () {\n var _getImageList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(imageList) {\n var _this = this;\n var center,\n distance,\n bounds,\n scene,\n base64,\n scanLayer,\n i,\n a,\n _base2,\n _args2 = arguments;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n center = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : null;\n distance = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : null;\n distance = distance ? distance : this.distance;\n center = center ? center : this.center;\n bounds = (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.getLayerMapPosition)(distance, (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(center));\n if (this.map) {\n _context2.next = 11;\n break;\n }\n scene = new _lib_antv_l7__WEBPACK_IMPORTED_MODULE_1__.Scene({\n id: this.target,\n // map: new Mapbox({\n // mapInstance: map,\n // }),\n map: new _lib_antv_l7_maps__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n style: this.config.style,\n preserveDrawingBuffer: true,\n //center:transform([114.7198975,23.0446]),\n bounds: [bounds[0], bounds[2]],\n container: this.target,\n opacity: 0.7,\n pitch: 0,\n zoom: 0,\n rotation: 0,\n token: '' //'pk.eyJ1Ijoid2hpdGVidWxkaW5nIiwiYSI6ImNsc3UwaXlnZDIwbDkybG1qbXJ6YnRtcmwifQ.jtQeo0gt3UNTCWw5FEyv_w',\n })\n });\n this.map = scene.map;\n this.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 = _this.map._canvas.toDataURL();\n if (_this.config.type == 'download') {\n (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.downloadFileByBase64)(base64, (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.guid)());\n } //downloadFileByBase64(base64,guid())\n else if (_this.config.type == 'blob') {\n _this.config.callback((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.downloadFileBlobByBase64)(base64));\n }\n _context.next = 17;\n break;\n case 5:\n scanLayer = _this.map.getLayer('threescan-layer');\n if (!scanLayer) {\n scanLayer = new EmComponents.ThreeScanLayer('threescan-layer', {\n opacity: _this.config.opacity,\n textClass: ' map-time zmax '\n });\n _this.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, _this.config.delay);\n case 13:\n _base = _context.sent;\n // map.getCanvas().toDataURL()\n _this.config.callback((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.downloadFileBlobByBase64)(_base));\n _context.next = 8;\n break;\n case 17:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n })));\n _context2.next = 31;\n break;\n case 11:\n this.map.fitBounds([bounds[0], bounds[2]], {\n duration: 200\n });\n _context2.next = 14;\n return (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.sleep)(600);\n case 14:\n if (!(!imageList || imageList.length == 0)) {\n _context2.next = 19;\n break;\n }\n base64 = this.map._canvas.toDataURL();\n if (config.type == 'download') {\n (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.downloadFileByBase64)(base64, (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.guid)());\n } //downloadFileByBase64(base64,guid())\n else if (config.type == 'blob') {\n config.callback((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.downloadFileBlobByBase64)(base64));\n }\n _context2.next = 31;\n break;\n case 19:\n scanLayer = map.getLayer('threescan-layer');\n if (!scanLayer) {\n scanLayer = new EmComponents.ThreeScanLayer('threescan-layer', {\n opacity: config.opacity,\n textClass: ' map-time zmax '\n });\n this.map.addLayer(scanLayer);\n }\n _context2.t0 = _regeneratorRuntime().keys(imageList);\n case 22:\n if ((_context2.t1 = _context2.t0()).done) {\n _context2.next = 31;\n break;\n }\n i = _context2.t1.value;\n a = imageList[i];\n _context2.next = 27;\n return scanLayer.drawImageList(a, config.delay);\n case 27:\n _base2 = _context2.sent;\n // map.getCanvas().toDataURL()\n config.callback((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.downloadFileBlobByBase64)(_base2));\n _context2.next = 22;\n break;\n case 31:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function getImageList(_x) {\n return _getImageList.apply(this, arguments);\n }\n return getImageList;\n }()\n }]);\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mapOutScreen);\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/mapOutScreen.js?");
|
|
4995
|
+
|
|
4996
|
+
/***/ }),
|
|
4997
|
+
|
|
4987
4998
|
/***/ "./src/utils/CameraSync.js":
|
|
4988
4999
|
/*!*********************************!*\
|
|
4989
5000
|
!*** ./src/utils/CameraSync.js ***!
|
|
@@ -4661,7 +4661,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
4661
4661
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4662
4662
|
|
|
4663
4663
|
"use strict";
|
|
4664
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ EasyMap: () => (/* reexport safe */ _index__WEBPACK_IMPORTED_MODULE_0__.EasyMap),\n/* harmony export */ EffectComposer: () => (/* reexport safe */
|
|
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_11__.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_18__.FXAAShader),\n/* harmony export */ FontLoader: () => (/* reexport safe */ three_addons_loaders_FontLoader_js__WEBPACK_IMPORTED_MODULE_17__.FontLoader),\n/* harmony export */ GammaCorrectionShader: () => (/* reexport safe */ three_examples_jsm_shaders_GammaCorrectionShader_js__WEBPACK_IMPORTED_MODULE_19__.GammaCorrectionShader),\n/* harmony export */ Line2: () => (/* reexport safe */ three_addons_lines_Line2_js__WEBPACK_IMPORTED_MODULE_6__.Line2),\n/* harmony export */ LineGeometry: () => (/* reexport safe */ three_addons_lines_LineGeometry_js__WEBPACK_IMPORTED_MODULE_15__.LineGeometry),\n/* harmony export */ LineMaterial: () => (/* reexport safe */ three_examples_jsm_lines_LineMaterial_js__WEBPACK_IMPORTED_MODULE_16__.LineMaterial),\n/* harmony export */ OrbitControls: () => (/* reexport safe */ three_addons_controls_OrbitControls_js__WEBPACK_IMPORTED_MODULE_7__.OrbitControls),\n/* harmony export */ OutlinePass: () => (/* reexport safe */ three_examples_jsm_postprocessing_OutlinePass_js__WEBPACK_IMPORTED_MODULE_14__.OutlinePass),\n/* harmony export */ RenderPass: () => (/* reexport safe */ three_examples_jsm_postprocessing_RenderPass_js__WEBPACK_IMPORTED_MODULE_12__.RenderPass),\n/* harmony export */ ShaderPass: () => (/* reexport safe */ three_examples_jsm_postprocessing_ShaderPass_js__WEBPACK_IMPORTED_MODULE_13__.ShaderPass),\n/* harmony export */ Three: () => (/* reexport module object */ three__WEBPACK_IMPORTED_MODULE_9__),\n/* harmony export */ TrackballControls: () => (/* reexport safe */ three_addons_controls_TrackballControls_js__WEBPACK_IMPORTED_MODULE_10__.TrackballControls),\n/* harmony export */ UnrealBloomPass: () => (/* reexport safe */ three_examples_jsm_postprocessing_UnrealBloomPass__WEBPACK_IMPORTED_MODULE_8__.UnrealBloomPass),\n/* harmony export */ ant7: () => (/* reexport module object */ _lib_antv_l7__WEBPACK_IMPORTED_MODULE_4__),\n/* harmony export */ mapOutScreen: () => (/* reexport safe */ _src_components_mapOutScreen_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]),\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_9__ = __webpack_require__(/*! three */ \"./node_modules/three/build/three.module.js\");\n/* harmony import */ var three_addons_controls_TrackballControls_js__WEBPACK_IMPORTED_MODULE_10__ = __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_7__ = __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_11__ = __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_12__ = __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_13__ = __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_14__ = __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_18__ = __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_8__ = __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_15__ = __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_6__ = __webpack_require__(/*! three/addons/lines/Line2.js */ \"./node_modules/three/examples/jsm/lines/Line2.js\");\n/* harmony import */ var three_examples_jsm_lines_LineMaterial_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! three/examples/jsm/lines/LineMaterial.js */ \"./node_modules/three/examples/jsm/lines/LineMaterial.js\");\n/* harmony import */ var three_addons_loaders_FontLoader_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! three/addons/loaders/FontLoader.js */ \"./node_modules/three/examples/jsm/loaders/FontLoader.js\");\n/* harmony import */ var three_examples_jsm_shaders_GammaCorrectionShader_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! three/examples/jsm/shaders/GammaCorrectionShader.js */ \"./node_modules/three/examples/jsm/shaders/GammaCorrectionShader.js\");\n/* harmony import */ var _src_components_mapOutScreen_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./src/components/mapOutScreen.js */ \"./src/components/mapOutScreen.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nwindow.EasyMap = _index__WEBPACK_IMPORTED_MODULE_0__.EasyMap;\nwindow.EmComponents = _src_components_index__WEBPACK_IMPORTED_MODULE_1__;\nwindow.EmUtils = _src_utils_util__WEBPACK_IMPORTED_MODULE_2__;\nwindow.mapOutScreen = _src_components_mapOutScreen_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\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\n//# sourceURL=webpack://@ohuoy/easymap/./main.js?");
|
|
4665
4665
|
|
|
4666
4666
|
/***/ }),
|
|
4667
4667
|
|
|
@@ -4984,6 +4984,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
4984
4984
|
|
|
4985
4985
|
/***/ }),
|
|
4986
4986
|
|
|
4987
|
+
/***/ "./src/components/mapOutScreen.js":
|
|
4988
|
+
/*!****************************************!*\
|
|
4989
|
+
!*** ./src/components/mapOutScreen.js ***!
|
|
4990
|
+
\****************************************/
|
|
4991
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
4992
|
+
|
|
4993
|
+
"use strict";
|
|
4994
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\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_antv_l7__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../lib/@antv/l7 */ \"./lib/@antv/l7/es/index.js\");\n/* harmony import */ var _lib_antv_l7_maps__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../lib/@antv/l7-maps */ \"./lib/@antv/l7-maps/es/mapbox/index.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); }\nfunction _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"next\", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, \"throw\", n); } _next(void 0); }); }; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\n\n\n\nvar mapOutScreen = /*#__PURE__*/function () {\n function mapOutScreen(center, distance) {\n var config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {\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 _classCallCheck(this, mapOutScreen);\n _defineProperty(this, \"config\", void 0);\n _defineProperty(this, \"center\", void 0);\n _defineProperty(this, \"distance\", void 0);\n _defineProperty(this, \"target\", void 0);\n _defineProperty(this, \"map\", void 0);\n this.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 if (!this.config.target) {\n this.target = document.createElement('div');\n } else {\n this.target = this.config.target;\n }\n var pix = this.config.pix;\n this.distance = distance;\n this.center = center;\n this.target.style = \"width:\".concat(pix.w, \"px;height:\").concat(pix.h, \"px;z-index:-1;\");\n document.body.appendChild(this.target);\n }\n return _createClass(mapOutScreen, [{\n key: \"getImageList\",\n value: function () {\n var _getImageList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(imageList) {\n var _this = this;\n var center,\n distance,\n bounds,\n scene,\n base64,\n scanLayer,\n i,\n a,\n _base2,\n _args2 = arguments;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n center = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : null;\n distance = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : null;\n distance = distance ? distance : this.distance;\n center = center ? center : this.center;\n bounds = (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.getLayerMapPosition)(distance, (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.transform)(center));\n if (this.map) {\n _context2.next = 11;\n break;\n }\n scene = new _lib_antv_l7__WEBPACK_IMPORTED_MODULE_1__.Scene({\n id: this.target,\n // map: new Mapbox({\n // mapInstance: map,\n // }),\n map: new _lib_antv_l7_maps__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n style: this.config.style,\n preserveDrawingBuffer: true,\n //center:transform([114.7198975,23.0446]),\n bounds: [bounds[0], bounds[2]],\n container: this.target,\n opacity: 0.7,\n pitch: 0,\n zoom: 0,\n rotation: 0,\n token: '' //'pk.eyJ1Ijoid2hpdGVidWxkaW5nIiwiYSI6ImNsc3UwaXlnZDIwbDkybG1qbXJ6YnRtcmwifQ.jtQeo0gt3UNTCWw5FEyv_w',\n })\n });\n this.map = scene.map;\n this.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 = _this.map._canvas.toDataURL();\n if (_this.config.type == 'download') {\n (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.downloadFileByBase64)(base64, (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.guid)());\n } //downloadFileByBase64(base64,guid())\n else if (_this.config.type == 'blob') {\n _this.config.callback((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.downloadFileBlobByBase64)(base64));\n }\n _context.next = 17;\n break;\n case 5:\n scanLayer = _this.map.getLayer('threescan-layer');\n if (!scanLayer) {\n scanLayer = new EmComponents.ThreeScanLayer('threescan-layer', {\n opacity: _this.config.opacity,\n textClass: ' map-time zmax '\n });\n _this.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, _this.config.delay);\n case 13:\n _base = _context.sent;\n // map.getCanvas().toDataURL()\n _this.config.callback((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.downloadFileBlobByBase64)(_base));\n _context.next = 8;\n break;\n case 17:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n })));\n _context2.next = 31;\n break;\n case 11:\n this.map.fitBounds([bounds[0], bounds[2]], {\n duration: 200\n });\n _context2.next = 14;\n return (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.sleep)(600);\n case 14:\n if (!(!imageList || imageList.length == 0)) {\n _context2.next = 19;\n break;\n }\n base64 = this.map._canvas.toDataURL();\n if (config.type == 'download') {\n (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.downloadFileByBase64)(base64, (0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.guid)());\n } //downloadFileByBase64(base64,guid())\n else if (config.type == 'blob') {\n config.callback((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.downloadFileBlobByBase64)(base64));\n }\n _context2.next = 31;\n break;\n case 19:\n scanLayer = map.getLayer('threescan-layer');\n if (!scanLayer) {\n scanLayer = new EmComponents.ThreeScanLayer('threescan-layer', {\n opacity: config.opacity,\n textClass: ' map-time zmax '\n });\n this.map.addLayer(scanLayer);\n }\n _context2.t0 = _regeneratorRuntime().keys(imageList);\n case 22:\n if ((_context2.t1 = _context2.t0()).done) {\n _context2.next = 31;\n break;\n }\n i = _context2.t1.value;\n a = imageList[i];\n _context2.next = 27;\n return scanLayer.drawImageList(a, config.delay);\n case 27:\n _base2 = _context2.sent;\n // map.getCanvas().toDataURL()\n config.callback((0,_utils_util__WEBPACK_IMPORTED_MODULE_0__.downloadFileBlobByBase64)(_base2));\n _context2.next = 22;\n break;\n case 31:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2, this);\n }));\n function getImageList(_x) {\n return _getImageList.apply(this, arguments);\n }\n return getImageList;\n }()\n }]);\n}();\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (mapOutScreen);\n\n//# sourceURL=webpack://@ohuoy/easymap/./src/components/mapOutScreen.js?");
|
|
4995
|
+
|
|
4996
|
+
/***/ }),
|
|
4997
|
+
|
|
4987
4998
|
/***/ "./src/utils/CameraSync.js":
|
|
4988
4999
|
/*!*********************************!*\
|
|
4989
5000
|
!*** ./src/utils/CameraSync.js ***!
|
|
@@ -131,14 +131,27 @@
|
|
|
131
131
|
//可同时在多个地点画图
|
|
132
132
|
//类比高德自定义 AMap.CanvasLayer AMap.ImageLayer
|
|
133
133
|
//list 为图片数组 可以同时在多位置画图 单一站点传入一个数据即可 list内容实时更新
|
|
134
|
-
let list =
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
134
|
+
let list =
|
|
135
|
+
[
|
|
136
|
+
{
|
|
137
|
+
"url": "http://192.168.11.93:3395/scan/image/20250104/JYANG_370102_G2_01_20250104000336_2@517_90_500_10_0@.png",
|
|
138
|
+
"siteId": "testid",
|
|
139
|
+
"center": [
|
|
140
|
+
"117.185366",
|
|
141
|
+
"36.974600"
|
|
142
|
+
],
|
|
143
|
+
"width": 517/500 * 1000,
|
|
144
|
+
"distance": 6
|
|
145
|
+
}
|
|
146
|
+
]
|
|
147
|
+
// [{
|
|
148
|
+
// url:'http://124.133.246.59:13395/scan/image/20250122/ANHUI_341100_G2_01_20250122152042_182_2@517_90.2_500_6_0@.png',
|
|
149
|
+
// siteId:'testid',
|
|
150
|
+
// // text:'2024-01-01', //展示图片时上方显示文本 一般是时间
|
|
151
|
+
// center:[108.7198975,35.0446],
|
|
152
|
+
// width:517/500 * 600, //图片实际公里数
|
|
153
|
+
// distance:6 //设置字体位置
|
|
154
|
+
// }]
|
|
142
155
|
let scanLayer = emap.map.getLayer('threescan-layer');
|
|
143
156
|
if(!scanLayer){
|
|
144
157
|
scanLayer= new EmComponents.ThreeScanLayer('threescan-layer',{
|
|
@@ -641,9 +654,15 @@ function resetToolBar(){
|
|
|
641
654
|
}
|
|
642
655
|
|
|
643
656
|
function getBoundsImage(center,distance){
|
|
644
|
-
|
|
657
|
+
|
|
658
|
+
|
|
645
659
|
// console.log(emap.map._canvas.toDataURL())
|
|
646
660
|
center = [117.701466,32.511041];distance = 6;
|
|
661
|
+
let bounds = EmUtils.getLayerMapPosition(distance,center);
|
|
662
|
+
console.log(emap.map,bounds)
|
|
663
|
+
emap.map.fitBounds([bounds[1],bounds[3]],{duration:200}).then(()=>{
|
|
664
|
+
console.log(111)
|
|
665
|
+
})
|
|
647
666
|
let imgList = ["http://124.133.246.59:13395/scan/image/20250122/ANHUI_341100_G2_01_20250122152914_182_2@517_90.2_500_6_0@.png",
|
|
648
667
|
"http://124.133.246.59:13395/scan/image/20250122/ANHUI_341100_G2_01_20250122153746_182_2@517_90.2_500_6_0@.png",
|
|
649
668
|
"http://124.133.246.59:13395/scan/image/20250122/ANHUI_341100_G2_01_20250122154618_182_2@517_90.2_500_6_0@.png",
|
|
@@ -661,6 +680,7 @@ function resetToolBar(){
|
|
|
661
680
|
distance:6 //设置字体位置
|
|
662
681
|
}]
|
|
663
682
|
})
|
|
683
|
+
|
|
664
684
|
//获取背景
|
|
665
685
|
// emap.getMapImageByDistance([117.701466,32.511041],6,'http://dbcenter.gyquantum.com/easymap/styles/light',{
|
|
666
686
|
// callback:(blob)=>{
|
|
@@ -702,6 +722,61 @@ function resetToolBar(){
|
|
|
702
722
|
})
|
|
703
723
|
|
|
704
724
|
}
|
|
725
|
+
|
|
726
|
+
|
|
727
|
+
function getBoundsImage2(center,distance){
|
|
728
|
+
|
|
729
|
+
console.log(mapOutScreen)
|
|
730
|
+
// console.log(emap.map._canvas.toDataURL())
|
|
731
|
+
center = [117.701466,32.511041];distance = 6;
|
|
732
|
+
let bounds = EmUtils.getLayerMapPosition(distance,center);
|
|
733
|
+
let imgList = ["http://124.133.246.59:13395/scan/image/20250122/ANHUI_341100_G2_01_20250122152914_182_2@517_90.2_500_6_0@.png",
|
|
734
|
+
"http://124.133.246.59:13395/scan/image/20250122/ANHUI_341100_G2_01_20250122153746_182_2@517_90.2_500_6_0@.png",
|
|
735
|
+
"http://124.133.246.59:13395/scan/image/20250122/ANHUI_341100_G2_01_20250122154618_182_2@517_90.2_500_6_0@.png",
|
|
736
|
+
"http://124.133.246.59:13395/scan/image/20250122/ANHUI_341100_G2_01_20250122155450_182_2@517_90.2_500_6_0@.png",
|
|
737
|
+
"http://124.133.246.59:13395/scan/image/20250122/ANHUI_341100_G2_01_20250122160322_182_2@517_90.2_500_6_0@.png",
|
|
738
|
+
"http://124.133.246.59:13395/scan/image/20250122/ANHUI_341100_G2_01_20250122161154_182_2@517_90.2_500_6_0@.png"
|
|
739
|
+
]
|
|
740
|
+
let _imgList = imgList.map(a=>{
|
|
741
|
+
return [{
|
|
742
|
+
url:a,
|
|
743
|
+
siteId:'testid',
|
|
744
|
+
// text:'2024-01-01', //展示图片时上方显示文本 一般是时间
|
|
745
|
+
center:center,
|
|
746
|
+
width:517, //图片实际公里数
|
|
747
|
+
distance:6 //设置字体位置
|
|
748
|
+
}]
|
|
749
|
+
})
|
|
750
|
+
let mapouts = new mapOutScreen(center,6,{ style:'http://dbcenter.gyquantum.com/easymap/styles/light',callback:(_imageList)=>{
|
|
751
|
+
console.log(_imageList)
|
|
752
|
+
}})
|
|
753
|
+
mapouts.getImageList(_imgList)
|
|
754
|
+
|
|
755
|
+
//获取地图截图
|
|
756
|
+
// let blobList = []
|
|
757
|
+
// emap.getMapImageByDistance(center,distance,_imgList,{
|
|
758
|
+
// style:'http://dbcenter.gyquantum.com/easymap/styles/light',
|
|
759
|
+
// callback:(blob)=>{
|
|
760
|
+
// //保存到本地
|
|
761
|
+
// blobList.push(blob)
|
|
762
|
+
// if(blobList.length == _imgList.length){
|
|
763
|
+
// blobList.forEach(_blob=>{
|
|
764
|
+
// let url = window.URL.createObjectURL(_blob); // 生成文件在浏览器中的链接
|
|
765
|
+
// let a = document.createElement('a');
|
|
766
|
+
// a.href = url;
|
|
767
|
+
// a.download = 'bg'; // 文件名
|
|
768
|
+
// a.style.display = 'none';
|
|
769
|
+
// document.body.appendChild(a);
|
|
770
|
+
// a.click();
|
|
771
|
+
// document.body.removeChild(a);
|
|
772
|
+
// window.URL.revokeObjectURL(url);
|
|
773
|
+
// })
|
|
774
|
+
|
|
775
|
+
// }
|
|
776
|
+
// }
|
|
777
|
+
// })
|
|
778
|
+
|
|
779
|
+
}
|
|
705
780
|
</script>
|
|
706
781
|
</head>
|
|
707
782
|
<body>
|
|
@@ -733,6 +808,7 @@ function resetToolBar(){
|
|
|
733
808
|
<button onclick="drawWallToMap()">添加走航图(随便画的)</button>
|
|
734
809
|
<button onclick="resetToolBar()">修改工具栏定位点位置</button>
|
|
735
810
|
<button onclick="getBoundsImage()">获取位置截图</button>
|
|
811
|
+
<button onclick="getBoundsImage2()">获取位置截图2</button>
|
|
736
812
|
<button id="setTile" onclick="setMapTile()">设置图层【点击自动切换】【当前标准图层】</button>
|
|
737
813
|
<input id="lnglat" />
|
|
738
814
|
<button onclick="markerTo()">标记位置[经纬度用,隔开]</button>
|
package/main.js
CHANGED
|
@@ -19,14 +19,18 @@ import { FontLoader } from 'three/addons/loaders/FontLoader.js';
|
|
|
19
19
|
import {
|
|
20
20
|
GammaCorrectionShader
|
|
21
21
|
} from 'three/examples/jsm/shaders/GammaCorrectionShader.js';
|
|
22
|
+
import mapOutScreen from './src/components/mapOutScreen.js'
|
|
22
23
|
window.EasyMap = EasyMap
|
|
23
24
|
window.EmComponents = EmComponents
|
|
24
25
|
window.EmUtils = EmUtils
|
|
26
|
+
window.mapOutScreen = mapOutScreen;
|
|
25
27
|
// const modulesFiles = import.meta.glob('./src/components/*.js')
|
|
26
28
|
// console.log(modulesFiles)
|
|
27
29
|
// Object.entries(modulesFiles).forEach(a=>{
|
|
28
30
|
// console.log(a)
|
|
29
31
|
// })
|
|
32
|
+
|
|
33
|
+
|
|
30
34
|
export {
|
|
31
35
|
EasyMap,
|
|
32
36
|
EmComponents,
|
|
@@ -46,5 +50,6 @@ export {
|
|
|
46
50
|
LineMaterial,
|
|
47
51
|
FontLoader,
|
|
48
52
|
FXAAShader,
|
|
49
|
-
GammaCorrectionShader
|
|
53
|
+
GammaCorrectionShader,
|
|
54
|
+
mapOutScreen
|
|
50
55
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
import {hasProperty,transform,downloadFileByBase64, sleep} from '../../utils/util'
|
|
2
|
+
import {getLayerMapPosition,hasProperty,transform,downloadFileByBase64, sleep} from '../../utils/util'
|
|
3
3
|
import mapboxgl from '../../../lib/mapbox-gl/dist/mapbox-gl.js';
|
|
4
|
+
|
|
5
|
+
import { LineGeometry } from 'three/addons/lines/LineGeometry.js';
|
|
6
|
+
import { Line2 } from 'three/addons/lines/Line2.js';
|
|
7
|
+
import {LineMaterial} from 'three/examples/jsm/lines/LineMaterial.js'
|
|
4
8
|
import * as THREE from 'three'
|
|
5
9
|
import { Threebox } from 'threebox-plugin';
|
|
6
10
|
var tb = {};
|
|
@@ -35,7 +39,8 @@ export default class ThreeScanLayer{
|
|
|
35
39
|
tb.update();
|
|
36
40
|
this.map.triggerRepaint();
|
|
37
41
|
await sleep(delay)
|
|
38
|
-
|
|
42
|
+
let canvas = this.map.getCanvas()
|
|
43
|
+
return canvas.toDataURL();
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
remove(point){
|
|
@@ -60,6 +65,60 @@ export default class ThreeScanLayer{
|
|
|
60
65
|
}
|
|
61
66
|
}
|
|
62
67
|
|
|
68
|
+
|
|
69
|
+
rectMesh={
|
|
70
|
+
mesh:null,
|
|
71
|
+
w:0.5,
|
|
72
|
+
lng:0,
|
|
73
|
+
lat:0
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
updateRect(point){
|
|
77
|
+
let w = point.rect.width ? point.rect.width: this.rectMesh.w
|
|
78
|
+
if(!this.rectMesh.mesh || w!= this.rectMesh.w || point.rect.position[0]!=this.rectMesh.lng || point.rect.position[1] !=this.rectMesh.lat){
|
|
79
|
+
if(this.rectMesh.mesh){
|
|
80
|
+
tb.remove(this.rectMesh.mesh)
|
|
81
|
+
}
|
|
82
|
+
let bounds = getLayerMapPosition(w,transform(point.rect.position))
|
|
83
|
+
bounds.push(bounds[0])
|
|
84
|
+
var lineOptions = {
|
|
85
|
+
geometry: bounds,
|
|
86
|
+
color: 0xff1f00, // color based on latitude of endpoint
|
|
87
|
+
width: 20 // random width between 1 and 2
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
let lineMesh = tb.line(lineOptions);
|
|
91
|
+
this.rectMesh.mesh = lineMesh;
|
|
92
|
+
tb.add(lineMesh)
|
|
93
|
+
// if(this.rectMesh.mesh){
|
|
94
|
+
// tb.remove(this.rectMesh.mesh)
|
|
95
|
+
// }
|
|
96
|
+
// let plane = new THREE.PlaneGeometry( w*20,w*20);
|
|
97
|
+
// let material = new THREE.MeshLambertMaterial({
|
|
98
|
+
// color: 0x004444,
|
|
99
|
+
// transparent:true,
|
|
100
|
+
// opacity:0.5,
|
|
101
|
+
// });
|
|
102
|
+
// let mesh = new THREE.Mesh(plane, material);
|
|
103
|
+
// let edges = new THREE.EdgesGeometry(plane);
|
|
104
|
+
// let edgesMaterial = new THREE.LineBasicMaterial({
|
|
105
|
+
// color: 0xffffff,
|
|
106
|
+
// linewidth:5
|
|
107
|
+
// })
|
|
108
|
+
|
|
109
|
+
// let line = new THREE.LineSegments(edges, edgesMaterial);
|
|
110
|
+
// mesh.add(line);
|
|
111
|
+
// mesh = tb.Object3D({ obj: mesh, units: 'meters',fixedZoom :15 ,anchor:'center'});
|
|
112
|
+
// this.rectMesh.mesh = mesh;
|
|
113
|
+
// this.rectMesh.w = w;
|
|
114
|
+
|
|
115
|
+
}
|
|
116
|
+
// if(this.rectMesh.mesh){
|
|
117
|
+
// this.rectMesh.mesh.setCoords(transform(point.rect.position))
|
|
118
|
+
// tb.add(this.rectMesh.mesh);
|
|
119
|
+
// }
|
|
120
|
+
}
|
|
121
|
+
|
|
63
122
|
async update(point){
|
|
64
123
|
let texture
|
|
65
124
|
point.text = point.text ? point.text:''
|
|
@@ -107,6 +166,9 @@ export default class ThreeScanLayer{
|
|
|
107
166
|
}
|
|
108
167
|
_point.mesh.model.material.map = texture
|
|
109
168
|
_point.mesh.label.element.innerHTML = point.text
|
|
169
|
+
if(point.rect){
|
|
170
|
+
this.updateRect(point)
|
|
171
|
+
}
|
|
110
172
|
}else{
|
|
111
173
|
let geometry = new THREE.PlaneGeometry(point.width *20,point.width*20);
|
|
112
174
|
//geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));
|
|
@@ -129,9 +191,13 @@ export default class ThreeScanLayer{
|
|
|
129
191
|
mesh.label.element.innerHTML = point.text
|
|
130
192
|
point.mesh = mesh;
|
|
131
193
|
this.drawArray.push(point)
|
|
194
|
+
if(point.rect){
|
|
195
|
+
this.updateRect(point)
|
|
196
|
+
}
|
|
132
197
|
}
|
|
133
198
|
}
|
|
134
199
|
|
|
200
|
+
|
|
135
201
|
drawImage(point){
|
|
136
202
|
let texture
|
|
137
203
|
if(point.image){
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { getLayerMapPosition, transform,downloadFileByBase64,downloadFileBlobByBase64,guid,downloadFile,downloadFileByBlob, sleep} from '../utils/util'
|
|
2
|
+
import { Scene ,HeatmapLayer,LineLayer, PointLayer, PolygonLayer,ExportImage,Fullscreen} from '../../lib/@antv/l7';
|
|
3
|
+
import { Mapbox } from '../../lib/@antv/l7-maps';
|
|
4
|
+
const mapOutScreen = class {
|
|
5
|
+
config;
|
|
6
|
+
center;
|
|
7
|
+
distance;
|
|
8
|
+
target;
|
|
9
|
+
canvas;
|
|
10
|
+
map;
|
|
11
|
+
ctx;
|
|
12
|
+
progress=()=>{}
|
|
13
|
+
constructor(center,distance,config = {
|
|
14
|
+
target:null,
|
|
15
|
+
style: 'http://192.168.11.93:1234/api/styles/osm',
|
|
16
|
+
type:'blob',
|
|
17
|
+
pix:{
|
|
18
|
+
w:1024,
|
|
19
|
+
h:1024
|
|
20
|
+
},
|
|
21
|
+
callback:()=>{}
|
|
22
|
+
},progress){
|
|
23
|
+
this.config = Object.assign({},{
|
|
24
|
+
target:null,
|
|
25
|
+
type:'blob',
|
|
26
|
+
delay:300,
|
|
27
|
+
pix:{
|
|
28
|
+
w:1024,
|
|
29
|
+
h:1024
|
|
30
|
+
},
|
|
31
|
+
opacity:0.7,
|
|
32
|
+
style: 'http://192.168.11.93:1234/api/styles/osm',
|
|
33
|
+
callback:()=>{},
|
|
34
|
+
},config)
|
|
35
|
+
|
|
36
|
+
if(!this.config.target) {
|
|
37
|
+
this.target = document.createElement('div');
|
|
38
|
+
}
|
|
39
|
+
else{
|
|
40
|
+
this.target = this.config.target;
|
|
41
|
+
}
|
|
42
|
+
this.canvas = document.createElement('canvas')
|
|
43
|
+
this.ctx = this.canvas.getContext('2d')
|
|
44
|
+
let pix = this.config.pix;
|
|
45
|
+
this.distance = distance
|
|
46
|
+
this.center = center;
|
|
47
|
+
this.progress = progress ? progress: this.progress;
|
|
48
|
+
this.target.style = `width:${pix.w}px;height:${pix.h}px;z-index:-1;`
|
|
49
|
+
this.canvas.width = pix.w
|
|
50
|
+
this.canvas.height = pix.h
|
|
51
|
+
document.body.appendChild(this.target)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async getImageList(imageList,padding=26,center = null,distance = null){
|
|
55
|
+
distance = distance ? distance :this.distance;
|
|
56
|
+
center = center ? center :this.center;
|
|
57
|
+
let bounds = getLayerMapPosition(distance,transform(center))
|
|
58
|
+
let ret = []
|
|
59
|
+
if(!this.map){
|
|
60
|
+
let scene = new Scene({
|
|
61
|
+
id: this.target,
|
|
62
|
+
// map: new Mapbox({
|
|
63
|
+
// mapInstance: map,
|
|
64
|
+
// }),
|
|
65
|
+
map: new Mapbox({
|
|
66
|
+
style:this.config.style,
|
|
67
|
+
preserveDrawingBuffer:true,
|
|
68
|
+
//center:transform([114.7198975,23.0446]),
|
|
69
|
+
bounds:[bounds[0],bounds[2]],
|
|
70
|
+
fitBoundsOptions:{ padding:padding},
|
|
71
|
+
container:this.target,
|
|
72
|
+
opacity:0.7,
|
|
73
|
+
pitch: 0,
|
|
74
|
+
zoom: 0,
|
|
75
|
+
rotation: 0,
|
|
76
|
+
token: ''//'pk.eyJ1Ijoid2hpdGVidWxkaW5nIiwiYSI6ImNsc3UwaXlnZDIwbDkybG1qbXJ6YnRtcmwifQ.jtQeo0gt3UNTCWw5FEyv_w',
|
|
77
|
+
})
|
|
78
|
+
})
|
|
79
|
+
this.map = scene.map;
|
|
80
|
+
return new Promise((resolve, reject) => {
|
|
81
|
+
scene.map.on('load',async ()=>{
|
|
82
|
+
if(!imageList || imageList.length == 0){
|
|
83
|
+
let base64 = scene.map._canvas.toDataURL();
|
|
84
|
+
if(this.config.type == 'download'){
|
|
85
|
+
downloadFileByBase64(base64,guid())
|
|
86
|
+
}//downloadFileByBase64(base64,guid())
|
|
87
|
+
else if(this.config.type == 'blob'){
|
|
88
|
+
if(this.config.callback) this.config.callback(downloadFileBlobByBase64(base64))
|
|
89
|
+
ret.push(downloadFileBlobByBase64(base64))
|
|
90
|
+
}
|
|
91
|
+
}else{
|
|
92
|
+
let scanLayer = this.map.getLayer('threescan-layer');
|
|
93
|
+
if(!scanLayer){
|
|
94
|
+
scanLayer= new EmComponents.ThreeScanLayer('threescan-layer',{
|
|
95
|
+
opacity:this.config.opacity,
|
|
96
|
+
textClass:' map-time zmax ',
|
|
97
|
+
})
|
|
98
|
+
this.map.addLayer(scanLayer);
|
|
99
|
+
}
|
|
100
|
+
for(let i in imageList){
|
|
101
|
+
let a = imageList[i]
|
|
102
|
+
let base64 = await scanLayer.drawImageList(a,this.config.delay)
|
|
103
|
+
this.progress(i/(imageList.length-1),a)
|
|
104
|
+
if(a[0].addTime){
|
|
105
|
+
let nBase64 = await this.drawText(a[0],base64)
|
|
106
|
+
if(this.config.callback) this.config.callback(downloadFileBlobByBase64(nBase64))
|
|
107
|
+
ret.push(downloadFileBlobByBase64(nBase64))
|
|
108
|
+
}else{
|
|
109
|
+
if(this.config.callback) this.config.callback(downloadFileBlobByBase64(base64))
|
|
110
|
+
ret.push(downloadFileBlobByBase64(base64))
|
|
111
|
+
}
|
|
112
|
+
// map.getCanvas().toDataURL()
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
resolve(ret)
|
|
116
|
+
//target.remove()
|
|
117
|
+
})
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
}else
|
|
121
|
+
{
|
|
122
|
+
this.map.fitBounds([bounds[0],bounds[2]],{duration:200})
|
|
123
|
+
await sleep(600)
|
|
124
|
+
if(!imageList || imageList.length == 0){
|
|
125
|
+
let base64 = this.map._canvas.toDataURL();
|
|
126
|
+
if(config.type == 'download'){
|
|
127
|
+
downloadFileByBase64(base64,guid())
|
|
128
|
+
ret.push(base64)
|
|
129
|
+
}//downloadFileByBase64(base64,guid())
|
|
130
|
+
else if(this.config.type == 'blob'){
|
|
131
|
+
if(this.config.callback) this.config.callback(downloadFileBlobByBase64(base64))
|
|
132
|
+
ret.push(downloadFileBlobByBase64(base64))
|
|
133
|
+
}
|
|
134
|
+
}else{
|
|
135
|
+
let scanLayer = this.map.getLayer('threescan-layer');
|
|
136
|
+
if(!scanLayer){
|
|
137
|
+
scanLayer= new EmComponents.ThreeScanLayer('threescan-layer',{
|
|
138
|
+
opacity:this.config.opacity,
|
|
139
|
+
textClass:' map-time zmax ',
|
|
140
|
+
})
|
|
141
|
+
this.map.addLayer(scanLayer);
|
|
142
|
+
}
|
|
143
|
+
for(let i in imageList){
|
|
144
|
+
let a = imageList[i]
|
|
145
|
+
let base64 = await scanLayer.drawImageList(a,this.config.delay)
|
|
146
|
+
this.progress(i/(imageList.length-1),a)
|
|
147
|
+
// map.getCanvas().toDataURL()
|
|
148
|
+
if(a[0].addTime){
|
|
149
|
+
let nBase64 = await this.drawText(a[0],base64)
|
|
150
|
+
if(this.config.callback) this.config.callback(downloadFileBlobByBase64(nBase64))
|
|
151
|
+
ret.push(downloadFileBlobByBase64(nBase64))
|
|
152
|
+
}else{
|
|
153
|
+
if(this.config.callback) this.config.callback(downloadFileBlobByBase64(base64))
|
|
154
|
+
ret.push(downloadFileBlobByBase64(base64))
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return ret;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
drawText(point,base64){
|
|
164
|
+
return new Promise((resolve)=>{
|
|
165
|
+
this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)
|
|
166
|
+
let imgItemEl = new Image();
|
|
167
|
+
imgItemEl.crossOrigin ="anonymous"
|
|
168
|
+
imgItemEl.src = base64
|
|
169
|
+
imgItemEl.onload = (b)=>{
|
|
170
|
+
this.ctx.drawImage(b.currentTarget,0,0,this.canvas.width,this.canvas.height)
|
|
171
|
+
this.ctx.font = point.addTime.font ? point.addTime.font : '32px SimHei'
|
|
172
|
+
this.ctx.fillText(point.addTime.text,point.addTime.left,point.addTime.top)
|
|
173
|
+
resolve(this.canvas.toDataURL())
|
|
174
|
+
}
|
|
175
|
+
})
|
|
176
|
+
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export default mapOutScreen
|