web-component-gallery 1.2.21 → 1.2.23

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/amap.umd.js CHANGED
@@ -8,14 +8,14 @@
8
8
  */
9
9
  (function webpackUniversalModuleDefinition(root, factory) {
10
10
  if(typeof exports === 'object' && typeof module === 'object')
11
- module.exports = factory();
11
+ module.exports = factory(require("@amap/amap-jsapi-loader"));
12
12
  else if(typeof define === 'function' && define.amd)
13
- define([], factory);
13
+ define(["@amap/amap-jsapi-loader"], factory);
14
14
  else if(typeof exports === 'object')
15
- exports["mui"] = factory();
15
+ exports["mui"] = factory(require("@amap/amap-jsapi-loader"));
16
16
  else
17
- root["mui"] = factory();
18
- })(self, () => {
17
+ root["mui"] = factory(root["@amap/amap-jsapi-loader"]);
18
+ })(self, (__WEBPACK_EXTERNAL_MODULE__amap_amap_jsapi_loader__) => {
19
19
  return /******/ (() => { // webpackBootstrap
20
20
  /******/ var __webpack_modules__ = ({
21
21
 
@@ -9022,7 +9022,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
9022
9022
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9023
9023
 
9024
9024
  "use strict";
9025
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ getAMapInstance: () => (/* binding */ getAMapInstance),\n/* harmony export */ setAMapSecurity: () => (/* binding */ setAMapSecurity)\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/core-js/modules/es.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.iterator.for-each.js */ \"./node_modules/core-js/modules/es.iterator.for-each.js\");\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/core-js/modules/es.iterator.map.js\");\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n\n// amap-plugin.js\n// import AMapLoader from '@amap/amap-jsapi-loader'\n\n/** 入口文件不同 作用域不同 */\nlet AMapKey = null;\nlet AMapStyle = null;\nlet AMapInstance = null;\n/** 默认地图key、样式及安全解码 */\nlet AMapConfig = {\n key: '722d07dd44d442d72a25a1304bac7743',\n style: 'amap://styles/ff26c7ed32880397f692f5b69b1c1f9f',\n securityJsCode: '90366326a87f1d0e3ddb43e05cc021b1'\n};\n\n// 安全配置 / 地图样式配置\nconst setAMapSecurity = (config = AMapConfig) => {\n const {\n key,\n style,\n securityJsCode\n } = config;\n AMapKey = key;\n AMapStyle = style;\n /** 设置高德地图密钥 */\n window.forceWebGL = true;\n window._AMapSecurityConfig = {\n securityJsCode\n };\n};\n\n// 核心地图服务类\nclass AMapService {\n constructor(AMap) {\n this.AMap = AMap;\n this._iconCache = new Map(); // 图标缓存\n\n /** 常用覆盖物 */\n this.layers = {\n setIcon: this.setIcon.bind(this),\n setMarker: this.setMarker.bind(this),\n setInfoWindow: this._createInfoWindowHandler()\n };\n\n /** 抛出地图常用方法 */\n this.methods = {\n getMapAddress: this.getMapAddress.bind(this),\n getMapSearch: this.getMapSearch.bind(this),\n setMapDriving: this.setMapDriving.bind(this),\n drawMapAnimation,\n parseRouteToPath,\n getOverlayPos\n };\n }\n\n /** 初始化地图 */\n initMap(container, options = {}) {\n const map = new this.AMap.Map(container, {\n zoom: 13,\n zooms: [3, 20],\n pitch: 30,\n rotation: -15,\n viewMode: '3D',\n center: [118.868228, 28.892844],\n mapStyle: AMapStyle,\n ...options\n });\n options.zoomTool && map.addControl(new this.AMap.ToolBar());\n options.directionTool && map.addControl(new this.AMap.ControlBar());\n return map;\n }\n\n /** 格式化地图经纬度 */\n setLngLat(position) {\n return new this.AMap.LngLat(position[0], position[1]);\n }\n\n /** 创建信息窗口处理器(柯里化函数) */\n _createInfoWindowHandler() {\n return Vue => {\n if (!Vue || !Vue.extend) {\n throw new Error('必须传入有效的Vue构造函数');\n }\n return ({\n component,\n props,\n options = {}\n }) => {\n if (!component) throw new Error('component参数必填');\n const InfoWindowComponent = Vue.extend(component);\n const instance = new InfoWindowComponent({\n propsData: props\n }).$mount(document.createElement('div'));\n return new this.AMap.InfoWindow({\n isCustom: true,\n content: instance.$el,\n ...options\n });\n };\n };\n }\n\n /** 带缓存的图标创建方法 */\n async setIcon(iconUrl) {\n if (this._iconCache.has(iconUrl)) {\n return this._iconCache.get(iconUrl);\n }\n return new Promise((resolve, reject) => {\n const icon = new this.AMap.Icon({\n image: iconUrl,\n imageOffset: new this.AMap.Pixel(0, 0)\n });\n const img = new Image();\n img.onload = () => {\n const size = new this.AMap.Size(img.width, img.height);\n icon.setSize(size);\n icon.setImageSize(size);\n this._iconCache.set(iconUrl, icon);\n resolve(icon);\n };\n img.onerror = () => reject(new Error(`图标加载失败: ${iconUrl}`));\n img.src = iconUrl;\n });\n }\n\n /** 增强的标记点创建方法 */\n async setMarker(iconUrl, options = {}) {\n try {\n const icon = await this.setIcon(iconUrl);\n const marker = new this.AMap.Marker({\n anchor: 'bottom-center',\n ...options,\n icon\n });\n return marker;\n } catch (error) {\n console.error('创建标记点失败:', error);\n throw error;\n }\n }\n\n /** 地图逆地理编码 */\n getMapAddress({\n longitude,\n latitude\n }, callBack) {\n return new Promise((resolve, reject) => {\n const geocoder = new this.AMap.Geocoder({\n city: '全国',\n extensions: 'all'\n });\n geocoder.getAddress([longitude, latitude], (status, result) => {\n if (status === 'complete' && result.info === 'OK') {\n const {\n formattedAddress,\n pois\n } = result.regeocode;\n const {\n district,\n township\n } = result.regeocode.addressComponent;\n const division = township && formattedAddress.includes(township) ? formattedAddress.indexOf(township) + township.length : formattedAddress.indexOf(district) + district.length;\n const addressMsg = {\n address: formattedAddress.slice(0, division) + (pois[0]?.address || ''),\n addressInfo: result.regeocode.addressComponent\n };\n callBack?.(addressMsg);\n resolve(addressMsg);\n } else {\n reject(new Error('转换失败'));\n }\n });\n });\n }\n\n /** 根据地址搜索地图poi点及其他信息 */\n /**\r\n * \r\n * @param {*} keywords 根据关键字搜索\r\n * @param {*} callBack 查询成功后过滤信息及转换格式 传递回调函数 兼容老版本代码\r\n */\n getMapSearch(keywords, callBack) {\n return new Promise(resolve => {\n const placeSearch = new this.AMap.PlaceSearch();\n placeSearch.search(keywords, (status, searchList) => {\n const options = searchList?.poiList?.pois?.map(node => ({\n ...node,\n label: `${node.name}(${node.address})`\n })) || [];\n callBack?.(options);\n resolve(options);\n });\n });\n }\n\n /** 道路规划 */\n /**\r\n * \r\n * @param {*} AMapInit 当前地图实例\r\n * @param {*} paths 需查询的路径起始点及途径点集合\r\n * @param {*} roadOptions 路线规划的其他参数\r\n * { paths: 需查询的路径起始点及途径点集合, options: 为查询路线配置项 }\r\n * @param {*} callBack 查询成功后回调函数 兼容老版本代码\r\n */\n async setMapDriving(mapInstance, roadOptions, callBack) {\n const {\n paths,\n options = {}\n } = roadOptions;\n return new Promise(resolve => {\n mapInstance.plugin(\"AMap.Driving\", () => {\n const driving = new this.AMap.Driving({\n map: mapInstance,\n ...options\n });\n driving.search(this.setLngLat(paths[0]), this.setLngLat(paths[paths.length - 1]), {\n waypoints: paths.slice(1, -1).map(path => this.setLngLat(path))\n }, (status, {\n routes\n }) => status === 'complete' && (callBack?.(roadDriving, routes), resolve({\n driving,\n routes\n })));\n });\n });\n }\n\n // 其他方法保持类似改造...\n}\n\n// 获取AMap实例(组件内使用)\nconst getAMapInstance = async (options = {}) => {\n if (AMapInstance) return AMapInstance;\n\n // 确保key存在\n if (!AMapKey) {\n try {\n setAMapSecurity();\n } catch (e) {\n throw new Error('请先设置地图Key!');\n }\n }\n const AMapLoader = (await __webpack_require__.e(/*! import() */ \"node_modules_amap_amap-jsapi-loader_dist_index_js\").then(__webpack_require__.t.bind(__webpack_require__, /*! @amap/amap-jsapi-loader */ \"./node_modules/@amap/amap-jsapi-loader/dist/index.js\", 23))).default;\n try {\n const AMap = await AMapLoader.load({\n key: AMapKey,\n version: '2.0',\n plugins: ['AMap.Geocoder', 'AMap.PlaceSearch',\n // 搜索\n 'AMap.MouseTool',\n // 鼠标\n 'AMap.ControlBar',\n // 方向盘\n 'AMap.ToolBar',\n // 缩放\n ...(options.plugins || [])]\n });\n AMapInstance = new AMapService(AMap);\n return AMapInstance;\n } catch (e) {\n throw new Error(`高德地图加载失败: ${e.message}`);\n }\n};\n\n// 在 Vue 插件中封装高德地图的初始化和常用方法 \n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n async install(Vue, options = {}) {\n const amap = await getAMapInstance(options);\n const {\n AMap,\n methods,\n layers\n } = amap;\n Vue.prototype.$amap = AMap;\n\n /** 初始化地图 */\n Vue.prototype.$initAMap = (mapOptions, callBack) => {\n const amapInit = amap.initMap(mapOptions.el, mapOptions.options || {});\n /** 兼容之前版本代码 */\n callBack?.(amapInit);\n return amapInit;\n };\n\n /** 地图加载完成 */\n Vue.prototype.$amapBus.$emit('onAMapMounted');\n\n /** 常用覆盖物 */\n Vue.prototype.$amapLayers = {\n ...layers,\n setInfoWindow: layers.setInfoWindow(Vue)\n };\n\n /** 抛出地图常用方法 */\n Vue.prototype.$amapMethods = methods || {};\n }\n});\n\n/** \r\n * 安全获取覆盖物坐标信息 \r\n * @param {AMap.Overlay} overlay 地图覆盖物实例\r\n * @returns {Array<Array<number>>} 坐标点数组\r\n */\nfunction getOverlayPos(overlay) {\n if (!overlay) throw new Error('覆盖物实例不存在');\n try {\n return overlay.type === 'AMap.Marker' ? [overlay.getPosition().lng, overlay.getPosition().lat] : overlay.getPath().map(({\n lng,\n lat\n }) => [lng, lat]);\n } catch (e) {\n console.error('转换失败', e);\n return [];\n }\n}\n\n/**\r\n * 轨迹动画执行器\r\n * @param {AMap.Map} AMapInit 地图实例\r\n * @param {AMap.Marker} animationMarker 动画标记物\r\n * @param {Array<Array<number>>} paths 路径坐标数组\r\n * @param {Object} [options] 动画配置\r\n * @param {Function} [callBack] 动画完成回调\r\n */\nfunction drawMapAnimation(AMapInit, animationMarker, paths, options = {}, callBack) {\n if (!AMapInit || !animationMarker || !paths?.length) {\n return console.error('缺少参数信息');\n }\n AMapInit.plugin('AMap.MoveAnimation', () => {\n const defaultOptions = {\n duration: 500,\n autoRotation: true,\n ...options\n };\n animationMarker.moveAlong(paths, defaultOptions);\n callBack?.(animationMarker);\n });\n}\n\n/**\r\n * 转换导航路线为可绘制路径\r\n * @param {AMap.DrivingRoute} route 导航路线对象\r\n * @returns {{\r\n* path: Array<Array<number>>,\r\n* approachPoints: Array<number>\r\n* }}\r\n*/\nfunction parseRouteToPath(route) {\n if (!route?.steps) return {\n path: [],\n approachPoints: []\n };\n const result = {\n path: [],\n approachPoints: []\n };\n route.steps.forEach((step, stepIndex) => {\n step.path.forEach((point, pointIndex) => {\n result.path.push([point.lng, point.lat]);\n if (step.assistant_action === \"到达途经地\" && pointIndex === step.path.length - 1) {\n result.approachPoints.push(result.path.length - 1);\n }\n });\n });\n return result;\n}\n\n//# sourceURL=webpack://mui/./plugins/method/AMap.js?");
9025
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ getAMapInstance: () => (/* binding */ getAMapInstance),\n/* harmony export */ setAMapSecurity: () => (/* binding */ setAMapSecurity)\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/core-js/modules/es.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.iterator.for-each.js */ \"./node_modules/core-js/modules/es.iterator.for-each.js\");\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/core-js/modules/es.iterator.map.js\");\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n\n// amap-plugin.js\n// import AMapLoader from '@amap/amap-jsapi-loader'\n\n/** 入口文件不同 作用域不同 */\nlet AMapKey = null;\nlet AMapStyle = null;\nlet AMapInstance = null;\n/** 默认地图key、样式及安全解码 */\nlet AMapConfig = {\n key: '722d07dd44d442d72a25a1304bac7743',\n style: 'amap://styles/ff26c7ed32880397f692f5b69b1c1f9f',\n securityJsCode: '90366326a87f1d0e3ddb43e05cc021b1'\n};\n\n// 安全配置 / 地图样式配置\nconst setAMapSecurity = (config = AMapConfig) => {\n const {\n key,\n style,\n securityJsCode\n } = config;\n AMapKey = key;\n AMapStyle = style;\n /** 设置高德地图密钥 */\n window.forceWebGL = true;\n window._AMapSecurityConfig = {\n securityJsCode\n };\n};\n\n// 核心地图服务类\nclass AMapService {\n constructor(AMap) {\n this.AMap = AMap;\n this._iconCache = new Map(); // 图标缓存\n\n /** 常用覆盖物 */\n this.layers = {\n setIcon: this.setIcon.bind(this),\n setMarker: this.setMarker.bind(this),\n setInfoWindow: this._createInfoWindowHandler()\n };\n\n /** 抛出地图常用方法 */\n this.methods = {\n getMapAddress: this.getMapAddress.bind(this),\n getMapSearch: this.getMapSearch.bind(this),\n setMapDriving: this.setMapDriving.bind(this),\n drawMapAnimation,\n parseRouteToPath,\n getOverlayPos\n };\n }\n\n /** 初始化地图 */\n initMap(container, options = {}) {\n const map = new this.AMap.Map(container, {\n zoom: 13,\n zooms: [3, 20],\n pitch: 30,\n rotation: -15,\n viewMode: '3D',\n center: [118.868228, 28.892844],\n mapStyle: AMapStyle,\n ...options\n });\n options.zoomTool && map.addControl(new this.AMap.ToolBar());\n options.directionTool && map.addControl(new this.AMap.ControlBar());\n return map;\n }\n\n /** 格式化地图经纬度 */\n setLngLat(position) {\n return new this.AMap.LngLat(position[0], position[1]);\n }\n\n /** 创建信息窗口处理器(柯里化函数) */\n _createInfoWindowHandler() {\n return Vue => {\n if (!Vue || !Vue.extend) {\n throw new Error('必须传入有效的Vue构造函数');\n }\n return ({\n component,\n props,\n options = {}\n }) => {\n if (!component) throw new Error('component参数必填');\n const InfoWindowComponent = Vue.extend(component);\n const instance = new InfoWindowComponent({\n propsData: props\n }).$mount(document.createElement('div'));\n return new this.AMap.InfoWindow({\n isCustom: true,\n content: instance.$el,\n ...options\n });\n };\n };\n }\n\n /** 带缓存的图标创建方法 */\n async setIcon(iconUrl) {\n if (this._iconCache.has(iconUrl)) {\n return this._iconCache.get(iconUrl);\n }\n return new Promise((resolve, reject) => {\n const icon = new this.AMap.Icon({\n image: iconUrl,\n imageOffset: new this.AMap.Pixel(0, 0)\n });\n const img = new Image();\n img.onload = () => {\n const size = new this.AMap.Size(img.width, img.height);\n icon.setSize(size);\n icon.setImageSize(size);\n this._iconCache.set(iconUrl, icon);\n resolve(icon);\n };\n img.onerror = () => reject(new Error(`图标加载失败: ${iconUrl}`));\n img.src = iconUrl;\n });\n }\n\n /** 增强的标记点创建方法 */\n async setMarker(iconUrl, options = {}) {\n try {\n const icon = await this.setIcon(iconUrl);\n const marker = new this.AMap.Marker({\n anchor: 'bottom-center',\n ...options,\n icon\n });\n return marker;\n } catch (error) {\n console.error('创建标记点失败:', error);\n throw error;\n }\n }\n\n /** 地图逆地理编码 */\n getMapAddress({\n longitude,\n latitude\n }, callBack) {\n return new Promise((resolve, reject) => {\n const geocoder = new this.AMap.Geocoder({\n city: '全国',\n extensions: 'all'\n });\n geocoder.getAddress([longitude, latitude], (status, result) => {\n if (status === 'complete' && result.info === 'OK') {\n const {\n formattedAddress,\n pois\n } = result.regeocode;\n const {\n district,\n township\n } = result.regeocode.addressComponent;\n const division = township && formattedAddress.includes(township) ? formattedAddress.indexOf(township) + township.length : formattedAddress.indexOf(district) + district.length;\n const addressMsg = {\n address: formattedAddress.slice(0, division) + (pois[0]?.address || ''),\n addressInfo: result.regeocode.addressComponent\n };\n callBack?.(addressMsg);\n resolve(addressMsg);\n } else {\n reject(new Error('转换失败'));\n }\n });\n });\n }\n\n /** 根据地址搜索地图poi点及其他信息 */\n /**\r\n * \r\n * @param {*} keywords 根据关键字搜索\r\n * @param {*} callBack 查询成功后过滤信息及转换格式 传递回调函数 兼容老版本代码\r\n */\n getMapSearch(keywords, callBack) {\n return new Promise(resolve => {\n const placeSearch = new this.AMap.PlaceSearch();\n placeSearch.search(keywords, (status, searchList) => {\n const options = searchList?.poiList?.pois?.map(node => ({\n ...node,\n label: `${node.name}(${node.address})`\n })) || [];\n callBack?.(options);\n resolve(options);\n });\n });\n }\n\n /** 道路规划 */\n /**\r\n * \r\n * @param {*} AMapInit 当前地图实例\r\n * @param {*} paths 需查询的路径起始点及途径点集合\r\n * @param {*} roadOptions 路线规划的其他参数\r\n * { paths: 需查询的路径起始点及途径点集合, options: 为查询路线配置项 }\r\n * @param {*} callBack 查询成功后回调函数 兼容老版本代码\r\n */\n async setMapDriving(mapInstance, roadOptions, callBack) {\n const {\n paths,\n options = {}\n } = roadOptions;\n return new Promise(resolve => {\n mapInstance.plugin(\"AMap.Driving\", () => {\n const driving = new this.AMap.Driving({\n map: mapInstance,\n ...options\n });\n driving.search(this.setLngLat(paths[0]), this.setLngLat(paths[paths.length - 1]), {\n waypoints: paths.slice(1, -1).map(path => this.setLngLat(path))\n }, (status, {\n routes\n }) => status === 'complete' && (callBack?.(roadDriving, routes), resolve({\n driving,\n routes\n })));\n });\n });\n }\n\n // 其他方法保持类似改造...\n}\n\n// 获取AMap实例(组件内使用)\nconst getAMapInstance = async (options = {}) => {\n if (AMapInstance) return AMapInstance;\n\n // 确保key存在\n if (!AMapKey) {\n try {\n setAMapSecurity();\n } catch (e) {\n throw new Error('请先设置地图Key!');\n }\n }\n const AMapLoader = (await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @amap/amap-jsapi-loader */ \"@amap/amap-jsapi-loader\", 23))).default;\n try {\n const AMap = await AMapLoader.load({\n key: AMapKey,\n version: '2.0',\n plugins: ['AMap.Geocoder', 'AMap.PlaceSearch',\n // 搜索\n 'AMap.MouseTool',\n // 鼠标\n 'AMap.ControlBar',\n // 方向盘\n 'AMap.ToolBar',\n // 缩放\n ...(options.plugins || [])]\n });\n AMapInstance = new AMapService(AMap);\n return AMapInstance;\n } catch (e) {\n throw new Error(`高德地图加载失败: ${e.message}`);\n }\n};\n\n// 在 Vue 插件中封装高德地图的初始化和常用方法 \n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n async install(Vue, options = {}) {\n const amap = await getAMapInstance(options);\n const {\n AMap,\n methods,\n layers\n } = amap;\n Vue.prototype.$amap = AMap;\n\n /** 初始化地图 */\n Vue.prototype.$initAMap = (mapOptions, callBack) => {\n const amapInit = amap.initMap(mapOptions.el, mapOptions.options || {});\n /** 兼容之前版本代码 */\n callBack?.(amapInit);\n return amapInit;\n };\n\n /** 地图加载完成 */\n Vue.prototype.$amapBus.$emit('onAMapMounted');\n\n /** 常用覆盖物 */\n Vue.prototype.$amapLayers = {\n ...layers,\n setInfoWindow: layers.setInfoWindow(Vue)\n };\n\n /** 抛出地图常用方法 */\n Vue.prototype.$amapMethods = methods || {};\n }\n});\n\n/** \r\n * 安全获取覆盖物坐标信息 \r\n * @param {AMap.Overlay} overlay 地图覆盖物实例\r\n * @returns {Array<Array<number>>} 坐标点数组\r\n */\nfunction getOverlayPos(overlay) {\n if (!overlay) throw new Error('覆盖物实例不存在');\n try {\n return overlay.type === 'AMap.Marker' ? [overlay.getPosition().lng, overlay.getPosition().lat] : overlay.getPath().map(({\n lng,\n lat\n }) => [lng, lat]);\n } catch (e) {\n console.error('转换失败', e);\n return [];\n }\n}\n\n/**\r\n * 轨迹动画执行器\r\n * @param {AMap.Map} AMapInit 地图实例\r\n * @param {AMap.Marker} animationMarker 动画标记物\r\n * @param {Array<Array<number>>} paths 路径坐标数组\r\n * @param {Object} [options] 动画配置\r\n * @param {Function} [callBack] 动画完成回调\r\n */\nfunction drawMapAnimation(AMapInit, animationMarker, paths, options = {}, callBack) {\n if (!AMapInit || !animationMarker || !paths?.length) {\n return console.error('缺少参数信息');\n }\n AMapInit.plugin('AMap.MoveAnimation', () => {\n const defaultOptions = {\n duration: 500,\n autoRotation: true,\n ...options\n };\n animationMarker.moveAlong(paths, defaultOptions);\n callBack?.(animationMarker);\n });\n}\n\n/**\r\n * 转换导航路线为可绘制路径\r\n * @param {AMap.DrivingRoute} route 导航路线对象\r\n * @returns {{\r\n* path: Array<Array<number>>,\r\n* approachPoints: Array<number>\r\n* }}\r\n*/\nfunction parseRouteToPath(route) {\n if (!route?.steps) return {\n path: [],\n approachPoints: []\n };\n const result = {\n path: [],\n approachPoints: []\n };\n route.steps.forEach((step, stepIndex) => {\n step.path.forEach((point, pointIndex) => {\n result.path.push([point.lng, point.lat]);\n if (step.assistant_action === \"到达途经地\" && pointIndex === step.path.length - 1) {\n result.approachPoints.push(result.path.length - 1);\n }\n });\n });\n return result;\n}\n\n//# sourceURL=webpack://mui/./plugins/method/AMap.js?");
9026
9026
 
9027
9027
  /***/ }),
9028
9028
 
@@ -10256,6 +10256,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
10256
10256
 
10257
10257
  /***/ }),
10258
10258
 
10259
+ /***/ "@amap/amap-jsapi-loader":
10260
+ /*!******************************************!*\
10261
+ !*** external "@amap/amap-jsapi-loader" ***!
10262
+ \******************************************/
10263
+ /***/ ((module) => {
10264
+
10265
+ "use strict";
10266
+ module.exports = __WEBPACK_EXTERNAL_MODULE__amap_amap_jsapi_loader__;
10267
+
10268
+ /***/ }),
10269
+
10259
10270
  /***/ "./node_modules/classnames/index.js":
10260
10271
  /*!******************************************!*\
10261
10272
  !*** ./node_modules/classnames/index.js ***!
@@ -12131,9 +12142,6 @@ eval("__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modul
12131
12142
  /******/ return module.exports;
12132
12143
  /******/ }
12133
12144
  /******/
12134
- /******/ // expose the modules object (__webpack_modules__)
12135
- /******/ __webpack_require__.m = __webpack_modules__;
12136
- /******/
12137
12145
  /************************************************************************/
12138
12146
  /******/ /* webpack/runtime/compat get default export */
12139
12147
  /******/ (() => {
@@ -12189,28 +12197,6 @@ eval("__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modul
12189
12197
  /******/ };
12190
12198
  /******/ })();
12191
12199
  /******/
12192
- /******/ /* webpack/runtime/ensure chunk */
12193
- /******/ (() => {
12194
- /******/ __webpack_require__.f = {};
12195
- /******/ // This file contains only the entry chunk.
12196
- /******/ // The chunk loading function for additional chunks
12197
- /******/ __webpack_require__.e = (chunkId) => {
12198
- /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
12199
- /******/ __webpack_require__.f[key](chunkId, promises);
12200
- /******/ return promises;
12201
- /******/ }, []));
12202
- /******/ };
12203
- /******/ })();
12204
- /******/
12205
- /******/ /* webpack/runtime/get javascript chunk filename */
12206
- /******/ (() => {
12207
- /******/ // This function allow to reference async chunks
12208
- /******/ __webpack_require__.u = (chunkId) => {
12209
- /******/ // return url for filenames based on template
12210
- /******/ return "" + chunkId + ".umd.js";
12211
- /******/ };
12212
- /******/ })();
12213
- /******/
12214
12200
  /******/ /* webpack/runtime/global */
12215
12201
  /******/ (() => {
12216
12202
  /******/ __webpack_require__.g = (function() {
@@ -12228,52 +12214,6 @@ eval("__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modul
12228
12214
  /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
12229
12215
  /******/ })();
12230
12216
  /******/
12231
- /******/ /* webpack/runtime/load script */
12232
- /******/ (() => {
12233
- /******/ var inProgress = {};
12234
- /******/ var dataWebpackPrefix = "mui:";
12235
- /******/ // loadScript function to load a script via script tag
12236
- /******/ __webpack_require__.l = (url, done, key, chunkId) => {
12237
- /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
12238
- /******/ var script, needAttach;
12239
- /******/ if(key !== undefined) {
12240
- /******/ var scripts = document.getElementsByTagName("script");
12241
- /******/ for(var i = 0; i < scripts.length; i++) {
12242
- /******/ var s = scripts[i];
12243
- /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
12244
- /******/ }
12245
- /******/ }
12246
- /******/ if(!script) {
12247
- /******/ needAttach = true;
12248
- /******/ script = document.createElement('script');
12249
- /******/
12250
- /******/ script.charset = 'utf-8';
12251
- /******/ script.timeout = 120;
12252
- /******/ if (__webpack_require__.nc) {
12253
- /******/ script.setAttribute("nonce", __webpack_require__.nc);
12254
- /******/ }
12255
- /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
12256
- /******/
12257
- /******/ script.src = url;
12258
- /******/ }
12259
- /******/ inProgress[url] = [done];
12260
- /******/ var onScriptComplete = (prev, event) => {
12261
- /******/ // avoid mem leaks in IE.
12262
- /******/ script.onerror = script.onload = null;
12263
- /******/ clearTimeout(timeout);
12264
- /******/ var doneFns = inProgress[url];
12265
- /******/ delete inProgress[url];
12266
- /******/ script.parentNode && script.parentNode.removeChild(script);
12267
- /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
12268
- /******/ if(prev) return prev(event);
12269
- /******/ }
12270
- /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
12271
- /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
12272
- /******/ script.onload = onScriptComplete.bind(null, script.onload);
12273
- /******/ needAttach && document.head.appendChild(script);
12274
- /******/ };
12275
- /******/ })();
12276
- /******/
12277
12217
  /******/ /* webpack/runtime/make namespace object */
12278
12218
  /******/ (() => {
12279
12219
  /******/ // define __esModule on exports
@@ -12294,119 +12234,6 @@ eval("__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modul
12294
12234
  /******/ };
12295
12235
  /******/ })();
12296
12236
  /******/
12297
- /******/ /* webpack/runtime/publicPath */
12298
- /******/ (() => {
12299
- /******/ var scriptUrl;
12300
- /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
12301
- /******/ var document = __webpack_require__.g.document;
12302
- /******/ if (!scriptUrl && document) {
12303
- /******/ if (document.currentScript)
12304
- /******/ scriptUrl = document.currentScript.src;
12305
- /******/ if (!scriptUrl) {
12306
- /******/ var scripts = document.getElementsByTagName("script");
12307
- /******/ if(scripts.length) {
12308
- /******/ var i = scripts.length - 1;
12309
- /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
12310
- /******/ }
12311
- /******/ }
12312
- /******/ }
12313
- /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
12314
- /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
12315
- /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
12316
- /******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
12317
- /******/ __webpack_require__.p = scriptUrl;
12318
- /******/ })();
12319
- /******/
12320
- /******/ /* webpack/runtime/jsonp chunk loading */
12321
- /******/ (() => {
12322
- /******/ // no baseURI
12323
- /******/
12324
- /******/ // object to store loaded and loading chunks
12325
- /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
12326
- /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
12327
- /******/ var installedChunks = {
12328
- /******/ "amap": 0
12329
- /******/ };
12330
- /******/
12331
- /******/ __webpack_require__.f.j = (chunkId, promises) => {
12332
- /******/ // JSONP chunk loading for javascript
12333
- /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
12334
- /******/ if(installedChunkData !== 0) { // 0 means "already installed".
12335
- /******/
12336
- /******/ // a Promise means "currently loading".
12337
- /******/ if(installedChunkData) {
12338
- /******/ promises.push(installedChunkData[2]);
12339
- /******/ } else {
12340
- /******/ if(true) { // all chunks have JS
12341
- /******/ // setup Promise in chunk cache
12342
- /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
12343
- /******/ promises.push(installedChunkData[2] = promise);
12344
- /******/
12345
- /******/ // start chunk loading
12346
- /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
12347
- /******/ // create error before stack unwound to get useful stacktrace later
12348
- /******/ var error = new Error();
12349
- /******/ var loadingEnded = (event) => {
12350
- /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
12351
- /******/ installedChunkData = installedChunks[chunkId];
12352
- /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
12353
- /******/ if(installedChunkData) {
12354
- /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
12355
- /******/ var realSrc = event && event.target && event.target.src;
12356
- /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
12357
- /******/ error.name = 'ChunkLoadError';
12358
- /******/ error.type = errorType;
12359
- /******/ error.request = realSrc;
12360
- /******/ installedChunkData[1](error);
12361
- /******/ }
12362
- /******/ }
12363
- /******/ };
12364
- /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
12365
- /******/ }
12366
- /******/ }
12367
- /******/ }
12368
- /******/ };
12369
- /******/
12370
- /******/ // no prefetching
12371
- /******/
12372
- /******/ // no preloaded
12373
- /******/
12374
- /******/ // no HMR
12375
- /******/
12376
- /******/ // no HMR manifest
12377
- /******/
12378
- /******/ // no on chunks loaded
12379
- /******/
12380
- /******/ // install a JSONP callback for chunk loading
12381
- /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
12382
- /******/ var [chunkIds, moreModules, runtime] = data;
12383
- /******/ // add "moreModules" to the modules object,
12384
- /******/ // then flag all "chunkIds" as loaded and fire callback
12385
- /******/ var moduleId, chunkId, i = 0;
12386
- /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
12387
- /******/ for(moduleId in moreModules) {
12388
- /******/ if(__webpack_require__.o(moreModules, moduleId)) {
12389
- /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
12390
- /******/ }
12391
- /******/ }
12392
- /******/ if(runtime) var result = runtime(__webpack_require__);
12393
- /******/ }
12394
- /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
12395
- /******/ for(;i < chunkIds.length; i++) {
12396
- /******/ chunkId = chunkIds[i];
12397
- /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
12398
- /******/ installedChunks[chunkId][0]();
12399
- /******/ }
12400
- /******/ installedChunks[chunkId] = 0;
12401
- /******/ }
12402
- /******/
12403
- /******/ }
12404
- /******/
12405
- /******/ var chunkLoadingGlobal = self["webpackChunkmui"] = self["webpackChunkmui"] || [];
12406
- /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
12407
- /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
12408
- /******/ })();
12409
- /******/
12410
12237
  /******/ /* webpack/runtime/nonce */
12411
12238
  /******/ (() => {
12412
12239
  /******/ __webpack_require__.nc = undefined;
package/dist/index.umd.js CHANGED
@@ -8,14 +8,14 @@
8
8
  */
9
9
  (function webpackUniversalModuleDefinition(root, factory) {
10
10
  if(typeof exports === 'object' && typeof module === 'object')
11
- module.exports = factory();
11
+ module.exports = factory(require("@amap/amap-jsapi-loader"));
12
12
  else if(typeof define === 'function' && define.amd)
13
- define([], factory);
13
+ define(["@amap/amap-jsapi-loader"], factory);
14
14
  else if(typeof exports === 'object')
15
- exports["mui"] = factory();
15
+ exports["mui"] = factory(require("@amap/amap-jsapi-loader"));
16
16
  else
17
- root["mui"] = factory();
18
- })(self, () => {
17
+ root["mui"] = factory(root["@amap/amap-jsapi-loader"]);
18
+ })(self, (__WEBPACK_EXTERNAL_MODULE__amap_amap_jsapi_loader__) => {
19
19
  return /******/ (() => { // webpackBootstrap
20
20
  /******/ var __webpack_modules__ = ({
21
21
 
@@ -9022,7 +9022,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
9022
9022
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9023
9023
 
9024
9024
  "use strict";
9025
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ getAMapInstance: () => (/* binding */ getAMapInstance),\n/* harmony export */ setAMapSecurity: () => (/* binding */ setAMapSecurity)\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/core-js/modules/es.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.iterator.for-each.js */ \"./node_modules/core-js/modules/es.iterator.for-each.js\");\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/core-js/modules/es.iterator.map.js\");\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n\n// amap-plugin.js\n// import AMapLoader from '@amap/amap-jsapi-loader'\n\n/** 入口文件不同 作用域不同 */\nlet AMapKey = null;\nlet AMapStyle = null;\nlet AMapInstance = null;\n/** 默认地图key、样式及安全解码 */\nlet AMapConfig = {\n key: '722d07dd44d442d72a25a1304bac7743',\n style: 'amap://styles/ff26c7ed32880397f692f5b69b1c1f9f',\n securityJsCode: '90366326a87f1d0e3ddb43e05cc021b1'\n};\n\n// 安全配置 / 地图样式配置\nconst setAMapSecurity = (config = AMapConfig) => {\n const {\n key,\n style,\n securityJsCode\n } = config;\n AMapKey = key;\n AMapStyle = style;\n /** 设置高德地图密钥 */\n window.forceWebGL = true;\n window._AMapSecurityConfig = {\n securityJsCode\n };\n};\n\n// 核心地图服务类\nclass AMapService {\n constructor(AMap) {\n this.AMap = AMap;\n this._iconCache = new Map(); // 图标缓存\n\n /** 常用覆盖物 */\n this.layers = {\n setIcon: this.setIcon.bind(this),\n setMarker: this.setMarker.bind(this),\n setInfoWindow: this._createInfoWindowHandler()\n };\n\n /** 抛出地图常用方法 */\n this.methods = {\n getMapAddress: this.getMapAddress.bind(this),\n getMapSearch: this.getMapSearch.bind(this),\n setMapDriving: this.setMapDriving.bind(this),\n drawMapAnimation,\n parseRouteToPath,\n getOverlayPos\n };\n }\n\n /** 初始化地图 */\n initMap(container, options = {}) {\n const map = new this.AMap.Map(container, {\n zoom: 13,\n zooms: [3, 20],\n pitch: 30,\n rotation: -15,\n viewMode: '3D',\n center: [118.868228, 28.892844],\n mapStyle: AMapStyle,\n ...options\n });\n options.zoomTool && map.addControl(new this.AMap.ToolBar());\n options.directionTool && map.addControl(new this.AMap.ControlBar());\n return map;\n }\n\n /** 格式化地图经纬度 */\n setLngLat(position) {\n return new this.AMap.LngLat(position[0], position[1]);\n }\n\n /** 创建信息窗口处理器(柯里化函数) */\n _createInfoWindowHandler() {\n return Vue => {\n if (!Vue || !Vue.extend) {\n throw new Error('必须传入有效的Vue构造函数');\n }\n return ({\n component,\n props,\n options = {}\n }) => {\n if (!component) throw new Error('component参数必填');\n const InfoWindowComponent = Vue.extend(component);\n const instance = new InfoWindowComponent({\n propsData: props\n }).$mount(document.createElement('div'));\n return new this.AMap.InfoWindow({\n isCustom: true,\n content: instance.$el,\n ...options\n });\n };\n };\n }\n\n /** 带缓存的图标创建方法 */\n async setIcon(iconUrl) {\n if (this._iconCache.has(iconUrl)) {\n return this._iconCache.get(iconUrl);\n }\n return new Promise((resolve, reject) => {\n const icon = new this.AMap.Icon({\n image: iconUrl,\n imageOffset: new this.AMap.Pixel(0, 0)\n });\n const img = new Image();\n img.onload = () => {\n const size = new this.AMap.Size(img.width, img.height);\n icon.setSize(size);\n icon.setImageSize(size);\n this._iconCache.set(iconUrl, icon);\n resolve(icon);\n };\n img.onerror = () => reject(new Error(`图标加载失败: ${iconUrl}`));\n img.src = iconUrl;\n });\n }\n\n /** 增强的标记点创建方法 */\n async setMarker(iconUrl, options = {}) {\n try {\n const icon = await this.setIcon(iconUrl);\n const marker = new this.AMap.Marker({\n anchor: 'bottom-center',\n ...options,\n icon\n });\n return marker;\n } catch (error) {\n console.error('创建标记点失败:', error);\n throw error;\n }\n }\n\n /** 地图逆地理编码 */\n getMapAddress({\n longitude,\n latitude\n }, callBack) {\n return new Promise((resolve, reject) => {\n const geocoder = new this.AMap.Geocoder({\n city: '全国',\n extensions: 'all'\n });\n geocoder.getAddress([longitude, latitude], (status, result) => {\n if (status === 'complete' && result.info === 'OK') {\n const {\n formattedAddress,\n pois\n } = result.regeocode;\n const {\n district,\n township\n } = result.regeocode.addressComponent;\n const division = township && formattedAddress.includes(township) ? formattedAddress.indexOf(township) + township.length : formattedAddress.indexOf(district) + district.length;\n const addressMsg = {\n address: formattedAddress.slice(0, division) + (pois[0]?.address || ''),\n addressInfo: result.regeocode.addressComponent\n };\n callBack?.(addressMsg);\n resolve(addressMsg);\n } else {\n reject(new Error('转换失败'));\n }\n });\n });\n }\n\n /** 根据地址搜索地图poi点及其他信息 */\n /**\r\n * \r\n * @param {*} keywords 根据关键字搜索\r\n * @param {*} callBack 查询成功后过滤信息及转换格式 传递回调函数 兼容老版本代码\r\n */\n getMapSearch(keywords, callBack) {\n return new Promise(resolve => {\n const placeSearch = new this.AMap.PlaceSearch();\n placeSearch.search(keywords, (status, searchList) => {\n const options = searchList?.poiList?.pois?.map(node => ({\n ...node,\n label: `${node.name}(${node.address})`\n })) || [];\n callBack?.(options);\n resolve(options);\n });\n });\n }\n\n /** 道路规划 */\n /**\r\n * \r\n * @param {*} AMapInit 当前地图实例\r\n * @param {*} paths 需查询的路径起始点及途径点集合\r\n * @param {*} roadOptions 路线规划的其他参数\r\n * { paths: 需查询的路径起始点及途径点集合, options: 为查询路线配置项 }\r\n * @param {*} callBack 查询成功后回调函数 兼容老版本代码\r\n */\n async setMapDriving(mapInstance, roadOptions, callBack) {\n const {\n paths,\n options = {}\n } = roadOptions;\n return new Promise(resolve => {\n mapInstance.plugin(\"AMap.Driving\", () => {\n const driving = new this.AMap.Driving({\n map: mapInstance,\n ...options\n });\n driving.search(this.setLngLat(paths[0]), this.setLngLat(paths[paths.length - 1]), {\n waypoints: paths.slice(1, -1).map(path => this.setLngLat(path))\n }, (status, {\n routes\n }) => status === 'complete' && (callBack?.(roadDriving, routes), resolve({\n driving,\n routes\n })));\n });\n });\n }\n\n // 其他方法保持类似改造...\n}\n\n// 获取AMap实例(组件内使用)\nconst getAMapInstance = async (options = {}) => {\n if (AMapInstance) return AMapInstance;\n\n // 确保key存在\n if (!AMapKey) {\n try {\n setAMapSecurity();\n } catch (e) {\n throw new Error('请先设置地图Key!');\n }\n }\n const AMapLoader = (await __webpack_require__.e(/*! import() */ \"node_modules_amap_amap-jsapi-loader_dist_index_js\").then(__webpack_require__.t.bind(__webpack_require__, /*! @amap/amap-jsapi-loader */ \"./node_modules/@amap/amap-jsapi-loader/dist/index.js\", 23))).default;\n try {\n const AMap = await AMapLoader.load({\n key: AMapKey,\n version: '2.0',\n plugins: ['AMap.Geocoder', 'AMap.PlaceSearch',\n // 搜索\n 'AMap.MouseTool',\n // 鼠标\n 'AMap.ControlBar',\n // 方向盘\n 'AMap.ToolBar',\n // 缩放\n ...(options.plugins || [])]\n });\n AMapInstance = new AMapService(AMap);\n return AMapInstance;\n } catch (e) {\n throw new Error(`高德地图加载失败: ${e.message}`);\n }\n};\n\n// 在 Vue 插件中封装高德地图的初始化和常用方法 \n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n async install(Vue, options = {}) {\n const amap = await getAMapInstance(options);\n const {\n AMap,\n methods,\n layers\n } = amap;\n Vue.prototype.$amap = AMap;\n\n /** 初始化地图 */\n Vue.prototype.$initAMap = (mapOptions, callBack) => {\n const amapInit = amap.initMap(mapOptions.el, mapOptions.options || {});\n /** 兼容之前版本代码 */\n callBack?.(amapInit);\n return amapInit;\n };\n\n /** 地图加载完成 */\n Vue.prototype.$amapBus.$emit('onAMapMounted');\n\n /** 常用覆盖物 */\n Vue.prototype.$amapLayers = {\n ...layers,\n setInfoWindow: layers.setInfoWindow(Vue)\n };\n\n /** 抛出地图常用方法 */\n Vue.prototype.$amapMethods = methods || {};\n }\n});\n\n/** \r\n * 安全获取覆盖物坐标信息 \r\n * @param {AMap.Overlay} overlay 地图覆盖物实例\r\n * @returns {Array<Array<number>>} 坐标点数组\r\n */\nfunction getOverlayPos(overlay) {\n if (!overlay) throw new Error('覆盖物实例不存在');\n try {\n return overlay.type === 'AMap.Marker' ? [overlay.getPosition().lng, overlay.getPosition().lat] : overlay.getPath().map(({\n lng,\n lat\n }) => [lng, lat]);\n } catch (e) {\n console.error('转换失败', e);\n return [];\n }\n}\n\n/**\r\n * 轨迹动画执行器\r\n * @param {AMap.Map} AMapInit 地图实例\r\n * @param {AMap.Marker} animationMarker 动画标记物\r\n * @param {Array<Array<number>>} paths 路径坐标数组\r\n * @param {Object} [options] 动画配置\r\n * @param {Function} [callBack] 动画完成回调\r\n */\nfunction drawMapAnimation(AMapInit, animationMarker, paths, options = {}, callBack) {\n if (!AMapInit || !animationMarker || !paths?.length) {\n return console.error('缺少参数信息');\n }\n AMapInit.plugin('AMap.MoveAnimation', () => {\n const defaultOptions = {\n duration: 500,\n autoRotation: true,\n ...options\n };\n animationMarker.moveAlong(paths, defaultOptions);\n callBack?.(animationMarker);\n });\n}\n\n/**\r\n * 转换导航路线为可绘制路径\r\n * @param {AMap.DrivingRoute} route 导航路线对象\r\n * @returns {{\r\n* path: Array<Array<number>>,\r\n* approachPoints: Array<number>\r\n* }}\r\n*/\nfunction parseRouteToPath(route) {\n if (!route?.steps) return {\n path: [],\n approachPoints: []\n };\n const result = {\n path: [],\n approachPoints: []\n };\n route.steps.forEach((step, stepIndex) => {\n step.path.forEach((point, pointIndex) => {\n result.path.push([point.lng, point.lat]);\n if (step.assistant_action === \"到达途经地\" && pointIndex === step.path.length - 1) {\n result.approachPoints.push(result.path.length - 1);\n }\n });\n });\n return result;\n}\n\n//# sourceURL=webpack://mui/./plugins/method/AMap.js?");
9025
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ getAMapInstance: () => (/* binding */ getAMapInstance),\n/* harmony export */ setAMapSecurity: () => (/* binding */ setAMapSecurity)\n/* harmony export */ });\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n/* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! core-js/modules/es.iterator.constructor.js */ \"./node_modules/core-js/modules/es.iterator.constructor.js\");\n/* harmony import */ var core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! core-js/modules/es.iterator.for-each.js */ \"./node_modules/core-js/modules/es.iterator.for-each.js\");\n/* harmony import */ var core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_for_each_js__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! core-js/modules/es.iterator.map.js */ \"./node_modules/core-js/modules/es.iterator.map.js\");\n/* harmony import */ var core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es_iterator_map_js__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n\n// amap-plugin.js\n// import AMapLoader from '@amap/amap-jsapi-loader'\n\n/** 入口文件不同 作用域不同 */\nlet AMapKey = null;\nlet AMapStyle = null;\nlet AMapInstance = null;\n/** 默认地图key、样式及安全解码 */\nlet AMapConfig = {\n key: '722d07dd44d442d72a25a1304bac7743',\n style: 'amap://styles/ff26c7ed32880397f692f5b69b1c1f9f',\n securityJsCode: '90366326a87f1d0e3ddb43e05cc021b1'\n};\n\n// 安全配置 / 地图样式配置\nconst setAMapSecurity = (config = AMapConfig) => {\n const {\n key,\n style,\n securityJsCode\n } = config;\n AMapKey = key;\n AMapStyle = style;\n /** 设置高德地图密钥 */\n window.forceWebGL = true;\n window._AMapSecurityConfig = {\n securityJsCode\n };\n};\n\n// 核心地图服务类\nclass AMapService {\n constructor(AMap) {\n this.AMap = AMap;\n this._iconCache = new Map(); // 图标缓存\n\n /** 常用覆盖物 */\n this.layers = {\n setIcon: this.setIcon.bind(this),\n setMarker: this.setMarker.bind(this),\n setInfoWindow: this._createInfoWindowHandler()\n };\n\n /** 抛出地图常用方法 */\n this.methods = {\n getMapAddress: this.getMapAddress.bind(this),\n getMapSearch: this.getMapSearch.bind(this),\n setMapDriving: this.setMapDriving.bind(this),\n drawMapAnimation,\n parseRouteToPath,\n getOverlayPos\n };\n }\n\n /** 初始化地图 */\n initMap(container, options = {}) {\n const map = new this.AMap.Map(container, {\n zoom: 13,\n zooms: [3, 20],\n pitch: 30,\n rotation: -15,\n viewMode: '3D',\n center: [118.868228, 28.892844],\n mapStyle: AMapStyle,\n ...options\n });\n options.zoomTool && map.addControl(new this.AMap.ToolBar());\n options.directionTool && map.addControl(new this.AMap.ControlBar());\n return map;\n }\n\n /** 格式化地图经纬度 */\n setLngLat(position) {\n return new this.AMap.LngLat(position[0], position[1]);\n }\n\n /** 创建信息窗口处理器(柯里化函数) */\n _createInfoWindowHandler() {\n return Vue => {\n if (!Vue || !Vue.extend) {\n throw new Error('必须传入有效的Vue构造函数');\n }\n return ({\n component,\n props,\n options = {}\n }) => {\n if (!component) throw new Error('component参数必填');\n const InfoWindowComponent = Vue.extend(component);\n const instance = new InfoWindowComponent({\n propsData: props\n }).$mount(document.createElement('div'));\n return new this.AMap.InfoWindow({\n isCustom: true,\n content: instance.$el,\n ...options\n });\n };\n };\n }\n\n /** 带缓存的图标创建方法 */\n async setIcon(iconUrl) {\n if (this._iconCache.has(iconUrl)) {\n return this._iconCache.get(iconUrl);\n }\n return new Promise((resolve, reject) => {\n const icon = new this.AMap.Icon({\n image: iconUrl,\n imageOffset: new this.AMap.Pixel(0, 0)\n });\n const img = new Image();\n img.onload = () => {\n const size = new this.AMap.Size(img.width, img.height);\n icon.setSize(size);\n icon.setImageSize(size);\n this._iconCache.set(iconUrl, icon);\n resolve(icon);\n };\n img.onerror = () => reject(new Error(`图标加载失败: ${iconUrl}`));\n img.src = iconUrl;\n });\n }\n\n /** 增强的标记点创建方法 */\n async setMarker(iconUrl, options = {}) {\n try {\n const icon = await this.setIcon(iconUrl);\n const marker = new this.AMap.Marker({\n anchor: 'bottom-center',\n ...options,\n icon\n });\n return marker;\n } catch (error) {\n console.error('创建标记点失败:', error);\n throw error;\n }\n }\n\n /** 地图逆地理编码 */\n getMapAddress({\n longitude,\n latitude\n }, callBack) {\n return new Promise((resolve, reject) => {\n const geocoder = new this.AMap.Geocoder({\n city: '全国',\n extensions: 'all'\n });\n geocoder.getAddress([longitude, latitude], (status, result) => {\n if (status === 'complete' && result.info === 'OK') {\n const {\n formattedAddress,\n pois\n } = result.regeocode;\n const {\n district,\n township\n } = result.regeocode.addressComponent;\n const division = township && formattedAddress.includes(township) ? formattedAddress.indexOf(township) + township.length : formattedAddress.indexOf(district) + district.length;\n const addressMsg = {\n address: formattedAddress.slice(0, division) + (pois[0]?.address || ''),\n addressInfo: result.regeocode.addressComponent\n };\n callBack?.(addressMsg);\n resolve(addressMsg);\n } else {\n reject(new Error('转换失败'));\n }\n });\n });\n }\n\n /** 根据地址搜索地图poi点及其他信息 */\n /**\r\n * \r\n * @param {*} keywords 根据关键字搜索\r\n * @param {*} callBack 查询成功后过滤信息及转换格式 传递回调函数 兼容老版本代码\r\n */\n getMapSearch(keywords, callBack) {\n return new Promise(resolve => {\n const placeSearch = new this.AMap.PlaceSearch();\n placeSearch.search(keywords, (status, searchList) => {\n const options = searchList?.poiList?.pois?.map(node => ({\n ...node,\n label: `${node.name}(${node.address})`\n })) || [];\n callBack?.(options);\n resolve(options);\n });\n });\n }\n\n /** 道路规划 */\n /**\r\n * \r\n * @param {*} AMapInit 当前地图实例\r\n * @param {*} paths 需查询的路径起始点及途径点集合\r\n * @param {*} roadOptions 路线规划的其他参数\r\n * { paths: 需查询的路径起始点及途径点集合, options: 为查询路线配置项 }\r\n * @param {*} callBack 查询成功后回调函数 兼容老版本代码\r\n */\n async setMapDriving(mapInstance, roadOptions, callBack) {\n const {\n paths,\n options = {}\n } = roadOptions;\n return new Promise(resolve => {\n mapInstance.plugin(\"AMap.Driving\", () => {\n const driving = new this.AMap.Driving({\n map: mapInstance,\n ...options\n });\n driving.search(this.setLngLat(paths[0]), this.setLngLat(paths[paths.length - 1]), {\n waypoints: paths.slice(1, -1).map(path => this.setLngLat(path))\n }, (status, {\n routes\n }) => status === 'complete' && (callBack?.(roadDriving, routes), resolve({\n driving,\n routes\n })));\n });\n });\n }\n\n // 其他方法保持类似改造...\n}\n\n// 获取AMap实例(组件内使用)\nconst getAMapInstance = async (options = {}) => {\n if (AMapInstance) return AMapInstance;\n\n // 确保key存在\n if (!AMapKey) {\n try {\n setAMapSecurity();\n } catch (e) {\n throw new Error('请先设置地图Key!');\n }\n }\n const AMapLoader = (await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @amap/amap-jsapi-loader */ \"@amap/amap-jsapi-loader\", 23))).default;\n try {\n const AMap = await AMapLoader.load({\n key: AMapKey,\n version: '2.0',\n plugins: ['AMap.Geocoder', 'AMap.PlaceSearch',\n // 搜索\n 'AMap.MouseTool',\n // 鼠标\n 'AMap.ControlBar',\n // 方向盘\n 'AMap.ToolBar',\n // 缩放\n ...(options.plugins || [])]\n });\n AMapInstance = new AMapService(AMap);\n return AMapInstance;\n } catch (e) {\n throw new Error(`高德地图加载失败: ${e.message}`);\n }\n};\n\n// 在 Vue 插件中封装高德地图的初始化和常用方法 \n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n async install(Vue, options = {}) {\n const amap = await getAMapInstance(options);\n const {\n AMap,\n methods,\n layers\n } = amap;\n Vue.prototype.$amap = AMap;\n\n /** 初始化地图 */\n Vue.prototype.$initAMap = (mapOptions, callBack) => {\n const amapInit = amap.initMap(mapOptions.el, mapOptions.options || {});\n /** 兼容之前版本代码 */\n callBack?.(amapInit);\n return amapInit;\n };\n\n /** 地图加载完成 */\n Vue.prototype.$amapBus.$emit('onAMapMounted');\n\n /** 常用覆盖物 */\n Vue.prototype.$amapLayers = {\n ...layers,\n setInfoWindow: layers.setInfoWindow(Vue)\n };\n\n /** 抛出地图常用方法 */\n Vue.prototype.$amapMethods = methods || {};\n }\n});\n\n/** \r\n * 安全获取覆盖物坐标信息 \r\n * @param {AMap.Overlay} overlay 地图覆盖物实例\r\n * @returns {Array<Array<number>>} 坐标点数组\r\n */\nfunction getOverlayPos(overlay) {\n if (!overlay) throw new Error('覆盖物实例不存在');\n try {\n return overlay.type === 'AMap.Marker' ? [overlay.getPosition().lng, overlay.getPosition().lat] : overlay.getPath().map(({\n lng,\n lat\n }) => [lng, lat]);\n } catch (e) {\n console.error('转换失败', e);\n return [];\n }\n}\n\n/**\r\n * 轨迹动画执行器\r\n * @param {AMap.Map} AMapInit 地图实例\r\n * @param {AMap.Marker} animationMarker 动画标记物\r\n * @param {Array<Array<number>>} paths 路径坐标数组\r\n * @param {Object} [options] 动画配置\r\n * @param {Function} [callBack] 动画完成回调\r\n */\nfunction drawMapAnimation(AMapInit, animationMarker, paths, options = {}, callBack) {\n if (!AMapInit || !animationMarker || !paths?.length) {\n return console.error('缺少参数信息');\n }\n AMapInit.plugin('AMap.MoveAnimation', () => {\n const defaultOptions = {\n duration: 500,\n autoRotation: true,\n ...options\n };\n animationMarker.moveAlong(paths, defaultOptions);\n callBack?.(animationMarker);\n });\n}\n\n/**\r\n * 转换导航路线为可绘制路径\r\n * @param {AMap.DrivingRoute} route 导航路线对象\r\n * @returns {{\r\n* path: Array<Array<number>>,\r\n* approachPoints: Array<number>\r\n* }}\r\n*/\nfunction parseRouteToPath(route) {\n if (!route?.steps) return {\n path: [],\n approachPoints: []\n };\n const result = {\n path: [],\n approachPoints: []\n };\n route.steps.forEach((step, stepIndex) => {\n step.path.forEach((point, pointIndex) => {\n result.path.push([point.lng, point.lat]);\n if (step.assistant_action === \"到达途经地\" && pointIndex === step.path.length - 1) {\n result.approachPoints.push(result.path.length - 1);\n }\n });\n });\n return result;\n}\n\n//# sourceURL=webpack://mui/./plugins/method/AMap.js?");
9026
9026
 
9027
9027
  /***/ }),
9028
9028
 
@@ -10256,6 +10256,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
10256
10256
 
10257
10257
  /***/ }),
10258
10258
 
10259
+ /***/ "@amap/amap-jsapi-loader":
10260
+ /*!******************************************!*\
10261
+ !*** external "@amap/amap-jsapi-loader" ***!
10262
+ \******************************************/
10263
+ /***/ ((module) => {
10264
+
10265
+ "use strict";
10266
+ module.exports = __WEBPACK_EXTERNAL_MODULE__amap_amap_jsapi_loader__;
10267
+
10268
+ /***/ }),
10269
+
10259
10270
  /***/ "./node_modules/classnames/index.js":
10260
10271
  /*!******************************************!*\
10261
10272
  !*** ./node_modules/classnames/index.js ***!
@@ -12131,9 +12142,6 @@ eval("__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modul
12131
12142
  /******/ return module.exports;
12132
12143
  /******/ }
12133
12144
  /******/
12134
- /******/ // expose the modules object (__webpack_modules__)
12135
- /******/ __webpack_require__.m = __webpack_modules__;
12136
- /******/
12137
12145
  /************************************************************************/
12138
12146
  /******/ /* webpack/runtime/compat get default export */
12139
12147
  /******/ (() => {
@@ -12189,28 +12197,6 @@ eval("__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modul
12189
12197
  /******/ };
12190
12198
  /******/ })();
12191
12199
  /******/
12192
- /******/ /* webpack/runtime/ensure chunk */
12193
- /******/ (() => {
12194
- /******/ __webpack_require__.f = {};
12195
- /******/ // This file contains only the entry chunk.
12196
- /******/ // The chunk loading function for additional chunks
12197
- /******/ __webpack_require__.e = (chunkId) => {
12198
- /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
12199
- /******/ __webpack_require__.f[key](chunkId, promises);
12200
- /******/ return promises;
12201
- /******/ }, []));
12202
- /******/ };
12203
- /******/ })();
12204
- /******/
12205
- /******/ /* webpack/runtime/get javascript chunk filename */
12206
- /******/ (() => {
12207
- /******/ // This function allow to reference async chunks
12208
- /******/ __webpack_require__.u = (chunkId) => {
12209
- /******/ // return url for filenames based on template
12210
- /******/ return "" + chunkId + ".umd.js";
12211
- /******/ };
12212
- /******/ })();
12213
- /******/
12214
12200
  /******/ /* webpack/runtime/global */
12215
12201
  /******/ (() => {
12216
12202
  /******/ __webpack_require__.g = (function() {
@@ -12228,52 +12214,6 @@ eval("__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modul
12228
12214
  /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
12229
12215
  /******/ })();
12230
12216
  /******/
12231
- /******/ /* webpack/runtime/load script */
12232
- /******/ (() => {
12233
- /******/ var inProgress = {};
12234
- /******/ var dataWebpackPrefix = "mui:";
12235
- /******/ // loadScript function to load a script via script tag
12236
- /******/ __webpack_require__.l = (url, done, key, chunkId) => {
12237
- /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
12238
- /******/ var script, needAttach;
12239
- /******/ if(key !== undefined) {
12240
- /******/ var scripts = document.getElementsByTagName("script");
12241
- /******/ for(var i = 0; i < scripts.length; i++) {
12242
- /******/ var s = scripts[i];
12243
- /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
12244
- /******/ }
12245
- /******/ }
12246
- /******/ if(!script) {
12247
- /******/ needAttach = true;
12248
- /******/ script = document.createElement('script');
12249
- /******/
12250
- /******/ script.charset = 'utf-8';
12251
- /******/ script.timeout = 120;
12252
- /******/ if (__webpack_require__.nc) {
12253
- /******/ script.setAttribute("nonce", __webpack_require__.nc);
12254
- /******/ }
12255
- /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
12256
- /******/
12257
- /******/ script.src = url;
12258
- /******/ }
12259
- /******/ inProgress[url] = [done];
12260
- /******/ var onScriptComplete = (prev, event) => {
12261
- /******/ // avoid mem leaks in IE.
12262
- /******/ script.onerror = script.onload = null;
12263
- /******/ clearTimeout(timeout);
12264
- /******/ var doneFns = inProgress[url];
12265
- /******/ delete inProgress[url];
12266
- /******/ script.parentNode && script.parentNode.removeChild(script);
12267
- /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
12268
- /******/ if(prev) return prev(event);
12269
- /******/ }
12270
- /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
12271
- /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
12272
- /******/ script.onload = onScriptComplete.bind(null, script.onload);
12273
- /******/ needAttach && document.head.appendChild(script);
12274
- /******/ };
12275
- /******/ })();
12276
- /******/
12277
12217
  /******/ /* webpack/runtime/make namespace object */
12278
12218
  /******/ (() => {
12279
12219
  /******/ // define __esModule on exports
@@ -12294,119 +12234,6 @@ eval("__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modul
12294
12234
  /******/ };
12295
12235
  /******/ })();
12296
12236
  /******/
12297
- /******/ /* webpack/runtime/publicPath */
12298
- /******/ (() => {
12299
- /******/ var scriptUrl;
12300
- /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
12301
- /******/ var document = __webpack_require__.g.document;
12302
- /******/ if (!scriptUrl && document) {
12303
- /******/ if (document.currentScript)
12304
- /******/ scriptUrl = document.currentScript.src;
12305
- /******/ if (!scriptUrl) {
12306
- /******/ var scripts = document.getElementsByTagName("script");
12307
- /******/ if(scripts.length) {
12308
- /******/ var i = scripts.length - 1;
12309
- /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
12310
- /******/ }
12311
- /******/ }
12312
- /******/ }
12313
- /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
12314
- /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
12315
- /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
12316
- /******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
12317
- /******/ __webpack_require__.p = scriptUrl;
12318
- /******/ })();
12319
- /******/
12320
- /******/ /* webpack/runtime/jsonp chunk loading */
12321
- /******/ (() => {
12322
- /******/ // no baseURI
12323
- /******/
12324
- /******/ // object to store loaded and loading chunks
12325
- /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
12326
- /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
12327
- /******/ var installedChunks = {
12328
- /******/ "index": 0
12329
- /******/ };
12330
- /******/
12331
- /******/ __webpack_require__.f.j = (chunkId, promises) => {
12332
- /******/ // JSONP chunk loading for javascript
12333
- /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
12334
- /******/ if(installedChunkData !== 0) { // 0 means "already installed".
12335
- /******/
12336
- /******/ // a Promise means "currently loading".
12337
- /******/ if(installedChunkData) {
12338
- /******/ promises.push(installedChunkData[2]);
12339
- /******/ } else {
12340
- /******/ if(true) { // all chunks have JS
12341
- /******/ // setup Promise in chunk cache
12342
- /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
12343
- /******/ promises.push(installedChunkData[2] = promise);
12344
- /******/
12345
- /******/ // start chunk loading
12346
- /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
12347
- /******/ // create error before stack unwound to get useful stacktrace later
12348
- /******/ var error = new Error();
12349
- /******/ var loadingEnded = (event) => {
12350
- /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
12351
- /******/ installedChunkData = installedChunks[chunkId];
12352
- /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
12353
- /******/ if(installedChunkData) {
12354
- /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
12355
- /******/ var realSrc = event && event.target && event.target.src;
12356
- /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
12357
- /******/ error.name = 'ChunkLoadError';
12358
- /******/ error.type = errorType;
12359
- /******/ error.request = realSrc;
12360
- /******/ installedChunkData[1](error);
12361
- /******/ }
12362
- /******/ }
12363
- /******/ };
12364
- /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
12365
- /******/ }
12366
- /******/ }
12367
- /******/ }
12368
- /******/ };
12369
- /******/
12370
- /******/ // no prefetching
12371
- /******/
12372
- /******/ // no preloaded
12373
- /******/
12374
- /******/ // no HMR
12375
- /******/
12376
- /******/ // no HMR manifest
12377
- /******/
12378
- /******/ // no on chunks loaded
12379
- /******/
12380
- /******/ // install a JSONP callback for chunk loading
12381
- /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
12382
- /******/ var [chunkIds, moreModules, runtime] = data;
12383
- /******/ // add "moreModules" to the modules object,
12384
- /******/ // then flag all "chunkIds" as loaded and fire callback
12385
- /******/ var moduleId, chunkId, i = 0;
12386
- /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
12387
- /******/ for(moduleId in moreModules) {
12388
- /******/ if(__webpack_require__.o(moreModules, moduleId)) {
12389
- /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
12390
- /******/ }
12391
- /******/ }
12392
- /******/ if(runtime) var result = runtime(__webpack_require__);
12393
- /******/ }
12394
- /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
12395
- /******/ for(;i < chunkIds.length; i++) {
12396
- /******/ chunkId = chunkIds[i];
12397
- /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
12398
- /******/ installedChunks[chunkId][0]();
12399
- /******/ }
12400
- /******/ installedChunks[chunkId] = 0;
12401
- /******/ }
12402
- /******/
12403
- /******/ }
12404
- /******/
12405
- /******/ var chunkLoadingGlobal = self["webpackChunkmui"] = self["webpackChunkmui"] || [];
12406
- /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
12407
- /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
12408
- /******/ })();
12409
- /******/
12410
12237
  /******/ /* webpack/runtime/nonce */
12411
12238
  /******/ (() => {
12412
12239
  /******/ __webpack_require__.nc = undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "web-component-gallery",
3
- "version": "1.2.21",
3
+ "version": "1.2.23",
4
4
  "description": "基于Vue2的Web Components组件库",
5
5
  "main": "dist/index.umd.js",
6
6
  "files": [
@@ -1,22 +0,0 @@
1
- "use strict";
2
- /*
3
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
4
- * This devtool is neither made for production nor for readable output files.
5
- * It uses "eval()" calls to create a separate source file in the browser devtools.
6
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
7
- * or disable the default devtool with "devtool: false".
8
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
9
- */
10
- (self["webpackChunkmui"] = self["webpackChunkmui"] || []).push([["node_modules_amap_amap-jsapi-loader_dist_index_js"],{
11
-
12
- /***/ "./node_modules/@amap/amap-jsapi-loader/dist/index.js":
13
- /*!************************************************************!*\
14
- !*** ./node_modules/@amap/amap-jsapi-loader/dist/index.js ***!
15
- \************************************************************/
16
- /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
17
-
18
- eval("\n\n__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n(function (m, p) {\n true ? module.exports = p() : 0;\n})(this, function () {\n function m(a) {\n var b = [];\n a.AMapUI && b.push(p(a.AMapUI));\n a.Loca && b.push(r(a.Loca));\n return Promise.all(b);\n }\n function p(a) {\n return new Promise(function (h, c) {\n var f = [];\n if (a.plugins) for (var e = 0; e < a.plugins.length; e += 1) -1 == d.AMapUI.plugins.indexOf(a.plugins[e]) && f.push(a.plugins[e]);\n if (g.AMapUI === b.failed) c(\"\\u524d\\u6b21\\u8bf7\\u6c42 AMapUI \\u5931\\u8d25\");else if (g.AMapUI === b.notload) {\n g.AMapUI = b.loading;\n d.AMapUI.version = a.version || d.AMapUI.version;\n e = d.AMapUI.version;\n var l = document.body || document.head,\n k = document.createElement(\"script\");\n k.type = \"text/javascript\";\n k.src = \"https://webapi.amap.com/ui/\" + e + \"/main.js\";\n k.onerror = function (a) {\n g.AMapUI = b.failed;\n c(\"\\u8bf7\\u6c42 AMapUI \\u5931\\u8d25\");\n };\n k.onload = function () {\n g.AMapUI = b.loaded;\n if (f.length) window.AMapUI.loadUI(f, function () {\n for (var a = 0, b = f.length; a < b; a++) {\n var c = f[a].split(\"/\").slice(-1)[0];\n window.AMapUI[c] = arguments[a];\n }\n for (h(); n.AMapUI.length;) n.AMapUI.splice(0, 1)[0]();\n });else for (h(); n.AMapUI.length;) n.AMapUI.splice(0, 1)[0]();\n };\n l.appendChild(k);\n } else g.AMapUI === b.loaded ? a.version && a.version !== d.AMapUI.version ? c(\"\\u4e0d\\u5141\\u8bb8\\u591a\\u4e2a\\u7248\\u672c AMapUI \\u6df7\\u7528\") : f.length ? window.AMapUI.loadUI(f, function () {\n for (var a = 0, b = f.length; a < b; a++) {\n var c = f[a].split(\"/\").slice(-1)[0];\n window.AMapUI[c] = arguments[a];\n }\n h();\n }) : h() : a.version && a.version !== d.AMapUI.version ? c(\"\\u4e0d\\u5141\\u8bb8\\u591a\\u4e2a\\u7248\\u672c AMapUI \\u6df7\\u7528\") : n.AMapUI.push(function (a) {\n a ? c(a) : f.length ? window.AMapUI.loadUI(f, function () {\n for (var a = 0, b = f.length; a < b; a++) {\n var c = f[a].split(\"/\").slice(-1)[0];\n window.AMapUI[c] = arguments[a];\n }\n h();\n }) : h();\n });\n });\n }\n function r(a) {\n return new Promise(function (h, c) {\n if (g.Loca === b.failed) c(\"\\u524d\\u6b21\\u8bf7\\u6c42 Loca \\u5931\\u8d25\");else if (g.Loca === b.notload) {\n g.Loca = b.loading;\n d.Loca.version = a.version || d.Loca.version;\n var f = d.Loca.version,\n e = d.AMap.version.startsWith(\"2\"),\n l = f.startsWith(\"2\");\n if (e && !l || !e && l) c(\"JSAPI \\u4e0e Loca \\u7248\\u672c\\u4e0d\\u5bf9\\u5e94\\uff01\\uff01\");else {\n e = d.key;\n l = document.body || document.head;\n var k = document.createElement(\"script\");\n k.type = \"text/javascript\";\n k.src = \"https://webapi.amap.com/loca?v=\" + f + \"&key=\" + e;\n k.onerror = function (a) {\n g.Loca = b.failed;\n c(\"\\u8bf7\\u6c42 AMapUI \\u5931\\u8d25\");\n };\n k.onload = function () {\n g.Loca = b.loaded;\n for (h(); n.Loca.length;) n.Loca.splice(0, 1)[0]();\n };\n l.appendChild(k);\n }\n } else g.Loca === b.loaded ? a.version && a.version !== d.Loca.version ? c(\"\\u4e0d\\u5141\\u8bb8\\u591a\\u4e2a\\u7248\\u672c Loca \\u6df7\\u7528\") : h() : a.version && a.version !== d.Loca.version ? c(\"\\u4e0d\\u5141\\u8bb8\\u591a\\u4e2a\\u7248\\u672c Loca \\u6df7\\u7528\") : n.Loca.push(function (a) {\n a ? c(a) : c();\n });\n });\n }\n if (!window) throw Error(\"AMap JSAPI can only be used in Browser.\");\n var b;\n (function (a) {\n a.notload = \"notload\";\n a.loading = \"loading\";\n a.loaded = \"loaded\";\n a.failed = \"failed\";\n })(b || (b = {}));\n var d = {\n key: \"\",\n AMap: {\n version: \"1.4.15\",\n plugins: []\n },\n AMapUI: {\n version: \"1.1\",\n plugins: []\n },\n Loca: {\n version: \"1.3.2\"\n }\n },\n g = {\n AMap: b.notload,\n AMapUI: b.notload,\n Loca: b.notload\n },\n n = {\n AMap: [],\n AMapUI: [],\n Loca: []\n },\n q = [],\n t = function (a) {\n \"function\" == typeof a && (g.AMap === b.loaded ? a(window.AMap) : q.push(a));\n };\n return {\n load: function (a) {\n return new Promise(function (h, c) {\n if (g.AMap == b.failed) c(\"\");else if (g.AMap == b.notload) {\n var f = a.key,\n e = a.version,\n l = a.plugins;\n f ? (window.AMap && \"lbs.amap.com\" !== location.host && c(\"\\u7981\\u6b62\\u591a\\u79cdAPI\\u52a0\\u8f7d\\u65b9\\u5f0f\\u6df7\\u7528\"), d.key = f, d.AMap.version = e || d.AMap.version, d.AMap.plugins = l || d.AMap.plugins, g.AMap = b.loading, e = document.body || document.head, window.___onAPILoaded = function (d) {\n delete window.___onAPILoaded;\n if (d) g.AMap = b.failed, c(d);else for (g.AMap = b.loaded, m(a).then(function () {\n h(window.AMap);\n })[\"catch\"](c); q.length;) q.splice(0, 1)[0]();\n }, l = document.createElement(\"script\"), l.type = \"text/javascript\", l.src = \"https://webapi.amap.com/maps?callback=___onAPILoaded&v=\" + d.AMap.version + \"&key=\" + f + \"&plugin=\" + d.AMap.plugins.join(\",\"), l.onerror = function (a) {\n g.AMap = b.failed;\n c(a);\n }, e.appendChild(l)) : c(\"\\u8bf7\\u586b\\u5199key\");\n } else if (g.AMap == b.loaded) {\n if (a.key && a.key !== d.key) c(\"\\u591a\\u4e2a\\u4e0d\\u4e00\\u81f4\\u7684 key\");else if (a.version && a.version !== d.AMap.version) c(\"\\u4e0d\\u5141\\u8bb8\\u591a\\u4e2a\\u7248\\u672c JSAPI \\u6df7\\u7528\");else {\n f = [];\n if (a.plugins) for (e = 0; e < a.plugins.length; e += 1) -1 == d.AMap.plugins.indexOf(a.plugins[e]) && f.push(a.plugins[e]);\n if (f.length) window.AMap.plugin(f, function () {\n m(a).then(function () {\n h(window.AMap);\n })[\"catch\"](c);\n });else m(a).then(function () {\n h(window.AMap);\n })[\"catch\"](c);\n }\n } else if (a.key && a.key !== d.key) c(\"\\u591a\\u4e2a\\u4e0d\\u4e00\\u81f4\\u7684 key\");else if (a.version && a.version !== d.AMap.version) c(\"\\u4e0d\\u5141\\u8bb8\\u591a\\u4e2a\\u7248\\u672c JSAPI \\u6df7\\u7528\");else {\n var k = [];\n if (a.plugins) for (e = 0; e < a.plugins.length; e += 1) -1 == d.AMap.plugins.indexOf(a.plugins[e]) && k.push(a.plugins[e]);\n t(function () {\n if (k.length) window.AMap.plugin(k, function () {\n m(a).then(function () {\n h(window.AMap);\n })[\"catch\"](c);\n });else m(a).then(function () {\n h(window.AMap);\n })[\"catch\"](c);\n });\n }\n });\n },\n reset: function () {\n delete window.AMap;\n delete window.AMapUI;\n delete window.Loca;\n d = {\n key: \"\",\n AMap: {\n version: \"1.4.15\",\n plugins: []\n },\n AMapUI: {\n version: \"1.1\",\n plugins: []\n },\n Loca: {\n version: \"1.3.2\"\n }\n };\n g = {\n AMap: b.notload,\n AMapUI: b.notload,\n Loca: b.notload\n };\n n = {\n AMap: [],\n AMapUI: [],\n Loca: []\n };\n }\n };\n});\n\n//# sourceURL=webpack://mui/./node_modules/@amap/amap-jsapi-loader/dist/index.js?");
19
-
20
- /***/ })
21
-
22
- }]);