| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-77a2398c"],{"129f":function(e,t){e.exports=Object.is||function(e,t){return e===t?0!==e||1/e===1/t:e!=e&&t!=t}},5420:function(e,t,o){"use strict";o.r(t);var n=o("7a23"),a=Object(n["withScopeId"])("data-v-8c013d80");Object(n["pushScopeId"])("data-v-8c013d80");var i={class:"ele-body ele-body-card"},s=Object(n["createTextVNode"])("地图选择位置(POI) "),c=Object(n["createTextVNode"])("关键字检索模式 "),r={key:0},l={style:{"margin-top":"12px"}},p={style:{"margin-top":"12px"}},d={style:{"margin-top":"12px"}},u={ref:"locationMap",style:{height:"360px","max-width":"1000px"}},h={ref:"trackMap",style:{height:"360px","margin-bottom":"16px","max-width":"1000px"}},m=Object(n["createTextVNode"])("开始动画 "),f=Object(n["createTextVNode"])("暂停动画 "),g=Object(n["createTextVNode"])("继续动画 ");Object(n["popScopeId"])();var k=a((function(e,t,o,k,v,y){var b=Object(n["resolveComponent"])("ele-map-picker"),M=Object(n["resolveComponent"])("a-button"),w=Object(n["resolveComponent"])("a-space"),O=Object(n["resolveComponent"])("a-card");return Object(n["openBlock"])(),Object(n["createBlock"])("div",i,[Object(n["createVNode"])(b,{visible:v.showPicker,"onUpdate:visible":t[1]||(t[1]=function(e){return v.showPicker=e}),"need-city":!0,onDone:y.onChoose},null,8,["visible","onDone"]),Object(n["createVNode"])(b,{visible:v.showPicker2,"onUpdate:visible":t[2]||(t[2]=function(e){return v.showPicker2=e}),"need-city":!0,"search-type":1,onDone:y.onChoose},null,8,["visible","onDone"]),Object(n["createVNode"])(O,{title:"弹窗选择位置",bordered:!1},{default:a((function(){return[Object(n["createVNode"])(w,null,{default:a((function(){return[Object(n["createVNode"])(M,{type:"primary",onClick:t[3]||(t[3]=function(e){return v.showPicker=!0})},{default:a((function(){return[s]})),_:1}),Object(n["createVNode"])(M,{type:"primary",onClick:t[4]||(t[4]=function(e){return v.showPicker2=!0})},{default:a((function(){return[c]})),_:1})]})),_:1}),v.form.location?(Object(n["openBlock"])(),Object(n["createBlock"])("div",r,[Object(n["createVNode"])("div",l,"选择位置: "+Object(n["toDisplayString"])(v.form.location),1),Object(n["createVNode"])("div",p,"详细地址: "+Object(n["toDisplayString"])(v.form.address),1),Object(n["createVNode"])("div",d,"经 纬 度 : "+Object(n["toDisplayString"])(v.form.jinweidu),1)])):Object(n["createCommentVNode"])("",!0)]})),_:1}),Object(n["createVNode"])(O,{title:"官网底部地图",bordered:!1},{default:a((function(){return[Object(n["createVNode"])("div",u,null,512)]})),_:1}),Object(n["createVNode"])(O,{title:"轨迹展示及轨迹回放",bordered:!1},{default:a((function(){return[Object(n["createVNode"])("div",h,null,512),Object(n["createVNode"])(w,null,{default:a((function(){return[Object(n["createVNode"])(M,{type:"primary",onClick:y.startTrackAnim},{default:a((function(){return[m]})),_:1},8,["onClick"]),Object(n["createVNode"])(M,{type:"primary",onClick:y.pauseTrackAnim},{default:a((function(){return[f]})),_:1},8,["onClick"]),Object(n["createVNode"])(M,{type:"primary",onClick:y.resumeTrackAnim},{default:a((function(){return[g]})),_:1},8,["onClick"])]})),_:1})]})),_:1})])})),v=(o("b0c0"),o("d81d"),{class:"ele-map-picker-header"}),y={class:"ele-map-picker-header-search"},b={class:"ele-map-picker-body"},M={class:"ele-map-picker-main"},w={class:"ele-map-picker-poi-item-title"},O={key:0,class:"ele-map-picker-poi-item-address"};function j(e,t,o,a,i,s){var c=Object(n["resolveComponent"])("search-outlined"),r=Object(n["resolveComponent"])("a-input"),l=Object(n["resolveComponent"])("a-auto-complete"),p=Object(n["resolveComponent"])("a-button"),d=Object(n["resolveComponent"])("plus-outlined"),u=Object(n["resolveComponent"])("environment-outlined"),h=Object(n["resolveComponent"])("check-circle-outlined"),m=Object(n["resolveComponent"])("a-spin"),f=Object(n["resolveComponent"])("a-modal"),g=Object(n["resolveComponent"])("locale-receiver");return Object(n["openBlock"])(),Object(n["createBlock"])(g,{"component-name":"ele"},{default:Object(n["withCtx"])((function(a){return[Object(n["createVNode"])(f,{visible:o.visible,title:o.title||a.map.title,width:o.width,centered:o.centered,closable:o.closable,"destroy-on-close":o.destroyOnClose,"force-render":o.forceRender,keyboard:o.keyboard,mask:o.mask,"mask-closable":o.maskClosable,"mask-style":o.maskStyle,"wrap-class-name":o.wrapClassName,"z-index":o.zIndex,"dialog-style":o.dialogStyle,"dialog-class":o.dialogClass,footer:null,"body-style":{padding:0},class:"ele-map-picker-dialog","onUpdate:visible":s.updateVisible},{title:Object(n["withCtx"])((function(){return[Object(n["renderSlot"])(e.$slots,"title")]})),default:Object(n["withCtx"])((function(){return[i.show?(Object(n["openBlock"])(),Object(n["createBlock"])(m,{key:0,spinning:i.loading},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])("div",v,[Object(n["createVNode"])("div",y,[Object(n["createVNode"])(l,{value:i.suggestionKeywords,"onUpdate:value":t[1]||(t[1]=function(e){return i.suggestionKeywords=e}),placeholder:o.searchPlaceholder||a.map.placeholder,options:i.suggestionData,onSearch:s.onSearch,onSelect:s.onSelect},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(r,null,{suffix:Object(n["withCtx"])((function(){return[Object(n["createVNode"])(c,{class:"ele-text-secondary"})]})),_:1})]})),_:2},1032,["value","placeholder","options","onSearch","onSelect"])]),Object(n["createVNode"])(p,{loading:i.doneLoading,type:"primary",onClick:function(e){return s.onDone(a.map.message)}},{default:Object(n["withCtx"])((function(){return[Object(n["createTextVNode"])(Object(n["toDisplayString"])(o.okText||a.map.ok),1)]})),_:2},1032,["loading","onClick"])]),Object(n["createVNode"])("div",b,[Object(n["createVNode"])("div",M,[Object(n["createVNode"])("div",{ref:"eleMapPickerMap",style:{height:o.height}},null,4),0===o.searchType?(Object(n["openBlock"])(),Object(n["createBlock"])(d,{key:0,class:"ele-map-picker-main-plus"})):Object(n["createCommentVNode"])("",!0),0===o.searchType?(Object(n["openBlock"])(),Object(n["createBlock"])("img",{key:1,class:s.iconClass,src:o.markerSrc,alt:""},null,10,["src"])):Object(n["createCommentVNode"])("",!0)]),Object(n["createVNode"])(m,{spinning:i.poiLoading},{default:Object(n["withCtx"])((function(){return[Object(n["createVNode"])("div",{class:"ele-map-picker-poi-list",style:{height:o.height}},[(Object(n["openBlock"])(!0),Object(n["createBlock"])(n["Fragment"],null,Object(n["renderList"])(i.poiData,(function(e,t){return Object(n["openBlock"])(),Object(n["createBlock"])("div",{key:t,class:["ele-map-picker-poi-item",{active:t===i.chooseIndex}],onClick:function(e){return s.onChoose(t)}},[Object(n["createVNode"])(u,{class:"ele-map-picker-poi-item-icon"}),Object(n["createVNode"])("div",w,Object(n["toDisplayString"])(e.name),1),e.address?(Object(n["openBlock"])(),Object(n["createBlock"])("div",O,Object(n["toDisplayString"])(e.address),1)):Object(n["createCommentVNode"])("",!0),Object(n["createVNode"])(h,{class:"ele-map-picker-poi-item-check"})],10,["onClick"])})),128))],4)]})),_:1},8,["spinning"])])]})),_:2},1032,["spinning"])):Object(n["createCommentVNode"])("",!0)]})),_:2},1032,["visible","title","width","centered","closable","destroy-on-close","force-render","keyboard","mask","mask-closable","mask-style","wrap-class-name","z-index","dialog-style","dialog-class","onUpdate:visible"])]})),_:1})}o("a9e3"),o("4de4"),o("ac1f"),o("841c");var A=o("e5cd"),I=o("862d"),S=o.n(I),C=o("47ce"),x=o("e9d5"),L=o("3415"),N=o("d34f"),V={name:"EleMapPicker",components:{LocaleReceiver:A["a"],PlusOutlined:C["a"],SearchOutlined:x["a"],EnvironmentOutlined:L["a"],CheckCircleOutlined:N["a"]},emits:["done","open","closed","update:visible"],props:{visible:Boolean,height:{type:String,default:"450px"},center:Array,zoom:{type:Number,default:11},chooseZoom:{type:Number,default:17},poiSize:{type:Number,default:30},poiType:{type:String,default:""},poiKeywords:{type:String,default:""},poiRadius:{type:Number,default:1e3},needCity:Boolean,forceChoose:{type:Boolean,default:!0},suggestionCity:{type:String,default:"全国"},searchType:{type:Number,default:0},searchPlaceholder:String,markerSrc:{type:String,default:"https://3gimg.qq.com/lightmap/components/locationPicker2/image/marker.png"},mapKey:{type:String,default:"006d995d433058322319fa797f2876f5"},mapVersion:{type:String,default:"2.0"},mapStyle:String,centered:Boolean,closable:{type:Boolean,default:!0},destroyOnClose:Boolean,forceRender:Boolean,keyboard:{type:Boolean,default:!0},mask:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0},maskStyle:Object,title:String,width:{type:String,default:"780px"},wrapClassName:String,zIndex:{type:Number,default:1e3},dialogStyle:Object,dialogClass:String,okText:String},data:function(){return{show:!1,map:null,centerMarker:null,placeSearch:null,autoComplete:null,poiData:[],chooseIndex:null,isSelMove:!1,showIconAnim:!1,suggestionKeywords:"",lastSuggestion:"",suggestionData:[],chooseSuggestion:null,loading:!0,poiLoading:!1,doneLoading:!1}},computed:{iconClass:function(){return["ele-map-picker-main-icon",{"ele-map-picker-anim-bounce":this.showIconAnim}]},darkMode:function(){try{return this.$store.state.theme.darkMode}catch(e){return null}}},watch:{visible:function(){this.visible?this.onOpen():this.onClosed()},darkMode:function(){this.map&&!this.mapStyle&&(this.darkMode?this.map.setMapStyle("amap://styles/dark"):this.map.setMapStyle("amap://styles/normal"))}},mounted:function(){this.visible&&this.onOpen()},methods:{render:function(){var e=this;S.a.load({key:this.mapKey,version:this.mapVersion,plugins:["AMap.PlaceSearch","AMap.AutoComplete"]}).then((function(t){e.loading=!1,e.poiLoading=!0;var o={resizeEnable:!0,zoom:e.zoom,center:e.center};e.mapStyle?o.mapStyle=e.mapStyle:e.darkMode&&(o.mapStyle="amap://styles/dark"),e.map=new t.Map(e.$refs.eleMapPickerMap,o),e.placeSearch=new t.PlaceSearch({type:e.poiType,pageSize:e.poiSize,pageIndex:1}),e.autoComplete=new t.AutoComplete({city:e.suggestionCity}),e.map.on("complete",(function(){e.chooseIndex=null;var t=e.map.getCenter();e.searchNearBy(t.lat,t.lng,!0)})),e.map.on("moveend",(function(){if(e.isSelMove)e.isSelMove=!1;else{e.showIconAnim=!1,e.$nextTick((function(){setTimeout((function(){e.showIconAnim=!0}),0)}));var t=e.map.getCenter();e.searchNearBy(t.lat,t.lng)}})),e.centerMarker=new t.Marker({icon:new t.Icon({image:e.markerSrc,size:new t.Size(26,36.5),imageSize:new t.Size(26,36.5)}),offset:new t.Pixel(-13,-36.5)})})).catch((function(t){e.loading=!1,console.error(t)}))},searchNearBy:function(e,t,o){var n=this;this.placeSearch&&(o||0===this.searchType?(this.poiLoading=!0,this.placeSearch.searchNearBy(this.poiKeywords,[t,e],this.poiRadius,(function(e,t){if(n.poiLoading=!1,"complete"===e){var o=t.poiList.pois.filter((function(e){return void 0!==e.location}));n.chooseSuggestion?(0!==o.length&&o[0].name===n.chooseSuggestion.name||o.unshift(Object.assign({},n.chooseSuggestion)),n.chooseSuggestion=null):n.chooseIndex=null,n.poiData=o}}))):this.poiLoading=!1)},onChoose:function(e){var t=this;this.isSelMove=!0,this.chooseIndex=e;var o=this.poiData[e].location;this.map.setZoomAndCenter(this.chooseZoom,[o.lng,o.lat]),0!==this.searchType?(this.centerMarker.setPosition([o.lng,o.lat]),this.map.add(this.centerMarker)):(this.showIconAnim=!1,this.$nextTick((function(){setTimeout((function(){t.showIconAnim=!0}),0)})))},onSearch:function(e){var t=this;this.autoComplete&&e&&this.lastSuggestion!==e&&(0!==this.searchType&&(this.poiLoading=!0),this.lastSuggestion=e,this.autoComplete.search(e,(function(e,o){var n=[];o.tips&&(n=o.tips.map((function(e){return Object.assign({},e,{address:Array.isArray(e.address)?e.address[0]:e.address,text:e.name,value:e.name})}))),0===t.searchType?t.suggestionData=n:(t.poiData=n,t.chooseIndex=null,t.poiLoading=!1,t.map.remove(t.centerMarker))})))},onSelect:function(e,t){this.chooseSuggestion=t,this.poiData.length&&this.poiData[0].name===this.chooseSuggestion.name||this.poiData.unshift(Object.assign({},this.chooseSuggestion)),this.chooseIndex=0;var o=this.chooseSuggestion.location;o&&this.map&&this.map.setZoomAndCenter(this.chooseZoom,[o.lng,o.lat])},onDone:function(e){var t=this;if(this.map){var o;if(null===this.chooseIndex){if(this.forceChoose)return this.$message.error(e);o=Object.assign({},this.map.getCenter())}else o=Object.assign({name:this.poiData[this.chooseIndex].name,address:this.poiData[this.chooseIndex].address||""},this.poiData[this.chooseIndex].location);this.needCity?(this.doneLoading=!0,this.map.setCenter([o.lng,o.lat]),this.map.getCity((function(e){t.doneLoading=!1,o.city=e,t.$emit("done",o)}))):this.$emit("done",o)}},onOpen:function(){this.show=!0,(this.destroyOnClose||null===this.map)&&this.render(),this.$emit("open")},onClosed:function(){this.destroyOnClose&&(this.show=!1,this.suggestionKeywords="",this.lastSuggestion="",this.poiData=[],this.chooseIndex=null,this.suggestionData=[],this.chooseSuggestion=null),this.$emit("closed")},updateVisible:function(e){this.$emit("update:visible",e)}}},U=(o("ddf5"),o("6b0d")),P=o.n(U);const T=P()(V,[["render",j]]);var B=T;B.install=function(e){e.component(B.name,B)};var D=B,_={name:"ExtensionMap",components:{EleMapPicker:D},data:function(){return{showPicker:!1,showPicker2:!1,form:{},carMarker:null,lineData:[[116.478935,39.997761],[116.478939,39.997825],[116.478912,39.998549],[116.478912,39.998549],[116.478998,39.998555],[116.478998,39.998555],[116.479282,39.99856],[116.479658,39.998528],[116.480151,39.998453],[116.480784,39.998302],[116.480784,39.998302],[116.481149,39.998184],[116.481573,39.997997],[116.481863,39.997846],[116.482072,39.997718],[116.482362,39.997718],[116.483633,39.998935],[116.48367,39.998968],[116.484648,39.999861]],mapInsLocation:null,mapInsTrack:null}},computed:{darkMode:function(){return this.$store.state.theme.darkMode}},mounted:function(){this.renderLocationMap(),this.renderTrackMap()},methods:{onChoose:function(e){console.log(e),this.form={location:e.city.province+"/"+e.city.city+"/"+e.city.district,address:e.name+" "+e.address,jinweidu:e.lng+","+e.lat},this.showPicker=!1,this.showPicker2=!1},renderLocationMap:function(){var e=this;S.a.load({key:"006d995d433058322319fa797f2876f5",version:"2.0",plugins:["AMap.InfoWindow","AMap.Marker"]}).then((function(t){var o={zoom:13,center:[114.346084,30.516215]};e.darkMode&&(o.mapStyle="amap://styles/dark"),e.mapInsLocation=new t.Map(e.$refs.locationMap,o);var n=new t.InfoWindow({content:'\n <div style="color: #333;">\n <div style="padding: 5px;font-size: 16px;">武汉易云智科技有限公司</div>\n <div style="padding: 0 5px;">地址:湖北省武汉市洪山区雄楚大道222号</div>\n <div style="padding: 0 5px;">电话:020-123456789</div>\n </div>\n <a style="padding: 8px 5px 0;text-decoration: none;display: inline-block;" class="ele-text-primary"\n href="//uri.amap.com/marker?position=114.346084,30.511215&name=武汉易云智科技有限公司"\n target="_blank">到这里去→</a>\n '});n.open(e.mapInsLocation,[114.346084,30.511215]);var a=new t.Icon({size:new t.Size(25,34),image:"//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-red.png",imageSize:new t.Size(25,34)}),i=new t.Marker({icon:a,position:[114.346084,30.511215],offset:new t.Pixel(-12,-28)});i.setMap(e.mapInsLocation),i.on("click",(function(){n.open(e.mapInsLocation)}))})).catch((function(e){console.error(e)}))},renderTrackMap:function(){var e=this;S.a.load({key:"006d995d433058322319fa797f2876f5",version:"2.0",plugins:["AMap.MoveAnimation","AMap.Marker","AMap.Polyline"]}).then((function(t){var o={zoom:17,center:[116.478935,39.997761]};e.darkMode&&(o.mapStyle="amap://styles/dark"),e.mapInsTrack=new t.Map(e.$refs.trackMap,o),e.carMarker=new t.Marker({map:e.mapInsTrack,position:[116.478935,39.997761],icon:"https://a.amap.com/jsapi_demos/static/demo-center-v2/car.png",offset:new t.Pixel(-13,-26)}),new t.Polyline({map:e.mapInsTrack,path:e.lineData,showDir:!0,strokeColor:"#28F",strokeOpacity:1,strokeWeight:6});var n=new t.Polyline({map:e.mapInsTrack,showDir:!0,strokeColor:"#4B5",strokeOpacity:1,strokeWeight:6});e.carMarker.on("moving",(function(e){n.setPath(e.passedPath)})),e.mapInsTrack.setFitView()})).catch((function(e){console.error(e)}))},startTrackAnim:function(){this.carMarker.stopMove(),this.carMarker.moveAlong(this.lineData,{duration:200,autoRotation:!0})},pauseTrackAnim:function(){this.carMarker.pauseMove()},resumeTrackAnim:function(){this.carMarker.resumeMove()}},watch:{darkMode:function(){this.mapInsLocation&&(this.darkMode?this.mapInsLocation.setMapStyle("amap://styles/dark"):this.mapInsLocation.setMapStyle("amap://styles/normal")),this.mapInsTrack&&(this.darkMode?this.mapInsTrack.setMapStyle("amap://styles/dark"):this.mapInsTrack.setMapStyle("amap://styles/normal"))}}};const z=P()(_,[["render",k],["__scopeId","data-v-8c013d80"]]);t["default"]=z},"841c":function(e,t,o){"use strict";var n=o("d784"),a=o("825a"),i=o("1d80"),s=o("129f"),c=o("14c3");n("search",(function(e,t,o){return[function(t){var o=i(this),n=void 0==t?void 0:t[e];return void 0!==n?n.call(t,o):new RegExp(t)[e](String(o))},function(e){var n=o(t,this,e);if(n.done)return n.value;var i=a(this),r=String(e),l=i.lastIndex;s(l,0)||(i.lastIndex=0);var p=c(i,r);return s(i.lastIndex,l)||(i.lastIndex=l),null===p?-1:p.index}]}))},"862d":function(e,t,o){"use strict";(function(t,o){e.exports=o()})(0,(function(){function e(e){var n=[];return e.AMapUI&&n.push(t(e.AMapUI)),e.Loca&&n.push(o(e.Loca)),Promise.all(n)}function t(e){return new Promise((function(t,o){var c=[];if(e.plugins)for(var r=0;r<e.plugins.length;r+=1)-1==a.AMapUI.plugins.indexOf(e.plugins[r])&&c.push(e.plugins[r]);if(i.AMapUI===n.failed)o("前次请求 AMapUI 失败");else if(i.AMapUI===n.notload){i.AMapUI=n.loading,a.AMapUI.version=e.version||a.AMapUI.version,r=a.AMapUI.version;var l=document.body||document.head,p=document.createElement("script");p.type="text/javascript",p.src="https://webapi.amap.com/ui/"+r+"/main.js",p.onerror=function(e){i.AMapUI=n.failed,o("请求 AMapUI 失败")},p.onload=function(){if(i.AMapUI=n.loaded,c.length)window.AMapUI.loadUI(c,(function(){for(var e=0,o=c.length;e<o;e++){var n=c[e].split("/").slice(-1)[0];window.AMapUI[n]=arguments[e]}for(t();s.AMapUI.length;)s.AMapUI.splice(0,1)[0]()}));else for(t();s.AMapUI.length;)s.AMapUI.splice(0,1)[0]()},l.appendChild(p)}else i.AMapUI===n.loaded?e.version&&e.version!==a.AMapUI.version?o("不允许多个版本 AMapUI 混用"):c.length?window.AMapUI.loadUI(c,(function(){for(var e=0,o=c.length;e<o;e++){var n=c[e].split("/").slice(-1)[0];window.AMapUI[n]=arguments[e]}t()})):t():e.version&&e.version!==a.AMapUI.version?o("不允许多个版本 AMapUI 混用"):s.AMapUI.push((function(e){e?o(e):c.length?window.AMapUI.loadUI(c,(function(){for(var e=0,o=c.length;e<o;e++){var n=c[e].split("/").slice(-1)[0];window.AMapUI[n]=arguments[e]}t()})):t()}))}))}function o(e){return new Promise((function(t,o){if(i.Loca===n.failed)o("前次请求 Loca 失败");else if(i.Loca===n.notload){i.Loca=n.loading,a.Loca.version=e.version||a.Loca.version;var c=a.Loca.version,r=a.AMap.version.startsWith("2"),l=c.startsWith("2");if(r&&!l||!r&&l)o("JSAPI 与 Loca 版本不对应!!");else{r=a.key,l=document.body||document.head;var p=document.createElement("script");p.type="text/javascript",p.src="https://webapi.amap.com/loca?v="+c+"&key="+r,p.onerror=function(e){i.Loca=n.failed,o("请求 AMapUI 失败")},p.onload=function(){for(i.Loca=n.loaded,t();s.Loca.length;)s.Loca.splice(0,1)[0]()},l.appendChild(p)}}else i.Loca===n.loaded?e.version&&e.version!==a.Loca.version?o("不允许多个版本 Loca 混用"):t():e.version&&e.version!==a.Loca.version?o("不允许多个版本 Loca 混用"):s.Loca.push((function(e){e?o(e):o()}))}))}if(!window)throw Error("AMap JSAPI can only be used in Browser.");var n;(function(e){e.notload="notload",e.loading="loading",e.loaded="loaded",e.failed="failed"})(n||(n={}));var a={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},i={AMap:n.notload,AMapUI:n.notload,Loca:n.notload},s={AMap:[],AMapUI:[],Loca:[]},c=[],r=function(e){"function"==typeof e&&(i.AMap===n.loaded?e(window.AMap):c.push(e))};return{load:function(t){return new Promise((function(o,s){if(i.AMap==n.failed)s("");else if(i.AMap==n.notload){var l=t.key,p=t.version,d=t.plugins;l?(window.AMap&&"lbs.amap.com"!==location.host&&s("禁止多种API加载方式混用"),a.key=l,a.AMap.version=p||a.AMap.version,a.AMap.plugins=d||a.AMap.plugins,i.AMap=n.loading,p=document.body||document.head,window.___onAPILoaded=function(a){if(delete window.___onAPILoaded,a)i.AMap=n.failed,s(a);else for(i.AMap=n.loaded,e(t).then((function(){o(window.AMap)}))["catch"](s);c.length;)c.splice(0,1)[0]()},d=document.createElement("script"),d.type="text/javascript",d.src="https://webapi.amap.com/maps?callback=___onAPILoaded&v="+a.AMap.version+"&key="+l+"&plugin="+a.AMap.plugins.join(","),d.onerror=function(e){i.AMap=n.failed,s(e)},p.appendChild(d)):s("请填写key")}else if(i.AMap==n.loaded)if(t.key&&t.key!==a.key)s("多个不一致的 key");else if(t.version&&t.version!==a.AMap.version)s("不允许多个版本 JSAPI 混用");else{if(l=[],t.plugins)for(p=0;p<t.plugins.length;p+=1)-1==a.AMap.plugins.indexOf(t.plugins[p])&&l.push(t.plugins[p]);l.length?window.AMap.plugin(l,(function(){e(t).then((function(){o(window.AMap)}))["catch"](s)})):e(t).then((function(){o(window.AMap)}))["catch"](s)}else if(t.key&&t.key!==a.key)s("多个不一致的 key");else if(t.version&&t.version!==a.AMap.version)s("不允许多个版本 JSAPI 混用");else{var u=[];if(t.plugins)for(p=0;p<t.plugins.length;p+=1)-1==a.AMap.plugins.indexOf(t.plugins[p])&&u.push(t.plugins[p]);r((function(){u.length?window.AMap.plugin(u,(function(){e(t).then((function(){o(window.AMap)}))["catch"](s)})):e(t).then((function(){o(window.AMap)}))["catch"](s)}))}}))},reset:function(){delete window.AMap,delete window.AMapUI,delete window.Loca,a={key:"",AMap:{version:"1.4.15",plugins:[]},AMapUI:{version:"1.1",plugins:[]},Loca:{version:"1.3.2"}},i={AMap:n.notload,AMapUI:n.notload,Loca:n.notload},s={AMap:[],AMapUI:[],Loca:[]}}}}))},c7ca:function(e,t,o){},ddf5:function(e,t,o){"use strict";o("c7ca")}}]);
|