@amap/amap-vue
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("vue"))&&"object"==typeof e&&"default"in e?e.default:e,n={_prefix:"https://webapi.amap.com/maps",_disableMapCache:!1,verbose:!1,version:"1.4.15",key:"",plugins:[]};function o(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}const r=o();let a=!1,i=!1;const s=r.promise;function p(){if(!i){if(i=!0,window.AMap)return r.resolve(window.AMap),s;const e=document.createElement("script"),t=`amap_vue_${Date.now()}_${Math.ceil(1e4*Math.random())}`,o=()=>{a||(a=!0,r.resolve(window.AMap))};window[t]=o;const p=function(e){const t=[];for(const n in e)void 0!==e[n]&&null!==e[n]&&t.push(`${n}=${encodeURIComponent(e[n])}`);return t.join("&")}({v:n.version,key:n.key,callback:t,plugin:n.plugins.join(",")}),l=`${n._prefix}?${p}`;e.src=l,document.body.appendChild(e)}return s}function l(e){return new Promise(t=>{window.AMap.plugin(e,()=>{t()})})}var c=t.extend({inject:["$amapContainer"],computed:{map(){return this.$amapContainer.map}}});function d(e){throw new Error(e)}function u(e,...t){const[n,...o]=t;if(!n)return e;const r=new Set(e);return n.forEach(t=>{r.has(t)||e.push(t)}),u(e,...o)}const m=Object.prototype.hasOwnProperty;function y(e){try{if(e.constructor&&!m.call(e,"constructor")&&!m.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}let t;for(t in e);return void 0===t||m.call(e,t)}function h(e){n.verbose&&console.time(e)}function f(e){n.verbose&&console.timeEnd(e)}function g(e,t,o){n.verbose&&"function"==typeof console[t]&&(e&&e.$options&&e.$options.name&&(o=[`[${e.$options.name}]`,...o]),console[t](...o))}function v(...e){g(this,"warn",e)}function w(...e){g(this,"debug",e)}function b(...e){return t.extend({mixins:e||[]})}function x(e,t){return null!=t&&e instanceof t}function C(e,t,n,o,r){"object"==typeof t&&(n=t.depth,o=t.prototype,r=t.includeNonEnumerable,t=t.circular);let a=[],i=[];return void 0===t&&(t=!0),void 0===n&&(n=1/0),function e(n,s){if(null===n)return null;if(0===s)return n;let p,l;if("object"!=typeof n)return n;if(x(n,Map))p=new Map;else if(x(n,Set))p=new Set;else if(x(n,Promise))p=new Promise((function(t,o){n.then((function(n){t(e(n,s-1))}),(function(t){o(e(t,s-1))}))}));else if(C.__isArray(n))p=[];else if(C.__isRegExp(n))p=new RegExp(n.source,A(n)),n.lastIndex&&(p.lastIndex=n.lastIndex);else if(C.__isDate(n))p=new Date(n.getTime());else if(x(n,Error))p=Object.create(n);else if(void 0===o){if(l=Object.getPrototypeOf(n),x(l,Object))return n;p=Object.create(l)}else p=Object.create(o),l=o;if(t){let e=a.indexOf(n);if(-1!=e)return i[e];a.push(n),i.push(p)}x(n,Map)&&n.forEach((function(t,n){let o=e(n,s-1),r=e(t,s-1);p.set(o,r)})),x(n,Set)&&n.forEach((function(t){let n=e(t,s-1);p.add(n)}));for(let t in n){Object.getOwnPropertyDescriptor(n,t)&&(p[t]=e(n[t],s-1));try{if(void 0===Object.getOwnPropertyDescriptor(n,t).set)continue;p[t]=e(n[t],s-1)}catch(e){if(e instanceof TypeError)continue;if(e instanceof ReferenceError)continue}}if(Object.getOwnPropertySymbols){let t=Object.getOwnPropertySymbols(n);for(let o=0;o<t.length;o++){let a=t[o],i=Object.getOwnPropertyDescriptor(n,a);(!i||i.enumerable||r)&&(p[a]=e(n[a],s-1),Object.defineProperty(p,a,i))}}if(r){let t=Object.getOwnPropertyNames(n);for(let o=0;o<t.length;o++){let r=t[o],a=Object.getOwnPropertyDescriptor(n,r);a&&a.enumerable||(p[r]=e(n[r],s-1),Object.defineProperty(p,r,a))}}return p}(e,n)}function M(e){return Object.prototype.toString.call(e)}function A(e){let t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}function $(e,t){return!(!e&&t)&&(!(e&&!t)&&(e===t||e[0]===t[0]&&e[1]===t[1]))}function E(e,t){return!(!e&&t)&&(!(e&&!t)&&(!e&&!t||(e===t||e.length===t.length&&e.every((e,n)=>$(e,t[n])))))}t.mixin({beforeCreate(){var e;"amapMeta"in this.$options&&(this.$amapLogger=(e=this,{warn:v.bind(e),debug:w.bind(e)}))}}),t.config.optionMergeStrategies.amapMeta=(e,t)=>function e(t,n){const o={...t};for(const r in n){const a=n[r],i=t[r];Array.isArray(a)?o[r]=u(i||[],a):y(a)?o[r]=e(i||{},a):o[r]=a}return o}(e||{},t||{}),C.clonePrototype=function(e){if(null===e)return null;let t=function(){};return t.prototype=e,new t},C.__objToStr=M,C.__isDate=function(e){return"object"==typeof e&&"[object Date]"===M(e)},C.__isArray=function(e){return"object"==typeof e&&"[object Array]"===M(e)},C.__isRegExp=function(e){return"object"==typeof e&&"[object RegExp]"===M(e)},C.__getRegExpFlags=A;function k(e,t,n=1e-7){return Math.abs(e-t)<n}function B(e,t){return!(!e&&t)&&(!(e&&!t)&&(e===t||k(e[0],t[0])&&k(e[1],t[1])))}const O=new WeakMap;function L(e,t){let n=O.get(t);if(!n){n=new Map,O.set(t,n);for(const e in t){const o=t[e];!1!==o.initialize&&n.set(e,o)}}return n.get(e)}function S(e,t,n,o){void 0===t&&(t=e.$options.props),void 0===n&&(n=e.$props);const r={};for(const o in n){const a=n[o];if(void 0===a)continue;const i=L(o,t);i&&(r[o]=i.transform?i.transform.call(e,a):a)}return o?r:C(r)}function P(e){return e.map?e.map:e.component}function j(e){return Array.isArray(e)?[e[0],e[1]]:[e.lng,e.lat]}function _(e){return Array.isArray(e)?e:e.southWest?[[e.southWest.lng,e.southWest.lat],[e.northEast.lng,e.northEast.lat]]:[[e.southwest.lng,e.southwest.lat],[e.northeast.lng,e.northeast.lat]]}function T(e){const t=new window.AMap.LngLat(e[0][0],e[0][1]),n=new window.AMap.LngLat(e[1][0],e[1][1]);return new window.AMap.Bounds(t,n)}function z(e,t,n){const o=e.$amapEvents||(e.$amapEvents={});(o[t]||(o[t]=[])).push(n)}function D(e,t,n){z(e,t,n),P(e.$amapContext).on(t,n)}function R(e){const{events:t=[]}=e.$options.amapMeta,n=P(e.$amapContext);t.forEach(t=>{e.$watch("$listeners."+t,(o,r)=>{r&&n.off(t,r),o&&(z(e,t,o),n.on(t,o))},{immediate:!0})})}function I(e,t,n,o){o||(o=P(e.$amapContext));const{events:r=[]}=n;r.forEach(r=>{const{getter:a}=n;if(!a)return;const i=r=>{const i="function"==typeof a?a.call(e,o,r):o[a](),s=e.$props[t];if("function"==typeof n.equals){if(n.equals(i,s))return}else if(i===s)return;e.$emit("update:"+t,i)};z(e,r,i),o.on(r,i)})}function N(e){const t=P(e.$amapContext),n=e.$amapEvents||{};for(const e in n){n[e].forEach(n=>{t.off(e,n)})}}const q={equals:function(e,t){return e===t},clone:!1};function W(e,t,n,o){const{setter:r}=n;r&&("function"==typeof r?r.call(e,t,o):"string"==typeof r&&(n.clone&&(o=C(o)),t[r](o)))}function F(e,t,n){t||(t=P(e.$amapContext)),n||(n=e.$options.props);for(const o in n){const r=n[o],{setter:a}=r;if(!a)continue;const i={deep:!!r.deep};e.$amapLogger.debug("watch",o,i),e.$watch("$props."+o,(n,o)=>{if(!i.deep||i.deep&&n!==o)if("function"==typeof r.equals){if(r.equals(n,o))return}else if(n===o)return;W(e,t,r,n)},i),r.events&&I(e,o,r,t)}}function Z(e,t,n){if("string"==typeof e){const o=e,r={...q,setter:o};return t&&(r.type=t),arguments.length>=3&&(r.default=n),r}return{...q,...e}}function V(e,t){return function(...n){const o=P(this.$amapContext);return o?"function"!=typeof o[e]?this.$amapLogger.warn(e+" is not a function."):(t&&(n=C(n)),o[e](...n)):this.$amapLogger.warn(`calling ${e} on ${o}`)}}function U(e){return e&&"function"==typeof e.then}function K(e){if(!e)return e;if(U(e))return e;if(e.$amapContext&&e.$amapContext.ready)return e.$amapContext.ready;if(Array.isArray(e))return Promise.all(e.map(K));if(y(e)){const n={},o=Object.keys(e),r=[];function t(e,t){n[t]=void 0,r.push(e.then(e=>{n[t]=e}))}for(let a=0;a<o.length;a++){const i=o[a],s=K(e[i]);s&&U(r)?t(s,i):n[i]=e[i]}return Promise.all(r).then((function(){return n}))}return e}function H(e){return function(t,n){t.setStatus({[e]:n})}}var J,Y=t.extend({name:"Amap",amapMeta:{events:["click","dblclick","rightclick","mapmove","movestart","moveend","hotspotclick","hotspotover","hotspotout","mousemove","mousewheel","mouseover","mouseup","mousedown","zoomchange","zoomstart","zoomend","dragstart","dragging","dragend","resize","touchstart","touchmove","touchend"]},props:{cacheKey:Z({type:String,initialize:!1}),sync:Z({type:Boolean,default:!1,initialize:!1}),showIndoorMap:Z({type:Boolean,default:void 0,setter:H("showIndoorMap")}),resizeEnable:Z({type:Boolean,default:void 0,setter:H("resizeEnable")}),dragEnable:Z({type:Boolean,default:void 0,setter:H("dragEnable")}),pitchEnable:Z({type:Boolean,default:void 0,setter:H("pitchEnable")}),rotateEnable:Z({type:Boolean,default:void 0,setter:H("rotateEnable")}),zoomEnable:Z({type:Boolean,default:void 0,setter:H("zoomEnable")}),doubleClickZoom:Z({type:Boolean,default:void 0,setter:H("doubleClickZoom")}),keyboardEnable:Z({type:Boolean,default:void 0,setter:H("keyboardEnable")}),jogEnable:Z({type:Boolean,default:void 0,setter:H("jogEnable")}),scrollWheel:Z({type:Boolean,default:void 0,setter:H("scrollWheel")}),animateEnable:Z({type:Boolean,default:void 0,setter:H("animateEnable")}),isHotspot:Z({type:Boolean,default:void 0,setter:H("isHotspot")}),touchEnable:Z({type:Boolean,default:void 0,setter:H("touchEnable")}),viewMode:{type:String},showBuildingBlock:{type:Boolean,default:void 0},expandZoomRange:{type:Boolean,default:void 0},zooms:{type:Array},zoom:Z({type:Number,equals:k,setter(e,t){const n=e;void 0!==t&&(k(n.getZoom(),t)||n.setZoom(t))},getter:"getZoom",events:["zoomchange","zoomend"]}),center:Z({type:Array,deep:!0,equals:$,setter(e,t){const n=e;t&&(B(t,j(n.getCenter()))||n.setCenter([t[0],t[1]]))},getter:e=>j(e.getCenter()),events:["mapmove","moveend"]}),pitch:Z({type:Number,equals:k,setter:"setPitch",getter:"getPitch",events:["dragging","dragend","moveend","pitchend"]}),rotation:Z({type:Number,equals:k,setter:"setRotation",getter:"getRotation",events:["dragging","dragend","moveend","rotateend"]}),lang:Z("setLang",String),mapStyle:Z("setMapStyle",String),features:Z("setFeatures",Array),skyColor:{type:String}},data:()=>({ready:!1}),computed:{context(){return this.$amapContext},map(){return this.context.map}},methods:{_clear(){const{context:e}=this;e.ready.then(()=>{N(this),this.clearMap(),this.clearInfoWindow()})},_getContainer(e){const{cacheKey:t}=this;if(!n._disableMapCache&&t){const n="amap-vue-container-inner-"+t;let o=document.getElementById(n)||this.$el.querySelector("#"+n);return o||(o=document.createElement("div"),o.className="amap-vue-container-inner",o.setAttribute("id",n),o.setAttribute("style","position:relative; width:100%; height:100%;")),e?(this.$el.insertAdjacentElement("afterbegin",o),o.style.display="block",o.style.pointerEvents="initial"):(o.style.display="none",o.style.pointerEvents="none"),o}return this.$el},clearMap:V("clearMap"),clearInfoWindow:V("clearInfoWindow"),setCenter:V("setCenter"),setCity:V("setCity"),getBounds(){const e=this.context.map.getBounds();return e.path?e.path.map(e=>[e[0],e[1]]):_(this.context.map.getBounds())},getSize:V("getSize"),getResolution:V("getResolution"),setFitView:(J="setFitView",async function(...e){const t=this.$amapContext;await t.ready;const n=P(t);if(!n)return this.$amapLogger.warn(`calling ${J} on ${n}`);if("function"!=typeof n[J])return this.$amapLogger.warn(J+" is not a function.");const o=e.map(K),r=await Promise.all(o);return t.destroyed?void 0:n[J](...r)}),lngLatToContainer(e){const t=this.map.lngLatToContainer(e);return[t.getX(),t.getY()]}},beforeCreate(){p(),this.$amapReady=o();const e={AMap:null,wrapper:null,ready:this.$amapReady.promise,map:null,vm:this,destroyed:!1};this.$amapContext=e},async mounted(){const{context:e}=this,t=await p();if(e.AMap=t,e.destroyed)return;const n=S(this),o=this._getContainer(!0),r=!!o.$amap;if(r)for(let e in n){const t=this.$options.props[e],r=n[e];W(this,o.$amap,t,r)}else o.$amap=new t.Map(o,n);const a=o.$amap;a.$vm=this,e.wrapper=o,e.map=a,F(this),R(this);const i=()=>{this.ready=!0,this.$amapReady.resolve(a),this.$emit("complete",this)};r?(await this.$nextTick(),i()):a.on("complete",i)},destroyed(){const{context:e}=this;if(!n._disableMapCache&&this.cacheKey){const e=this._getContainer(!1);document.body.appendChild(e),this._clear()}else e.map&&e.map.destroy();e.destroyed=!0},provide(){return{$amapContainer:this.context}},render(e){let t=this.$slots.default;return this.sync||this.ready||(t=void 0),e("div",{class:"amap-vue-container",style:"position:relative; width:100%; height:100%;"},t)}}),G=t.extend({computed:{context(){return this.$amapContext},component(){return this.context.component},map(){return this.context.container.map},wrapper(){return this.context.container.vm},AMap(){return this.context.AMap}}}),X=b(G).extend({inject:["$amapContainer"],amapMeta:{slot:!1,initComponent:d,add(e,t){const n=e;t.setMap(n.map)},remove(e,t){t.setMap(null)}},beforeCreate(){this.$amapReady=o(),this.$amapContext={}},created(){Object.assign(this.$amapContext,{AMap:null,ready:this.$amapReady.promise,container:this.$amapContainer,component:null,destroyed:!1})},async mounted(){const{context:e}=this,t=this.$options.amapMeta,{container:n}=e;await n.ready,e.AMap=n.AMap,t.prepare&&await t.prepare();const o=S(this);if(e.destroyed)return;const r=await t.initComponent.call(this,window.AMap,o);r.$vm=this,e.component=r,t.add.call(this,n,r),F(this),R(this),this.$amapReady.resolve(r),this.$emit("amap-ready",this)},beforeDestroy(){const{context:e}=this,{container:t,component:n}=e;if(n){N(this),this.$options.amapMeta.remove.call(this,t,n)}e.destroyed=!0},render(e){return this.$options.amapMeta.slot&&this.$slots.default?e("div",{class:"amap-vue-placeholder",style:"visibility: hidden; pointer-events: none;"},this.$slots.default):null}}),Q=b(X).extend({amapMeta:{events:["click","dblclick","rightclick","mousemove","mouseover","mouseout","mousedown","mouseup","dragstart","dragging","dragend","moving","moveend","movealong","touchstart","touchmove","touchend"]},props:{visible:Z({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),cursor:Z("setCursor",String),zIndex:Z("setzIndex",Number),bubble:Z("setBubble",Boolean,void 0),clickable:Z("setClickable",Boolean,void 0),draggable:Z("setDraggable",Boolean,void 0),extData:Z("setExtData",Object)},methods:{show:V("show"),hide:V("hide"),getExtData:V("getExtData")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}});const ee=["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"],te=["miter","round","bevel"],ne=["butt","round","square"],oe=["solid","dashed"];var re=b(Q).extend({props:{position:Z({type:Array,deep:!0,equals:$,setter(e,t){if(!t)return;const n=e;B(t,j(n.getPosition()))||n.setPosition([t[0],t[1]])},getter:e=>j(e.getPosition()),events:["dragging","dragend","moving","moveend"]}),topWhenClick:{type:Boolean,default:void 0},animation:Z("setAnimation",String),angle:Z({type:Number,equals:k,setter(e,t){void 0!==t&&e.setAngle(t)},getter:e=>e.getAngle(),events:["moving"]}),autoRotation:{type:Boolean,default:void 0},title:Z("setTitle",String),anchor:Z({type:String,setter:"setAnchor",validator:e=>ee.includes(e)}),offset:Z({type:Array,deep:!0,equals:$,setter(e,t){const n=e;var o;t&&(B(t,(o=n.getOffset(),Array.isArray(o)?[o[0],o[1]]:[o.x,o.y]))||n.setOffset(new window.AMap.Pixel(t[0],t[1])))},transform:e=>new window.AMap.Pixel(e[0],e[1])}),raiseOnDrag:{type:Boolean,default:void 0}},methods:{moveAlong:V("moveAlong",!0),moveTo:V("moveTo",!0),stopMove:V("stopMove")},beforeDestroy(){this.context.component&&this.stopMove()}});function ae(e){if(!e)return;const t={...e};return t.offset&&(t.offset=new window.AMap.Pixel(t.offset[0],t.offset[1])),t}function ie(e){return"string"==typeof e?e:new window.AMap.Icon(e)}var se=b(re).extend({name:"AmapMarker",amapMeta:{slot:!0,async initComponent(e,t){const n={...t};return this.$slots.default&&this.$slots.default.length>0&&(n.content=this.$slots.default[0].elm),new e.Marker(n)}},props:{content:Z("setContent",String),icon:Z({setter(e,t){if(!t)return;const n=e,o=ie(t);n.setIcon(o)},transform:ie}),shadow:Z("setShadow"),shape:Z("setShape"),label:Z({type:Object,setter(e,t){t&&e.setLabel(ae(t))},deep:!0,transform:ae})}}),pe=b(X).extend({name:"AmapLabelsLayer",amapMeta:{slot:!0,initComponent:async(e,t)=>new e.LabelsLayer(t)},props:{visible:Z({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:{type:Number},opacity:{type:Number},collision:{type:Boolean,default:void 0},animation:{type:Boolean,default:void 0}},provide(){return{$amapLabelsLayer:this.context}}}),le=b(X).extend({name:"AmapLabelMarker",inject:["$amapLabelsLayer"],amapMeta:{initComponent:async(e,t)=>new e.LabelMarker(t),async add(e,t){const n=await this.$amapLabelsLayer.ready;this.$amapContext.destroyed||n.add(t)},async remove(e,t){(await this.$amapLabelsLayer.ready).remove(t)}},props:{position:Z({type:Array,deep:!0,equals:$,setter(e,t){const n=e;t&&(B(t,j(n.getPosition()))||n.setPosition([t[0],t[1]]))}}),zooms:Z({type:Array,deep:!0,equals:$,setter:"setZooms"}),opacity:Z("setOpacity",Number),rank:{type:Number},icon:Z({type:Object,setter:"setIcon",deep:!0}),text:Z({type:Object,setter:"setText",deep:!0})}}),ce=b(re).extend({name:"AmapText",amapMeta:{initComponent:async(e,t)=>(t.domStyle&&(t.style=t.domStyle,delete t.domStyle),new e.Text(t))},props:{text:Z("setText",String),domStyle:Z({type:Object,setter(e,t){e.setStyle(t)},deep:!0})}});function de(e){return(t,n)=>{t.setOptions({[e]:n})}}const ue=b(Q).extend({props:{strokeColor:Z({type:String,setter:de("strokeColor")}),strokeOpacity:Z({type:Number,setter:de("strokeOpacity")}),strokeWeight:Z({type:Number,setter:de("strokeWeight")}),strokeStyle:Z({type:String,setter:de("strokeStyle"),validator:e=>oe.includes(e)}),strokeDasharray:Z({type:Array,deep:!0,equals:function(e,t){return!(!e&&t)&&(!(e&&!t)&&(e===t||e.length===t.length&&e.every((e,n)=>e===t[n])))},setter:de("strokeDasharray")})},methods:{getBounds:V("getBounds")}}),me=b(ue).extend({props:{fillColor:Z({type:String,setter:de("fillColor")}),fillOpacity:Z({type:Number,setter:de("fillOpacity")})},methods:{contains:V("contains")}}),ye=b(ue).extend({props:{lineJoin:Z({type:String,setter:de("lineJoin"),validator:e=>te.includes(e)}),lineCap:Z({type:String,setter:de("lineCap"),validator:e=>ne.includes(e)}),showDir:Z({type:Boolean,default:void 0,setter:de("showDir")}),dirColor:Z({type:String,setter:de("dirColor")}),dirImg:Z({type:String,setter:de("dirImg")}),isOutline:Z({type:Boolean,default:void 0,setter:de("isOutline")}),outlineColor:Z({type:String,setter:de("outlineColor")}),borderWeight:Z({type:Number,setter:de("borderWeight")})},methods:{getLength:V("getLength")}});var he=b(me).extend({props:{center:Z({type:Array,clone:!0,deep:!0,equals:$,setter(e,t){if(!t)return;const n=e;if(this.$props.draggable||this.$props.editable){if(B(t,j(n.getCenter())))return}n.setCenter(new window.AMap.LngLat(t[0],t[1]))},getter:e=>j(e.getCenter()),events:["dragging","dragend"]}),radius:Z({type:Number,setter:"setRadius"})}});const fe=b(G).extend({data:()=>({$amapEditor:null}),props:{editable:Z({type:Boolean,default:!1,initialize:!1})},async mounted(){await this.context.ready;const e=this.$options.amapMeta.editable;this.editable&&e.startEditing.call(this)},beforeDestroy(){const e=this.$amapEditor;if(e){this.$options.amapMeta.editable.events.forEach(t=>{e.off(t,this.$onAmapEdit)}),e.close()}},watch:{"$props.editable"(e){const t=this.$options.amapMeta.editable;e?this.context.destroyed||t.startEditing.call(this):t.endEditing.call(this)}}});var ge=b(fe).extend({amapMeta:{editable:{events:[],loadEditor:d,initEditor:d,onEdit:d,async initEditing(){if(this.$amapEditor)return this.$amapEditor;const e=this.$options.amapMeta.editable,{context:t}=this;await t.container.ready,await this.$options.amapMeta.editable.loadEditor();const n=t.container.map,o=t.component,{AMap:r}=this;this.$amapEditor=await e.initEditor.call(this,r,n,o);const a=this.$onAmapEdit=e.onEdit.bind(this);return e.events.forEach(e=>{this.$amapEditor.on(e,a)}),this.$amapEditor},async startEditing(){const e=this.$options.amapMeta.editable;(await e.initEditing.call(this)).open()},endEditing(){this.$amapEditor&&this.$amapEditor.close()}}}}),ve=b(he,ge).extend({name:"AmapCircle",amapMeta:{initComponent:async(e,t)=>new e.Circle(t),editable:{events:["end","move","adjust"],async loadEditor(){await l("AMap.CircleEditor")},async initEditor(e,t,n){return new e.CircleEditor(t,n,this.draggable)},onEdit(e){const{target:t}=e,n=t.getCenter();this.$emit("update:center",[n.lng,n.lat]),this.$emit("update:radius",t.getRadius())}}}}),we=b(he).extend({name:"AmapCircleMarker",amapMeta:{initComponent:async(e,t)=>new e.CircleMarker(t)}}),be=b(ue,ge).extend({amapMeta:{editable:{events:["end","move","adjust"],async loadEditor(){await l("AMap.PolyEditor")},async initEditor(e,t,n){return new e.PolyEditor(t,n,this.draggable)},onEdit(e){const t=e.target.getPath().map(j);this.$emit("update:path",t)}}},props:{path:Z({type:Array,setter(e,t){const n=e;if(this.$props.editable||this.$props.editable){if(E(n.getPath().map(j),t))return}n.setPath(t)},getter:e=>e.getPath().map(j),clone:!0,equals:E,events:["dragging","dragend"]})}}),xe=b(me,be).extend({name:"AmapPolygon",amapMeta:{initComponent:async(e,t)=>new e.Polygon(t)},methods:{getArea:V("getArea")}}),Ce=b(be,ye).extend({name:"AmapPolyline",amapMeta:{initComponent:async(e,t)=>new e.Polyline(t)},props:{geodesic:Z({type:Boolean,default:void 0,setter:de("geodesic")})}});const Me="undefined"!=typeof BigInt64Array;function Ae(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const n=e.length;if(n!=t.length)return!1;for(let o=n;0!=o--;)if(!Ae(e[o],t[o]))return!1;return!0}if(e instanceof Map){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;for(const n of e.entries())if(!Ae(n[1],t.get(n[0])))return!1;return!0}if(e instanceof Set){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;return!0}if(e.constructor.BYTES_PER_ELEMENT&&(e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array||Me&&(e instanceof BigInt64Array||e instanceof BigUint64Array))){const n=e.length;if(n!=t.length)return!1;for(let o=n;0!=o--;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),o=n.length;if(o!==Object.keys(t).length)return!1;for(let e=o;0!=e--;)if(!Object.prototype.hasOwnProperty.call(t,n[e]))return!1;for(let r=o;0!=r--;){const o=n[r];if(!Ae(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function $e(e){if(!e)return;return e.map(e=>{const t=[],n=e.controlPoints;return n&&t.push(...n.map(e=>j(e))),t.push(j(e)),t})}var Ee=b(ye,ge).extend({name:"AmapBezierCurve",amapMeta:{initComponent:async(e,t)=>new e.BezierCurve(t),editable:{events:["end","adjust","addnode","removenode"],async loadEditor(){await l("AMap.BezierCurveEditor")},async initEditor(e,t,n){return new e.BezierCurveEditor(t,n,this.draggable)},onEdit(e){const t=e.target.getPath();this.$emit("update:path",$e(t))}}},props:{path:Z({type:Array,setter(e,t){const n=e;if(this.$props.editable||this.$props.editable){if(Ae($e(n.getPath()),t))return}n.setPath(t)},getter:e=>$e(e.getPath()),clone:!0,equals:Ae,events:["dragging","dragend"]})}});function ke(e,t){return!(!e||!t)&&(k(e[0][0],t[0][0])&&k(e[0][1],t[0][1])&&k(e[1][0],t[1][0])&&k(e[1][1],t[1][1]))}var Be=b(me,ge).extend({name:"AmapRectangle",amapMeta:{initComponent:async(e,t)=>new e.Rectangle(t),editable:{events:["move","end","adjust"],async loadEditor(){await l("AMap.RectangleEditor")},async initEditor(e,t,n){return new e.RectangleEditor(t,n,this.draggable)},onEdit(e){const t=_(e.target.getBounds());this.$emit("update:bounds",t)}}},props:{bounds:Z({type:Array,deep:!0,setter(e,t){if(this.$props.editable||this.$props.draggable){if(ke(_(e.getBounds()),t))return}e.setBounds(T(t))},getter:e=>_(e.getBounds()),transform:T,clone:!0,equals:ke,events:["dragging","dragend"]})},methods:{getArea:V("getArea")}}),Oe=b(me,ge).extend({name:"AmapEllipse",amapMeta:{initComponent:async(e,t)=>new e.Ellipse(t),editable:{events:["move","end","adjust"],async loadEditor(){await l("AMap.EllipseEditor")},async initEditor(e,t,n){return new e.EllipseEditor(t,n,this.draggable)},onEdit(e){const t=j(e.target.getCenter());B(this.center,t)||this.$emit("update:center",t);const n=e.target.getRadius();B(this.radius,n)||this.$emit("update:radius",n.slice(0))}}},props:{center:Z({type:Array,setter(e,t){if(this.$props.editable||this.$props.draggable){if(B(t,j(e.getCenter())))return}e.setCenter(t)},getter:e=>j(e.getCenter()),clone:!0,deep:!0,equals:B,events:["dragging","dragend"]}),radius:Z({type:Array,setter(e,t){const n=e;if(this.$props.editable){if(B(t,n.getRadius()))return}n.setRadius(t)},clone:!0,deep:!0,equals:B})},methods:{getBounds(){return _(this.context.component.getBounds())}}}),Le=b(Q).extend({name:"AmapInfoWindow",amapMeta:{slot:!0,initComponent:async(e,t)=>new e.InfoWindow(t),events:["change","open","close"]},props:{isCustom:{type:Boolean,default:void 0},autoMove:{type:Boolean,default:void 0},closeWhenClickMap:{type:Boolean,default:void 0},visible:Z({type:Boolean,default:!0,setter(e,t){t?this.open():this.close()}}),position:Z({type:Array,deep:!0,setter(e,t){const n=e;if(!t)return;const o=n.getPosition();o&&B(t,j(o))||n.setPosition([t[0],t[1]])},getter:e=>j(e.getPosition()),equals:$}),offset:Z({type:Array,transform:e=>new window.AMap.Pixel(e[0],e[1])}),anchor:Z({type:String,setter:"setAnchor",validator:e=>ee.includes(e)}),showShadow:{type:Boolean,default:void 0}},methods:{open(){this.context.ready.then(e=>{const t=e,n=this.position;t.open(this.context.container.map,n)})},close(){this.context.ready.then(e=>{e.close()})},show(){this.open()},hide(){this.close()},onOpen(){this.visible||this.$emit("update:visible",!0)},onClose(){this.visible&&this.$emit("update:visible",!1)},_updateContent(){this.visible&&this.$nextTick(()=>{const e=this.$slots.default[0];e&&e.elm&&this.context.ready.then(t=>{t.setContent(e.elm)})})}},async mounted(){const e=await this.context.ready;this.visible&&(this._updateContent(),this.open()),e.on("open",this.onOpen),e.on("close",this.onClose)},watch:{visible:"_updateContent"}}),Se=b(X).extend({amapMeta:{events:["complete"]},props:{visible:Z({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:Z("setzIndex",Number),opacity:Z({setter:"setOpacity",type:Number}),zooms:Z({type:Array}),detectRetina:Z({type:Boolean,default:void 0})},methods:{show:V("show"),hide:V("hide"),reload:V("reload")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}}),Pe=b(Se).extend({name:"AmapTileLayer",amapMeta:{initComponent:async(e,t)=>new e.TileLayer(t)},props:{tileSize:Z({type:Number}),tileUrl:Z({type:String,setter:"setTileUrl"}),errorUrl:{type:String},getTileUrl:{type:[String,Function]}}}),je=b(Se).extend({name:"AmapTileLayerSatellite",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.Satellite(t)}}),_e=b(Se).extend({name:"AmapTileLayerFlexible",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.Flexible(t)},props:{createTile:{type:Function},cacheSize:{type:Number}}}),Te=b(Se).extend({name:"AmapTileLayerRoadNet",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.RoadNet(t)}}),ze=b(Se).extend({name:"AmapTileLayerTraffic",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.Traffic(t)}});const De=["LT","RT","LB","RB"];var Re=b(X).extend({amapMeta:{add(e,t){e.map.addControl(t)},remove(e,t){e.map.removeControl(t)}}}),Ie=b(Re).extend({name:"AmapMapType",amapMeta:{prepare:()=>l("AMap.MapType"),initComponent:async(e,t)=>new e.MapType(t)},props:{defaultType:{type:Number},showTraffic:{type:Boolean,default:void 0},showRoad:{type:Boolean,default:void 0}}}),Ne=b(Re).extend({name:"AmapControlBar",amapMeta:{prepare:()=>l("AMap.ControlBar"),initComponent:async(e,t)=>new e.ControlBar(t)},props:{position:{type:Object},showZoomBar:{type:Boolean,default:void 0},showControlButton:{type:Boolean,default:void 0}}}),qe=b(Re).extend({name:"AmapOverView",amapMeta:{prepare:()=>l("AMap.OverView"),initComponent:async(e,t)=>new e.OverView(t)},props:{visible:Z({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),isOpen:Z({type:Boolean,default:void 0,setter(e,t){const n=e;t?n.open():n.close()}}),tileLayer:Z("setTileLayer")},methods:{show:V("show"),hide:V("hide"),open:V("open"),close:V("close")},async mounted(){await this.context.ready,D(this,"open",()=>{this.$emit("update:is-open",!0)}),D(this,"close",()=>{this.$emit("update:is-open",!1)})}}),We=b(Re).extend({name:"AmapScale",amapMeta:{prepare:()=>l("AMap.Scale"),initComponent:async(e,t)=>new e.Scale(t)},props:{position:Z({type:String,validator:e=>De.includes(e)}),visible:Z({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),offset:Z({type:Array,transform:e=>new window.AMap.Pixel(e[0],e[1])})},methods:{show:V("show"),hide:V("hide"),setPosition:V("position"),setOffset(e){this.context.component.setOffset(new window.AMap.Pixel(e[0],e[1]))}}});function Fe(e){return function(t,n){if(void 0===n)return;t[`${n?"show":"hide"}${e}`]()}}var Ze=b(Re).extend({name:"AmapToolBar",amapMeta:{prepare:()=>l("AMap.ToolBar"),initComponent:async(e,t)=>new e.ToolBar(t),events:["location","zoomchanged"]},props:{visible:Z({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),position:{type:String,validator:e=>De.includes(e)},ruler:Z({type:Boolean,default:void 0,setter:Fe("Ruler")}),direction:Z({type:Boolean,default:void 0,setter:Fe("Direction")}),locate:Z({type:Boolean,default:void 0,setter:Fe("Location")}),noIpLocale:{type:Boolean,default:void 0},liteStyle:{type:Boolean,default:void 0},autoPosition:{type:Boolean,default:void 0}},methods:{show:V("show"),hide:V("hide"),doLocation:V("doLocation"),getLocation(){const e=this.context.component.getLocation();if(e)return j(e)}}});function Ve(e,t,n){if(!e)return n;var o,r;if(Array.isArray(t)&&(o=t.slice(0)),"string"==typeof t&&(o=t.split(".")),"symbol"==typeof t&&(o=[t]),!Array.isArray(o))throw new Error("props arg must be an array, a string or a symbol");for(;o.length;){if(r=o.shift(),!e)return n;if(void 0===(e=e[r]))return n}return e}const Ue=se.sealedOptions,Ke=t.extend({props:Ue.props});let He=void 0;function Je(e,t){He||(He=document.createElement("div"));const n=e;return n._props=t,n._vnode=null,n.$mount(He),n._vnode.elm}function Ye(e,t,n){const o=e[t];Array.isArray(o)&&(e[t]=new n(o[0],o[1]))}function Ge(e){return e&&0!==e.length?e.map(e=>{const t={...e};return Ye(t,"size",window.AMap.Size),Ye(t,"offset",window.AMap.Pixel),Ye(t,"imageOffset",window.AMap.Pixel),t}):e}var Xe=b(X).extend({name:"AmapMarkerCluster",amapMeta:{prepare:()=>l("AMap.MarkerClusterer"),async initComponent(e,t){return this.$scopedSlots.cluster&&(t.renderClusterMarker=this._renderCluster),new e.MarkerClusterer(this.map,[],t)},events:["click"]},data:()=>({_mcc:null}),props:{data:Z({type:Array,required:!0,initialize:!1}),keyProp:Z({type:[String,Function],default:"key",initialize:!1}),positionProp:Z({type:[String,Function],default:"position",initialize:!1}),gridSize:Z("setGridSize",Number),minClusterSize:Z("setMinClusterSize",Number),maxZoom:Z("setMaxZoom",Number),averageCenter:Z({type:Boolean,default:void 0,setter:"setAverageCenter"}),styles:Z({type:Array,setter(e,t){e.setStyles(Ge(t))},transform:Ge}),zoomOnClick:Z({type:Boolean,default:void 0}),markerOptions:Z({type:Function,initialize:!1}),clusterOptions:Z({type:Function,initialize:!1})},mounted(){const e=function(e,t,n){let o,r,a,i,s;function p(){var l=Date.now()-i;l<t&&l>=0?o=setTimeout(p,t-l):(o=null,n||(s=e.apply(a,r),a=r=null))}null==t&&(t=100);var l=function(...l){a=this,r=l,i=Date.now();var c=n&&!o;return o||(o=setTimeout(p,t)),c&&(s=e.apply(a,r),a=r=null),s};return l.clear=function(){o&&(clearTimeout(o),o=null)},l.flush=function(){o&&(s=e.apply(a,r),a=r=null,clearTimeout(o),o=null)},l}(this._onDataChange,100),n=this.$scopedSlots.marker,o=this.$scopedSlots.cluster;this.context.ready.then(()=>{this._onDataChange()}),this._mcc={markers:new Map,clusters:new Map,MarkerRenderer:t.extend({name:"AmapMarkerClusterMarkerRenderer",props:{point:{type:Object}},render(){if(!n)return null;return Ve(n(this.point),"0",null)}}),ClusterRenderer:t.extend({name:"AmapMarkerClusterClusterRenderer",props:{context:{type:Object}},render(){if(!o)return null;return Ve(o(this.context),"0",null)}}),dummy:new Ke},this._mcc.marker=new this._mcc.MarkerRenderer,this._mcc.cluster=new this._mcc.ClusterRenderer,this.$watch("data",{handler:e})},beforeDestroy(){this._mcc.markers.clear()},methods:{_getKey(e,t){const{keyProp:n}=this;return n&&("$index"!==n||"$index"in e)?"function"==typeof n?n(e):e[n]:t},_getPosition(e){const{positionProp:t}=this;return"function"==typeof t?t(e):e[t]},async _onDataChange(){const{data:e}=this;if(await this.context.ready,this.context.destroyed)return;h("Render Markers");const t=e.map((e,t)=>this._getMarker(e,t));f("Render Markers"),h("Set Markers"),this.component.setMarkers(t),f("Set Markers")},_renderMarkerContent(e){if(this.$scopedSlots.marker)return Je(this._mcc.marker,{point:e})},_getMarker(e,t){const n=this._getKey(e,t),o=this._mcc.markers;if(o.has(n))return o.get(n);const r={};this.positionProp&&(r.position=this._getPosition(e)),"function"==typeof this.markerOptions&&Object.assign(r,this.markerOptions(e));const a=S(this,Ue.props,r,!0),i=this._renderMarkerContent(e);i&&(a.content=i);const s=new window.AMap.Marker(a);return o.set(n,s),s},_renderCluster(e){const t=Je(this._mcc.cluster,{context:e});e.marker.setContent(t);const n={};"function"==typeof this.clusterOptions&&Object.assign(n,this.clusterOptions(e));const o=Object.keys(n);if(o.length>0){const{dummy:t}=this._mcc;for(let r=0;r<o.length;++r){const a=o[r],i=n[a],s=Ue.props[a];void 0!==s&&W(t,e.marker,s,i)}}}},render:e=>null});const Qe=se.sealedOptions,et=Ce.sealedOptions,tt=xe.sealedOptions,nt=Be.sealedOptions,ot=ve.sealedOptions;var rt=b(X).extend({amapMeta:{prepare:()=>l("AMap.MouseTool"),async initComponent(e){return new e.MouseTool(this.map)},add(){},remove(){}},props:{mode:Z({type:String,default:"none"}),clearWhenClose:{type:Boolean,default:!0},options:{type:Object}},data:()=>({drawingMode:void 0}),methods:{close(e){this.component.close(e)},draw(){if(this.mode===this.drawingMode)return;const{mode:e}=this,t=this.component;switch(e){case"none":this.close(this.clearWhenClose);break;case"marker":t.marker(S(this,Qe.props,this.options||{}));break;case"polyline":t.polyline(S(this,et.props,this.options||{}));break;case"polygon":t.polygon(S(this,tt.props,this.options||{}));break;case"rectangle":t.rectangle(S(this,nt.props,this.options||{}));break;case"circle":t.circle(S(this,ot.props,this.options||{}));break;case"rule":t.rule(S(this,tt.props,this.options||{}));break;case"measureArea":t.measureArea(S(this,tt.props,this.options||{}));break;case"rectZoomIn":t.rectZoomIn(S(this,tt.props,this.options||{}));break;case"rectZoomOut":t.rectZoomOut(S(this,tt.props,this.options||{}))}this.drawingMode=e},_onDraw(e){if(this.mode!==this.drawingMode)return this.close(!0),void this.draw();const t=e.obj,n=this.drawingMode;let o=t;switch(n){case"marker":o=j(t.getPosition());break;case"polyline":case"polygon":o=t.getPath().map(e=>j(e));break;case"rectangle":o=_(t.getBounds());break;case"circle":o={center:j(t.getCenter()),radius:t.getRadius()};break;case"rule":o={path:t.getPath().map(e=>j(e)),length:t.getLength()};break;case"measureArea":o={path:t.getPath().map(e=>j(e)),area:t.getArea()}}this.$emit("draw",n,o),this.$emit("update:mode","none")}},async mounted(){if(await this.context.ready,this.context.destroyed)return;this.component.on("draw",this._onDraw),this.$watch("mode",async e=>{"none"!==e&&"none"!==this.drawingMode&&this.close(!0),this.draw()},{immediate:!0})}}),at=b(X).extend({amapMeta:{events:["complete"]},props:{visible:Z({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:Z("setzIndex",Number),opacity:Z({setter:"setOpacity",type:Number}),zooms:Z({type:Array})},methods:{show:V("show"),hide:V("hide")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}}),it=b(at).extend({name:"AmapImageLayer",amapMeta:{initComponent:async(e,t)=>new e.ImageLayer(t)},props:{bounds:Z({type:Array,transform:T,deep:!0,setter(e,t){e.setBounds(T(t))}}),url:Z({type:String,setter:"setImageUrl"})},methods:{getElement:V("getElement")}}),st=b(at).extend({name:"AmapVideoLayer",amapMeta:{initComponent:async(e,t)=>new e.VideoLayer(t)},props:{autoplay:{type:Boolean},loop:{type:Boolean},bounds:Z({type:Array,transform:T}),url:Z({type:[String,Array],setter:"setVideoUrl"})},methods:{getElement:V("getElement")}}),pt=b(at).extend({name:"AmapCanvasLayer",amapMeta:{slot:!0,async initComponent(e,t){const n=Ve(this,"$slots.default.0.elm");if(!n||"CANVAS"!==n.tagName)throw this.$amapLogger.warn("slot内容必须是canvas"),new Error;return t.canvas=n,new e.CanvasLayer(t)}},props:{bounds:Z({type:Array,transform:T})},methods:{reFresh:V("reFresh")}}),lt=b(at).extend({name:"AmapCustomLayer",amapMeta:{slot:!0,async initComponent(e,t){const n=Ve(this,"$slots.default.0.elm",null),o=new e.CustomLayer(n,t);return this.render&&(o.render=this.render),o}},props:{render:Z({type:Function,setter(e,t){e.render=t}})}}),ct=b(X).extend({amapMeta:{events:["complete"]},props:{visible:Z({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:Z("setzIndex",Number),opacity:Z({setter:"setOpacity",type:Number})},methods:{show:V("show"),hide:V("hide")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}}),dt=b(ct).extend({name:"AmapDistrictLayerWorld",amapMeta:{prepare:()=>l("AMap.DistrictLayer"),initComponent:async(e,t)=>new e.DistrictLayer.World(t)},props:{styles:Z({type:Object,setter:"setStyles"})},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}}),ut=b(ct).extend({name:"AmapDistrictLayerCountry",amapMeta:{prepare:()=>l("AMap.DistrictLayer"),initComponent:async(e,t)=>("soc"in t&&(t.SOC=t.soc,delete t.soc),new e.DistrictLayer.Country(t))},props:{styles:Z({type:Object,setter:"setStyles"}),soc:Z({type:String,setter:"setSOC"}),depth:{type:Number}},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}}),mt=b(ct).extend({name:"AmapDistrictLayerProvince",amapMeta:{prepare:()=>l("AMap.DistrictLayer"),initComponent:async(e,t)=>("soc"in t&&(t.SOC=t.soc,delete t.soc),new e.DistrictLayer.Province(t))},props:{styles:Z({type:Object,setter:"setStyles"}),depth:{type:Number},adcode:Z({type:Array})},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}}),yt={install(e){e.component("amap",Y),e.component("amap-marker",se),e.component("amap-labels-layer",pe),e.component("amap-label-marker",le),e.component("amap-text",ce),e.component("amap-circle",ve),e.component("amap-circle-marker",we),e.component("amap-polygon",xe),e.component("amap-polyline",Ce),e.component("amap-bezier-curve",Ee),e.component("amap-rectangle",Be),e.component("amap-ellipse",Oe),e.component("amap-info-window",Le),e.component("amap-tile-layer",Pe),e.component("amap-tile-layer-satellite",je),e.component("amap-tile-layer-road-net",Te),e.component("amap-tile-layer-traffic",ze),e.component("amap-tile-layer-flexible",_e),e.component("amap-map-type",Ie),e.component("amap-control-bar",Ne),e.component("amap-over-view",qe),e.component("amap-scale",We),e.component("amap-tool-bar",Ze),e.component("amap-marker-clusterer",Xe),e.component("amap-mouse-tool",rt),e.component("amap-image-layer",it),e.component("amap-video-layer",st),e.component("amap-canvas-layer",pt),e.component("amap-custom-layer",lt),e.component("amap-district-layer-world",dt),e.component("amap-district-layer-country",ut),e.component("amap-district-layer-province",mt)},config:n,loadAMap:p,loadPlugins:l,withAmap:c,Amap:Y,Marker:se,LabelsLayer:pe,LabelMarker:le,Text:ce,Circle:ve,CircleMarker:we,Polygon:xe,Polyline:Ce,BezierCurve:Ee,Rectangle:Be,Ellipse:Oe,InfoWindow:Le,TileLayer:Pe,Satellite:je,Flexible:_e,RoadNet:Te,Traffic:ze,MapType:Ie,ControlBar:Ne,OverView:qe,Scale:We,ToolBar:Ze,MarkerClusterer:Xe,MouseTool:rt,ImageLayer:it,VideoLayer:st,CanvasLayer:pt,CustomLayer:lt,DistrictLayerWorld:dt,DistrictLayerCountry:ut,DistrictLayerProvince:mt};exports.Amap=Y,exports.BezierCurve=Ee,exports.CanvasLayer=pt,exports.Circle=ve,exports.CircleMarker=we,exports.ControlBar=Ne,exports.CustomLayer=lt,exports.DistrictLayerCountry=ut,exports.DistrictLayerProvince=mt,exports.DistrictLayerWorld=dt,exports.Ellipse=Oe,exports.Flexible=_e,exports.ImageLayer=it,exports.InfoWindow=Le,exports.LabelMarker=le,exports.LabelsLayer=pe,exports.MapType=Ie,exports.Marker=se,exports.MarkerClusterer=Xe,exports.MouseTool=rt,exports.OverView=qe,exports.Polygon=xe,exports.Polyline=Ce,exports.Rectangle=Be,exports.RoadNet=Te,exports.Satellite=je,exports.Scale=We,exports.Text=ce,exports.TileLayer=Pe,exports.ToolBar=Ze,exports.Traffic=ze,exports.VideoLayer=st,exports.config=n,exports.default=yt,exports.loadAMap=p,exports.loadPlugins=l,exports.withAmap=c; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t=(e=require("vue"))&&"object"==typeof e&&"default"in e?e.default:e,n={_prefix:"https://webapi.amap.com/maps",_disableMapCache:!1,verbose:!1,version:"1.4.15",key:"",plugins:[]};function o(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}const r=o();let a=!1,i=!1;const s=r.promise;function p(){if(!i){if(i=!0,window.AMap)return r.resolve(window.AMap),s;const e=document.createElement("script"),t=`amap_vue_${Date.now()}_${Math.ceil(1e4*Math.random())}`,o=()=>{a||(a=!0,r.resolve(window.AMap))};window[t]=o;const p=function(e){const t=[];for(const n in e)void 0!==e[n]&&null!==e[n]&&t.push(`${n}=${encodeURIComponent(e[n])}`);return t.join("&")}({v:n.version,key:n.key,callback:t,plugin:n.plugins.join(",")}),l=`${n._prefix}?${p}`;e.src=l,document.body.appendChild(e)}return s}function l(e){return new Promise(t=>{window.AMap.plugin(e,()=>{t()})})}var c=t.extend({inject:["$amapContainer"],computed:{map(){return this.$amapContainer.map}}});function d(e){throw new Error(e)}function u(e,...t){const[n,...o]=t;if(!n)return e;const r=new Set(e);return n.forEach(t=>{r.has(t)||e.push(t)}),u(e,...o)}const m=Object.prototype.hasOwnProperty;function y(e){try{if(e.constructor&&!m.call(e,"constructor")&&!m.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}let t;for(t in e);return void 0===t||m.call(e,t)}function h(e){n.verbose&&console.time(e)}function f(e){n.verbose&&console.timeEnd(e)}function g(e,t,o){n.verbose&&"function"==typeof console[t]&&(e&&e.$options&&e.$options.name&&(o=[`[${e.$options.name}]`,...o]),console[t](...o))}function v(...e){g(this,"warn",e)}function w(...e){g(this,"debug",e)}function b(...e){return t.extend({mixins:e||[]})}function x(e,t){return null!=t&&e instanceof t}function C(e,t,n,o,r){"object"==typeof t&&(n=t.depth,o=t.prototype,r=t.includeNonEnumerable,t=t.circular);let a=[],i=[];return void 0===t&&(t=!0),void 0===n&&(n=1/0),function e(n,s){if(null===n)return null;if(0===s)return n;let p,l;if("object"!=typeof n)return n;if(x(n,Map))p=new Map;else if(x(n,Set))p=new Set;else if(x(n,Promise))p=new Promise((function(t,o){n.then((function(n){t(e(n,s-1))}),(function(t){o(e(t,s-1))}))}));else if(C.__isArray(n))p=[];else if(C.__isRegExp(n))p=new RegExp(n.source,A(n)),n.lastIndex&&(p.lastIndex=n.lastIndex);else if(C.__isDate(n))p=new Date(n.getTime());else if(x(n,Error))p=Object.create(n);else if(void 0===o){if(l=Object.getPrototypeOf(n),x(l,Object))return n;p=Object.create(l)}else p=Object.create(o),l=o;if(t){let e=a.indexOf(n);if(-1!=e)return i[e];a.push(n),i.push(p)}x(n,Map)&&n.forEach((function(t,n){let o=e(n,s-1),r=e(t,s-1);p.set(o,r)})),x(n,Set)&&n.forEach((function(t){let n=e(t,s-1);p.add(n)}));for(let t in n){Object.getOwnPropertyDescriptor(n,t)&&(p[t]=e(n[t],s-1));try{if(void 0===Object.getOwnPropertyDescriptor(n,t).set)continue;p[t]=e(n[t],s-1)}catch(e){if(e instanceof TypeError)continue;if(e instanceof ReferenceError)continue}}if(Object.getOwnPropertySymbols){let t=Object.getOwnPropertySymbols(n);for(let o=0;o<t.length;o++){let a=t[o],i=Object.getOwnPropertyDescriptor(n,a);(!i||i.enumerable||r)&&(p[a]=e(n[a],s-1),Object.defineProperty(p,a,i))}}if(r){let t=Object.getOwnPropertyNames(n);for(let o=0;o<t.length;o++){let r=t[o],a=Object.getOwnPropertyDescriptor(n,r);a&&a.enumerable||(p[r]=e(n[r],s-1),Object.defineProperty(p,r,a))}}return p}(e,n)}function M(e){return Object.prototype.toString.call(e)}function A(e){let t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}function $(e,t){return!(!e&&t)&&(!(e&&!t)&&(e===t||e[0]===t[0]&&e[1]===t[1]))}function E(e,t){return!(!e&&t)&&(!(e&&!t)&&(!e&&!t||(e===t||e.length===t.length&&e.every((e,n)=>$(e,t[n])))))}t.mixin({beforeCreate(){var e;"amapMeta"in this.$options&&(this.$amapLogger=(e=this,{warn:v.bind(e),debug:w.bind(e)}))}}),t.config.optionMergeStrategies.amapMeta=(e,t)=>function e(t,n){const o={...t};for(const r in n){const a=n[r],i=t[r];Array.isArray(a)?o[r]=u(i||[],a):y(a)?o[r]=e(i||{},a):o[r]=a}return o}(e||{},t||{}),C.clonePrototype=function(e){if(null===e)return null;let t=function(){};return t.prototype=e,new t},C.__objToStr=M,C.__isDate=function(e){return"object"==typeof e&&"[object Date]"===M(e)},C.__isArray=function(e){return"object"==typeof e&&"[object Array]"===M(e)},C.__isRegExp=function(e){return"object"==typeof e&&"[object RegExp]"===M(e)},C.__getRegExpFlags=A;function k(e,t,n=1e-7){return Math.abs(e-t)<n}function B(e,t){return!(!e&&t)&&(!(e&&!t)&&(e===t||k(e[0],t[0])&&k(e[1],t[1])))}const O=new WeakMap;function L(e,t){let n=O.get(t);if(!n){n=new Map,O.set(t,n);for(const e in t){const o=t[e];!1!==o.initialize&&n.set(e,o)}}return n.get(e)}function S(e,t,n,o){void 0===t&&(t=e.$options.props),void 0===n&&(n=e.$props);const r={};for(const o in n){const a=n[o];if(void 0===a)continue;const i=L(o,t);i&&(r[o]=i.transform?i.transform.call(e,a):a)}return o?r:C(r)}function P(e){return e.map?e.map:e.component}function j(e){return Array.isArray(e)?[e[0],e[1]]:[e.lng,e.lat]}function _(e){return Array.isArray(e)?e:e.southWest?[[e.southWest.lng,e.southWest.lat],[e.northEast.lng,e.northEast.lat]]:[[e.southwest.lng,e.southwest.lat],[e.northeast.lng,e.northeast.lat]]}function T(e){const t=new window.AMap.LngLat(e[0][0],e[0][1]),n=new window.AMap.LngLat(e[1][0],e[1][1]);return new window.AMap.Bounds(t,n)}function z(e,t,n){const o=e.$amapEvents||(e.$amapEvents={});(o[t]||(o[t]=[])).push(n)}function D(e,t,n){z(e,t,n),P(e.$amapContext).on(t,n)}function R(e){const{events:t=[]}=e.$options.amapMeta,n=P(e.$amapContext);t.forEach(t=>{e.$watch("$listeners."+t,(o,r)=>{r&&n.off(t,r),o&&(z(e,t,o),n.on(t,o))},{immediate:!0})})}function I(e,t,n,o){o||(o=P(e.$amapContext));const{events:r=[]}=n;r.forEach(r=>{const{getter:a}=n;if(!a)return;const i=r=>{const i="function"==typeof a?a.call(e,o,r):o[a](),s=e.$props[t];if("function"==typeof n.equals){if(n.equals(i,s))return}else if(i===s)return;e.$emit("update:"+t,i)};z(e,r,i),o.on(r,i)})}function N(e){const t=P(e.$amapContext),n=e.$amapEvents||{};for(const e in n){n[e].forEach(n=>{t.off(e,n)})}}const q={equals:function(e,t){return e===t},clone:!1};function W(e,t,n,o){const{setter:r}=n;r&&("function"==typeof r?r.call(e,t,o):"string"==typeof r&&(n.clone&&(o=C(o)),t[r](o)))}function F(e,t,n){t||(t=P(e.$amapContext)),n||(n=e.$options.props);for(const o in n){const r=n[o],{setter:a}=r;if(!a)continue;const i={deep:!!r.deep};e.$amapLogger.debug("watch",o,i),e.$watch("$props."+o,(n,o)=>{if(!i.deep||i.deep&&n!==o)if("function"==typeof r.equals){if(r.equals(n,o))return}else if(n===o)return;W(e,t,r,n)},i),r.events&&I(e,o,r,t)}}function Z(e,t,n){if("string"==typeof e){const o=e,r={...q,setter:o};return t&&(r.type=t),arguments.length>=3&&(r.default=n),r}return{...q,...e}}function V(e,t){return function(...n){const o=P(this.$amapContext);return o?"function"!=typeof o[e]?this.$amapLogger.warn(e+" is not a function."):(t&&(n=C(n)),o[e](...n)):this.$amapLogger.warn(`calling ${e} on ${o}`)}}function U(e){return e&&"function"==typeof e.then}function K(e){if(!e)return e;if(U(e))return e;if(e.$amapContext&&e.$amapContext.ready)return e.$amapContext.ready;if(Array.isArray(e))return Promise.all(e.map(K));if(y(e)){const n={},o=Object.keys(e),r=[];function t(e,t){n[t]=void 0,r.push(e.then(e=>{n[t]=e}))}for(let a=0;a<o.length;a++){const i=o[a],s=K(e[i]);s&&U(r)?t(s,i):n[i]=e[i]}return Promise.all(r).then((function(){return n}))}return e}function H(e){return function(t,n){t.setStatus({[e]:n})}}var J,Y=t.extend({name:"Amap",amapMeta:{events:["click","dblclick","rightclick","mapmove","movestart","moveend","hotspotclick","hotspotover","hotspotout","mousemove","mousewheel","mouseover","mouseup","mousedown","zoomchange","zoomstart","zoomend","dragstart","dragging","dragend","resize","touchstart","touchmove","touchend"]},props:{cacheKey:Z({type:String,initialize:!1}),sync:Z({type:Boolean,default:!1,initialize:!1}),showIndoorMap:Z({type:Boolean,default:void 0,setter:H("showIndoorMap")}),resizeEnable:Z({type:Boolean,default:void 0,setter:H("resizeEnable")}),dragEnable:Z({type:Boolean,default:void 0,setter:H("dragEnable")}),pitchEnable:Z({type:Boolean,default:void 0,setter:H("pitchEnable")}),rotateEnable:Z({type:Boolean,default:void 0,setter:H("rotateEnable")}),zoomEnable:Z({type:Boolean,default:void 0,setter:H("zoomEnable")}),doubleClickZoom:Z({type:Boolean,default:void 0,setter:H("doubleClickZoom")}),keyboardEnable:Z({type:Boolean,default:void 0,setter:H("keyboardEnable")}),jogEnable:Z({type:Boolean,default:void 0,setter:H("jogEnable")}),scrollWheel:Z({type:Boolean,default:void 0,setter:H("scrollWheel")}),animateEnable:Z({type:Boolean,default:void 0,setter:H("animateEnable")}),isHotspot:Z({type:Boolean,default:void 0,setter:H("isHotspot")}),touchEnable:Z({type:Boolean,default:void 0,setter:H("touchEnable")}),viewMode:{type:String},showBuildingBlock:{type:Boolean,default:void 0},expandZoomRange:{type:Boolean,default:void 0},zooms:{type:Array},zoom:Z({type:Number,equals:k,setter(e,t){const n=e;void 0!==t&&(k(n.getZoom(),t)||n.setZoom(t))},getter:"getZoom",events:["zoomchange","zoomend"]}),center:Z({type:Array,deep:!0,equals:$,setter(e,t){const n=e;t&&(B(t,j(n.getCenter()))||n.setCenter([t[0],t[1]]))},getter:e=>j(e.getCenter()),events:["mapmove","moveend"]}),pitch:Z({type:Number,equals:k,setter:"setPitch",getter:"getPitch",events:["dragging","dragend","moveend","pitchend"]}),rotation:Z({type:Number,equals:k,setter:"setRotation",getter:"getRotation",events:["dragging","dragend","moveend","rotateend"]}),lang:Z("setLang",String),mapStyle:Z("setMapStyle",String),features:Z("setFeatures",Array),skyColor:{type:String}},data:()=>({ready:!1}),computed:{context(){return this.$amapContext},map(){return this.context.map}},methods:{_clear(){const{context:e}=this;e.ready.then(()=>{N(this),this.clearMap(),this.clearInfoWindow()})},_getContainer(e){const{cacheKey:t}=this;if(!n._disableMapCache&&t){const n="amap-vue-container-inner-"+t;let o=document.getElementById(n)||this.$el.querySelector("#"+n);return o||(o=document.createElement("div"),o.className="amap-vue-container-inner",o.setAttribute("id",n),o.setAttribute("style","position:relative; width:100%; height:100%;")),e?(this.$el.insertAdjacentElement("afterbegin",o),o.style.display="block",o.style.pointerEvents="initial"):(o.style.display="none",o.style.pointerEvents="none"),o}return this.$el},clearMap:V("clearMap"),clearInfoWindow:V("clearInfoWindow"),setCenter:V("setCenter"),setCity:V("setCity"),getBounds(){const e=this.context.map.getBounds();return e.path?e.path.map(e=>[e[0],e[1]]):_(this.context.map.getBounds())},getSize:V("getSize"),getResolution:V("getResolution"),setFitView:(J="setFitView",async function(...e){const t=this.$amapContext;await t.ready;const n=P(t);if(!n)return this.$amapLogger.warn(`calling ${J} on ${n}`);if("function"!=typeof n[J])return this.$amapLogger.warn(J+" is not a function.");const o=e.map(K),r=await Promise.all(o);return t.destroyed?void 0:n[J](...r)}),lngLatToContainer(e){const t=this.map.lngLatToContainer(e);return[t.getX(),t.getY()]}},beforeCreate(){p(),this.$amapReady=o();const e={AMap:null,wrapper:null,ready:this.$amapReady.promise,map:null,vm:this,destroyed:!1};this.$amapContext=e},async mounted(){const{context:e}=this,t=await p();if(e.AMap=t,e.destroyed)return;const n=S(this),o=this._getContainer(!0),r=!!o.$amap;if(r)for(let e in n){const t=this.$options.props[e],r=n[e];W(this,o.$amap,t,r)}else o.$amap=new t.Map(o,n);const a=o.$amap;a.$vm=this,e.wrapper=o,e.map=a,F(this),R(this);const i=()=>{this.ready=!0,this.$amapReady.resolve(a),this.$emit("complete",this)};r?(await this.$nextTick(),i()):a.on("complete",i)},destroyed(){const{context:e}=this;if(!n._disableMapCache&&this.cacheKey){const e=this._getContainer(!1);document.body.appendChild(e),this._clear()}else e.map&&e.map.destroy();e.destroyed=!0},provide(){return{$amapContainer:this.context}},render(e){let t=this.$slots.default;return this.sync||this.ready||(t=void 0),e("div",{class:"amap-vue-container",style:"position:relative; width:100%; height:100%;"},t)}}),G=t.extend({computed:{context(){return this.$amapContext},component(){return this.context.component},map(){return this.context.container.map},wrapper(){return this.context.container.vm},AMap(){return this.context.AMap}}}),X=b(G).extend({inject:["$amapContainer"],amapMeta:{slot:!1,initComponent:d,add(e,t){const n=e;t.setMap(n.map)},remove(e,t){t.setMap(null)}},beforeCreate(){this.$amapReady=o(),this.$amapContext={}},created(){Object.assign(this.$amapContext,{AMap:null,ready:this.$amapReady.promise,container:this.$amapContainer,component:null,destroyed:!1})},async mounted(){const{context:e}=this,t=this.$options.amapMeta,{container:n}=e;await n.ready,e.AMap=n.AMap,t.prepare&&await t.prepare();const o=S(this);if(e.destroyed)return;const r=await t.initComponent.call(this,window.AMap,o);r.$vm=this,e.component=r,t.add.call(this,n,r),F(this),R(this),this.$amapReady.resolve(r),this.$emit("amap-ready",this)},beforeDestroy(){const{context:e}=this,{container:t,component:n}=e;if(n){N(this),this.$options.amapMeta.remove.call(this,t,n)}e.destroyed=!0},render(e){return this.$options.amapMeta.slot&&this.$slots.default?e("div",{class:"amap-vue-placeholder",style:"visibility: hidden; pointer-events: none;"},this.$slots.default):null}}),Q=b(X).extend({amapMeta:{events:["click","dblclick","rightclick","mousemove","mouseover","mouseout","mousedown","mouseup","dragstart","dragging","dragend","moving","moveend","movealong","touchstart","touchmove","touchend"]},props:{visible:Z({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),cursor:Z("setCursor",String),zIndex:Z("setzIndex",Number),bubble:Z("setBubble",Boolean,void 0),clickable:Z("setClickable",Boolean,void 0),draggable:Z("setDraggable",Boolean,void 0),extData:Z("setExtData",Object)},methods:{show:V("show"),hide:V("hide"),getExtData:V("getExtData")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}});const ee=["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"],te=["miter","round","bevel"],ne=["butt","round","square"],oe=["solid","dashed"];var re=b(Q).extend({props:{position:Z({type:Array,deep:!0,equals:$,setter(e,t){if(!t)return;const n=e;B(t,j(n.getPosition()))||n.setPosition([t[0],t[1]])},getter:e=>j(e.getPosition()),events:["dragging","dragend","moving","moveend"]}),topWhenClick:{type:Boolean,default:void 0},animation:Z("setAnimation",String),angle:Z({type:Number,equals:k,setter(e,t){void 0!==t&&e.setAngle(t)},getter:e=>e.getAngle(),events:["moving"]}),autoRotation:{type:Boolean,default:void 0},title:Z("setTitle",String),anchor:Z({type:String,setter:"setAnchor",validator:e=>ee.includes(e)}),offset:Z({type:Array,deep:!0,equals:$,setter(e,t){const n=e;var o;t&&(B(t,(o=n.getOffset(),Array.isArray(o)?[o[0],o[1]]:[o.x,o.y]))||n.setOffset(new window.AMap.Pixel(t[0],t[1])))},transform:e=>new window.AMap.Pixel(e[0],e[1])}),raiseOnDrag:{type:Boolean,default:void 0}},methods:{moveAlong:V("moveAlong",!0),moveTo:V("moveTo",!0),stopMove:V("stopMove")},beforeDestroy(){this.context.component&&this.stopMove()}});function ae(e){if(!e)return;const t={...e};return t.offset&&(t.offset=new window.AMap.Pixel(t.offset[0],t.offset[1])),t}function ie(e){return"string"==typeof e?e:new window.AMap.Icon(e)}var se=b(re).extend({name:"AmapMarker",amapMeta:{slot:!0,async initComponent(e,t){const n={...t};return this.$slots.default&&this.$slots.default.length>0&&(n.content=this.$slots.default[0].elm),new e.Marker(n)}},props:{content:Z("setContent",String),icon:Z({setter(e,t){if(!t)return;const n=e,o=ie(t);n.setIcon(o)},transform:ie}),shadow:Z("setShadow"),shape:Z("setShape"),label:Z({type:Object,setter(e,t){t&&e.setLabel(ae(t))},deep:!0,transform:ae})}}),pe=b(X).extend({name:"AmapLabelsLayer",amapMeta:{slot:!0,initComponent:async(e,t)=>new e.LabelsLayer(t)},props:{visible:Z({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:{type:Number},opacity:{type:Number},collision:{type:Boolean,default:void 0},animation:{type:Boolean,default:void 0}},provide(){return{$amapLabelsLayer:this.context}}}),le=b(X).extend({name:"AmapLabelMarker",inject:["$amapLabelsLayer"],amapMeta:{initComponent:async(e,t)=>new e.LabelMarker(t),async add(e,t){const n=await this.$amapLabelsLayer.ready;this.$amapContext.destroyed||n.add(t)},async remove(e,t){(await this.$amapLabelsLayer.ready).remove(t)},events:["click","mouseover","mousemove","mouseput","mousedown","mouseup","touchstart","touchend"]},props:{position:Z({type:Array,deep:!0,equals:$,setter(e,t){const n=e;t&&(B(t,j(n.getPosition()))||n.setPosition([t[0],t[1]]))}}),zooms:Z({type:Array,deep:!0,equals:$,setter:"setZooms"}),opacity:Z("setOpacity",Number),rank:{type:Number},icon:Z({type:Object,setter:"setIcon",deep:!0}),text:Z({type:Object,setter:"setText",deep:!0})}}),ce=b(re).extend({name:"AmapText",amapMeta:{initComponent:async(e,t)=>(t.domStyle&&(t.style=t.domStyle,delete t.domStyle),new e.Text(t))},props:{text:Z("setText",String),domStyle:Z({type:Object,setter(e,t){e.setStyle(t)},deep:!0})}});function de(e){return(t,n)=>{t.setOptions({[e]:n})}}const ue=b(Q).extend({props:{strokeColor:Z({type:String,setter:de("strokeColor")}),strokeOpacity:Z({type:Number,setter:de("strokeOpacity")}),strokeWeight:Z({type:Number,setter:de("strokeWeight")}),strokeStyle:Z({type:String,setter:de("strokeStyle"),validator:e=>oe.includes(e)}),strokeDasharray:Z({type:Array,deep:!0,equals:function(e,t){return!(!e&&t)&&(!(e&&!t)&&(e===t||e.length===t.length&&e.every((e,n)=>e===t[n])))},setter:de("strokeDasharray")})},methods:{getBounds:V("getBounds")}}),me=b(ue).extend({props:{fillColor:Z({type:String,setter:de("fillColor")}),fillOpacity:Z({type:Number,setter:de("fillOpacity")})},methods:{contains:V("contains")}}),ye=b(ue).extend({props:{lineJoin:Z({type:String,setter:de("lineJoin"),validator:e=>te.includes(e)}),lineCap:Z({type:String,setter:de("lineCap"),validator:e=>ne.includes(e)}),showDir:Z({type:Boolean,default:void 0,setter:de("showDir")}),dirColor:Z({type:String,setter:de("dirColor")}),dirImg:Z({type:String,setter:de("dirImg")}),isOutline:Z({type:Boolean,default:void 0,setter:de("isOutline")}),outlineColor:Z({type:String,setter:de("outlineColor")}),borderWeight:Z({type:Number,setter:de("borderWeight")})},methods:{getLength:V("getLength")}});var he=b(me).extend({props:{center:Z({type:Array,clone:!0,deep:!0,equals:$,setter(e,t){if(!t)return;const n=e;if(this.$props.draggable||this.$props.editable){if(B(t,j(n.getCenter())))return}n.setCenter(new window.AMap.LngLat(t[0],t[1]))},getter:e=>j(e.getCenter()),events:["dragging","dragend"]}),radius:Z({type:Number,setter:"setRadius"})}});const fe=b(G).extend({data:()=>({$amapEditor:null}),props:{editable:Z({type:Boolean,default:!1,initialize:!1})},async mounted(){await this.context.ready;const e=this.$options.amapMeta.editable;this.editable&&e.startEditing.call(this)},beforeDestroy(){const e=this.$amapEditor;if(e){this.$options.amapMeta.editable.events.forEach(t=>{e.off(t,this.$onAmapEdit)}),e.close()}},watch:{"$props.editable"(e){const t=this.$options.amapMeta.editable;e?this.context.destroyed||t.startEditing.call(this):t.endEditing.call(this)}}});var ge=b(fe).extend({amapMeta:{editable:{events:[],loadEditor:d,initEditor:d,onEdit:d,async initEditing(){if(this.$amapEditor)return this.$amapEditor;const e=this.$options.amapMeta.editable,{context:t}=this;await t.container.ready,await this.$options.amapMeta.editable.loadEditor();const n=t.container.map,o=t.component,{AMap:r}=this;this.$amapEditor=await e.initEditor.call(this,r,n,o);const a=this.$onAmapEdit=e.onEdit.bind(this);return e.events.forEach(e=>{this.$amapEditor.on(e,a)}),this.$amapEditor},async startEditing(){const e=this.$options.amapMeta.editable;(await e.initEditing.call(this)).open()},endEditing(){this.$amapEditor&&this.$amapEditor.close()}}}}),ve=b(he,ge).extend({name:"AmapCircle",amapMeta:{initComponent:async(e,t)=>new e.Circle(t),editable:{events:["end","move","adjust"],async loadEditor(){await l("AMap.CircleEditor")},async initEditor(e,t,n){return new e.CircleEditor(t,n,this.draggable)},onEdit(e){const{target:t}=e,n=t.getCenter();this.$emit("update:center",[n.lng,n.lat]),this.$emit("update:radius",t.getRadius())}}}}),we=b(he).extend({name:"AmapCircleMarker",amapMeta:{initComponent:async(e,t)=>new e.CircleMarker(t)}}),be=b(ue,ge).extend({amapMeta:{editable:{events:["end","move","adjust"],async loadEditor(){await l("AMap.PolyEditor")},async initEditor(e,t,n){return new e.PolyEditor(t,n,this.draggable)},onEdit(e){const t=e.target.getPath().map(j);this.$emit("update:path",t)}}},props:{path:Z({type:Array,setter(e,t){const n=e;if(this.$props.editable||this.$props.editable){if(E(n.getPath().map(j),t))return}n.setPath(t)},getter:e=>e.getPath().map(j),clone:!0,equals:E,events:["dragging","dragend"]})}}),xe=b(me,be).extend({name:"AmapPolygon",amapMeta:{initComponent:async(e,t)=>new e.Polygon(t)},methods:{getArea:V("getArea")}}),Ce=b(be,ye).extend({name:"AmapPolyline",amapMeta:{initComponent:async(e,t)=>new e.Polyline(t)},props:{geodesic:Z({type:Boolean,default:void 0,setter:de("geodesic")})}});const Me="undefined"!=typeof BigInt64Array;function Ae(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const n=e.length;if(n!=t.length)return!1;for(let o=n;0!=o--;)if(!Ae(e[o],t[o]))return!1;return!0}if(e instanceof Map){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;for(const n of e.entries())if(!Ae(n[1],t.get(n[0])))return!1;return!0}if(e instanceof Set){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;return!0}if(e.constructor.BYTES_PER_ELEMENT&&(e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array||Me&&(e instanceof BigInt64Array||e instanceof BigUint64Array))){const n=e.length;if(n!=t.length)return!1;for(let o=n;0!=o--;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),o=n.length;if(o!==Object.keys(t).length)return!1;for(let e=o;0!=e--;)if(!Object.prototype.hasOwnProperty.call(t,n[e]))return!1;for(let r=o;0!=r--;){const o=n[r];if(!Ae(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function $e(e){if(!e)return;return e.map(e=>{const t=[],n=e.controlPoints;return n&&t.push(...n.map(e=>j(e))),t.push(j(e)),t})}var Ee=b(ye,ge).extend({name:"AmapBezierCurve",amapMeta:{initComponent:async(e,t)=>new e.BezierCurve(t),editable:{events:["end","adjust","addnode","removenode"],async loadEditor(){await l("AMap.BezierCurveEditor")},async initEditor(e,t,n){return new e.BezierCurveEditor(t,n,this.draggable)},onEdit(e){const t=e.target.getPath();this.$emit("update:path",$e(t))}}},props:{path:Z({type:Array,setter(e,t){const n=e;if(this.$props.editable||this.$props.editable){if(Ae($e(n.getPath()),t))return}n.setPath(t)},getter:e=>$e(e.getPath()),clone:!0,equals:Ae,events:["dragging","dragend"]})}});function ke(e,t){return!(!e||!t)&&(k(e[0][0],t[0][0])&&k(e[0][1],t[0][1])&&k(e[1][0],t[1][0])&&k(e[1][1],t[1][1]))}var Be=b(me,ge).extend({name:"AmapRectangle",amapMeta:{initComponent:async(e,t)=>new e.Rectangle(t),editable:{events:["move","end","adjust"],async loadEditor(){await l("AMap.RectangleEditor")},async initEditor(e,t,n){return new e.RectangleEditor(t,n,this.draggable)},onEdit(e){const t=_(e.target.getBounds());this.$emit("update:bounds",t)}}},props:{bounds:Z({type:Array,deep:!0,setter(e,t){if(this.$props.editable||this.$props.draggable){if(ke(_(e.getBounds()),t))return}e.setBounds(T(t))},getter:e=>_(e.getBounds()),transform:T,clone:!0,equals:ke,events:["dragging","dragend"]})},methods:{getArea:V("getArea")}}),Oe=b(me,ge).extend({name:"AmapEllipse",amapMeta:{initComponent:async(e,t)=>new e.Ellipse(t),editable:{events:["move","end","adjust"],async loadEditor(){await l("AMap.EllipseEditor")},async initEditor(e,t,n){return new e.EllipseEditor(t,n,this.draggable)},onEdit(e){const t=j(e.target.getCenter());B(this.center,t)||this.$emit("update:center",t);const n=e.target.getRadius();B(this.radius,n)||this.$emit("update:radius",n.slice(0))}}},props:{center:Z({type:Array,setter(e,t){if(this.$props.editable||this.$props.draggable){if(B(t,j(e.getCenter())))return}e.setCenter(t)},getter:e=>j(e.getCenter()),clone:!0,deep:!0,equals:B,events:["dragging","dragend"]}),radius:Z({type:Array,setter(e,t){const n=e;if(this.$props.editable){if(B(t,n.getRadius()))return}n.setRadius(t)},clone:!0,deep:!0,equals:B})},methods:{getBounds(){return _(this.context.component.getBounds())}}}),Le=b(Q).extend({name:"AmapInfoWindow",amapMeta:{slot:!0,initComponent:async(e,t)=>new e.InfoWindow(t),events:["change","open","close"]},props:{isCustom:{type:Boolean,default:void 0},autoMove:{type:Boolean,default:void 0},closeWhenClickMap:{type:Boolean,default:void 0},visible:Z({type:Boolean,default:!0,setter(e,t){t?this.open():this.close()}}),position:Z({type:Array,deep:!0,setter(e,t){const n=e;if(!t)return;const o=n.getPosition();o&&B(t,j(o))||n.setPosition([t[0],t[1]])},getter:e=>j(e.getPosition()),equals:$}),offset:Z({type:Array,transform:e=>new window.AMap.Pixel(e[0],e[1])}),anchor:Z({type:String,setter:"setAnchor",validator:e=>ee.includes(e)}),showShadow:{type:Boolean,default:void 0}},methods:{open(){this.context.ready.then(e=>{const t=e,n=this.position;t.open(this.context.container.map,n)})},close(){this.context.ready.then(e=>{e.close()})},show(){this.open()},hide(){this.close()},onOpen(){this.visible||this.$emit("update:visible",!0)},onClose(){this.visible&&this.$emit("update:visible",!1)},_updateContent(){this.visible&&this.$nextTick(()=>{const e=this.$slots.default[0];e&&e.elm&&this.context.ready.then(t=>{t.setContent(e.elm)})})}},async mounted(){const e=await this.context.ready;this.visible&&(this._updateContent(),this.open()),e.on("open",this.onOpen),e.on("close",this.onClose)},watch:{visible:"_updateContent"}}),Se=b(X).extend({amapMeta:{events:["complete"]},props:{visible:Z({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:Z("setzIndex",Number),opacity:Z({setter:"setOpacity",type:Number}),zooms:Z({type:Array}),detectRetina:Z({type:Boolean,default:void 0})},methods:{show:V("show"),hide:V("hide"),reload:V("reload")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}}),Pe=b(Se).extend({name:"AmapTileLayer",amapMeta:{initComponent:async(e,t)=>new e.TileLayer(t)},props:{tileSize:Z({type:Number}),tileUrl:Z({type:String,setter:"setTileUrl"}),errorUrl:{type:String},getTileUrl:{type:[String,Function]}}}),je=b(Se).extend({name:"AmapTileLayerSatellite",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.Satellite(t)}}),_e=b(Se).extend({name:"AmapTileLayerFlexible",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.Flexible(t)},props:{createTile:{type:Function},cacheSize:{type:Number}}}),Te=b(Se).extend({name:"AmapTileLayerRoadNet",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.RoadNet(t)}}),ze=b(Se).extend({name:"AmapTileLayerTraffic",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.Traffic(t)}});const De=["LT","RT","LB","RB"];var Re=b(X).extend({amapMeta:{add(e,t){e.map.addControl(t)},remove(e,t){e.map.removeControl(t)}}}),Ie=b(Re).extend({name:"AmapMapType",amapMeta:{prepare:()=>l("AMap.MapType"),initComponent:async(e,t)=>new e.MapType(t)},props:{defaultType:{type:Number},showTraffic:{type:Boolean,default:void 0},showRoad:{type:Boolean,default:void 0}}}),Ne=b(Re).extend({name:"AmapControlBar",amapMeta:{prepare:()=>l("AMap.ControlBar"),initComponent:async(e,t)=>new e.ControlBar(t)},props:{position:{type:Object},showZoomBar:{type:Boolean,default:void 0},showControlButton:{type:Boolean,default:void 0}}}),qe=b(Re).extend({name:"AmapOverView",amapMeta:{prepare:()=>l("AMap.OverView"),initComponent:async(e,t)=>new e.OverView(t)},props:{visible:Z({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),isOpen:Z({type:Boolean,default:void 0,setter(e,t){const n=e;t?n.open():n.close()}}),tileLayer:Z("setTileLayer")},methods:{show:V("show"),hide:V("hide"),open:V("open"),close:V("close")},async mounted(){await this.context.ready,D(this,"open",()=>{this.$emit("update:is-open",!0)}),D(this,"close",()=>{this.$emit("update:is-open",!1)})}}),We=b(Re).extend({name:"AmapScale",amapMeta:{prepare:()=>l("AMap.Scale"),initComponent:async(e,t)=>new e.Scale(t)},props:{position:Z({type:String,validator:e=>De.includes(e)}),visible:Z({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),offset:Z({type:Array,transform:e=>new window.AMap.Pixel(e[0],e[1])})},methods:{show:V("show"),hide:V("hide"),setPosition:V("position"),setOffset(e){this.context.component.setOffset(new window.AMap.Pixel(e[0],e[1]))}}});function Fe(e){return function(t,n){if(void 0===n)return;t[`${n?"show":"hide"}${e}`]()}}var Ze=b(Re).extend({name:"AmapToolBar",amapMeta:{prepare:()=>l("AMap.ToolBar"),initComponent:async(e,t)=>new e.ToolBar(t),events:["location","zoomchanged"]},props:{visible:Z({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),position:{type:String,validator:e=>De.includes(e)},ruler:Z({type:Boolean,default:void 0,setter:Fe("Ruler")}),direction:Z({type:Boolean,default:void 0,setter:Fe("Direction")}),locate:Z({type:Boolean,default:void 0,setter:Fe("Location")}),noIpLocale:{type:Boolean,default:void 0},liteStyle:{type:Boolean,default:void 0},autoPosition:{type:Boolean,default:void 0}},methods:{show:V("show"),hide:V("hide"),doLocation:V("doLocation"),getLocation(){const e=this.context.component.getLocation();if(e)return j(e)}}});function Ve(e,t,n){if(!e)return n;var o,r;if(Array.isArray(t)&&(o=t.slice(0)),"string"==typeof t&&(o=t.split(".")),"symbol"==typeof t&&(o=[t]),!Array.isArray(o))throw new Error("props arg must be an array, a string or a symbol");for(;o.length;){if(r=o.shift(),!e)return n;if(void 0===(e=e[r]))return n}return e}const Ue=se.sealedOptions,Ke=t.extend({props:Ue.props});let He=void 0;function Je(e,t){He||(He=document.createElement("div"));const n=e;return n._props=t,n._vnode=null,n.$mount(He),n._vnode.elm}function Ye(e,t,n){const o=e[t];Array.isArray(o)&&(e[t]=new n(o[0],o[1]))}function Ge(e){return e&&0!==e.length?e.map(e=>{const t={...e};return Ye(t,"size",window.AMap.Size),Ye(t,"offset",window.AMap.Pixel),Ye(t,"imageOffset",window.AMap.Pixel),t}):e}var Xe=b(X).extend({name:"AmapMarkerCluster",amapMeta:{prepare:()=>l("AMap.MarkerClusterer"),async initComponent(e,t){return this.$scopedSlots.cluster&&(t.renderClusterMarker=this._renderCluster),new e.MarkerClusterer(this.map,[],t)},events:["click"]},data:()=>({_mcc:null}),props:{data:Z({type:Array,required:!0,initialize:!1}),keyProp:Z({type:[String,Function],default:"key",initialize:!1}),positionProp:Z({type:[String,Function],default:"position",initialize:!1}),gridSize:Z("setGridSize",Number),minClusterSize:Z("setMinClusterSize",Number),maxZoom:Z("setMaxZoom",Number),averageCenter:Z({type:Boolean,default:void 0,setter:"setAverageCenter"}),styles:Z({type:Array,setter(e,t){e.setStyles(Ge(t))},transform:Ge}),zoomOnClick:Z({type:Boolean,default:void 0}),markerOptions:Z({type:Function,initialize:!1}),clusterOptions:Z({type:Function,initialize:!1})},mounted(){const e=function(e,t,n){let o,r,a,i,s;function p(){var l=Date.now()-i;l<t&&l>=0?o=setTimeout(p,t-l):(o=null,n||(s=e.apply(a,r),a=r=null))}null==t&&(t=100);var l=function(...l){a=this,r=l,i=Date.now();var c=n&&!o;return o||(o=setTimeout(p,t)),c&&(s=e.apply(a,r),a=r=null),s};return l.clear=function(){o&&(clearTimeout(o),o=null)},l.flush=function(){o&&(s=e.apply(a,r),a=r=null,clearTimeout(o),o=null)},l}(this._onDataChange,100),n=this.$scopedSlots.marker,o=this.$scopedSlots.cluster;this.context.ready.then(()=>{this._onDataChange()}),this._mcc={markers:new Map,clusters:new Map,MarkerRenderer:t.extend({name:"AmapMarkerClusterMarkerRenderer",props:{point:{type:Object}},render(){if(!n)return null;return Ve(n(this.point),"0",null)}}),ClusterRenderer:t.extend({name:"AmapMarkerClusterClusterRenderer",props:{context:{type:Object}},render(){if(!o)return null;return Ve(o(this.context),"0",null)}}),dummy:new Ke},this._mcc.marker=new this._mcc.MarkerRenderer,this._mcc.cluster=new this._mcc.ClusterRenderer,this.$watch("data",{handler:e})},beforeDestroy(){this._mcc.markers.clear()},methods:{_getKey(e,t){const{keyProp:n}=this;return n&&("$index"!==n||"$index"in e)?"function"==typeof n?n(e):e[n]:t},_getPosition(e){const{positionProp:t}=this;return"function"==typeof t?t(e):e[t]},async _onDataChange(){const{data:e}=this;if(await this.context.ready,this.context.destroyed)return;h("Render Markers");const t=e.map((e,t)=>this._getMarker(e,t));f("Render Markers"),h("Set Markers"),this.component.setMarkers(t),f("Set Markers")},_renderMarkerContent(e){if(this.$scopedSlots.marker)return Je(this._mcc.marker,{point:e})},_getMarker(e,t){const n=this._getKey(e,t),o=this._mcc.markers;if(o.has(n))return o.get(n);const r={};this.positionProp&&(r.position=this._getPosition(e)),"function"==typeof this.markerOptions&&Object.assign(r,this.markerOptions(e));const a=S(this,Ue.props,r,!0),i=this._renderMarkerContent(e);i&&(a.content=i);const s=new window.AMap.Marker(a);return o.set(n,s),s},_renderCluster(e){const t=Je(this._mcc.cluster,{context:e});e.marker.setContent(t);const n={};"function"==typeof this.clusterOptions&&Object.assign(n,this.clusterOptions(e));const o=Object.keys(n);if(o.length>0){const{dummy:t}=this._mcc;for(let r=0;r<o.length;++r){const a=o[r],i=n[a],s=Ue.props[a];void 0!==s&&W(t,e.marker,s,i)}}}},render:e=>null});const Qe=se.sealedOptions,et=Ce.sealedOptions,tt=xe.sealedOptions,nt=Be.sealedOptions,ot=ve.sealedOptions;var rt=b(X).extend({amapMeta:{prepare:()=>l("AMap.MouseTool"),async initComponent(e){return new e.MouseTool(this.map)},add(){},remove(){}},props:{mode:Z({type:String,default:"none"}),clearWhenClose:{type:Boolean,default:!0},options:{type:Object}},data:()=>({drawingMode:void 0}),methods:{close(e){this.component.close(e)},draw(){if(this.mode===this.drawingMode)return;const{mode:e}=this,t=this.component;switch(e){case"none":this.close(this.clearWhenClose);break;case"marker":t.marker(S(this,Qe.props,this.options||{}));break;case"polyline":t.polyline(S(this,et.props,this.options||{}));break;case"polygon":t.polygon(S(this,tt.props,this.options||{}));break;case"rectangle":t.rectangle(S(this,nt.props,this.options||{}));break;case"circle":t.circle(S(this,ot.props,this.options||{}));break;case"rule":t.rule(S(this,tt.props,this.options||{}));break;case"measureArea":t.measureArea(S(this,tt.props,this.options||{}));break;case"rectZoomIn":t.rectZoomIn(S(this,tt.props,this.options||{}));break;case"rectZoomOut":t.rectZoomOut(S(this,tt.props,this.options||{}))}this.drawingMode=e},_onDraw(e){if(this.mode!==this.drawingMode)return this.close(!0),void this.draw();const t=e.obj,n=this.drawingMode;let o=t;switch(n){case"marker":o=j(t.getPosition());break;case"polyline":case"polygon":o=t.getPath().map(e=>j(e));break;case"rectangle":o=_(t.getBounds());break;case"circle":o={center:j(t.getCenter()),radius:t.getRadius()};break;case"rule":o={path:t.getPath().map(e=>j(e)),length:t.getLength()};break;case"measureArea":o={path:t.getPath().map(e=>j(e)),area:t.getArea()}}this.$emit("draw",n,o),this.$emit("update:mode","none")}},async mounted(){if(await this.context.ready,this.context.destroyed)return;this.component.on("draw",this._onDraw),this.$watch("mode",async e=>{"none"!==e&&"none"!==this.drawingMode&&this.close(!0),this.draw()},{immediate:!0})}}),at=b(X).extend({amapMeta:{events:["complete"]},props:{visible:Z({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:Z("setzIndex",Number),opacity:Z({setter:"setOpacity",type:Number}),zooms:Z({type:Array})},methods:{show:V("show"),hide:V("hide")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}}),it=b(at).extend({name:"AmapImageLayer",amapMeta:{initComponent:async(e,t)=>new e.ImageLayer(t)},props:{bounds:Z({type:Array,transform:T,deep:!0,setter(e,t){e.setBounds(T(t))}}),url:Z({type:String,setter:"setImageUrl"})},methods:{getElement:V("getElement")}}),st=b(at).extend({name:"AmapVideoLayer",amapMeta:{initComponent:async(e,t)=>new e.VideoLayer(t)},props:{autoplay:{type:Boolean},loop:{type:Boolean},bounds:Z({type:Array,transform:T}),url:Z({type:[String,Array],setter:"setVideoUrl"})},methods:{getElement:V("getElement")}}),pt=b(at).extend({name:"AmapCanvasLayer",amapMeta:{slot:!0,async initComponent(e,t){const n=Ve(this,"$slots.default.0.elm");if(!n||"CANVAS"!==n.tagName)throw this.$amapLogger.warn("slot内容必须是canvas"),new Error;return t.canvas=n,new e.CanvasLayer(t)}},props:{bounds:Z({type:Array,transform:T})},methods:{reFresh:V("reFresh")}}),lt=b(at).extend({name:"AmapCustomLayer",amapMeta:{slot:!0,async initComponent(e,t){const n=Ve(this,"$slots.default.0.elm",null),o=new e.CustomLayer(n,t);return this.render&&(o.render=this.render),o}},props:{render:Z({type:Function,setter(e,t){e.render=t}})}}),ct=b(X).extend({amapMeta:{events:["complete"]},props:{visible:Z({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:Z("setzIndex",Number),opacity:Z({setter:"setOpacity",type:Number})},methods:{show:V("show"),hide:V("hide")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}}),dt=b(ct).extend({name:"AmapDistrictLayerWorld",amapMeta:{prepare:()=>l("AMap.DistrictLayer"),initComponent:async(e,t)=>new e.DistrictLayer.World(t)},props:{styles:Z({type:Object,setter:"setStyles"})},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}}),ut=b(ct).extend({name:"AmapDistrictLayerCountry",amapMeta:{prepare:()=>l("AMap.DistrictLayer"),initComponent:async(e,t)=>("soc"in t&&(t.SOC=t.soc,delete t.soc),new e.DistrictLayer.Country(t))},props:{styles:Z({type:Object,setter:"setStyles"}),soc:Z({type:String,setter:"setSOC"}),depth:{type:Number}},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}}),mt=b(ct).extend({name:"AmapDistrictLayerProvince",amapMeta:{prepare:()=>l("AMap.DistrictLayer"),initComponent:async(e,t)=>("soc"in t&&(t.SOC=t.soc,delete t.soc),new e.DistrictLayer.Province(t))},props:{styles:Z({type:Object,setter:"setStyles"}),depth:{type:Number},adcode:Z({type:Array,deep:!0,setter:"setDistricts"})},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}}),yt={install(e){e.component("amap",Y),e.component("amap-marker",se),e.component("amap-labels-layer",pe),e.component("amap-label-marker",le),e.component("amap-text",ce),e.component("amap-circle",ve),e.component("amap-circle-marker",we),e.component("amap-polygon",xe),e.component("amap-polyline",Ce),e.component("amap-bezier-curve",Ee),e.component("amap-rectangle",Be),e.component("amap-ellipse",Oe),e.component("amap-info-window",Le),e.component("amap-tile-layer",Pe),e.component("amap-tile-layer-satellite",je),e.component("amap-tile-layer-road-net",Te),e.component("amap-tile-layer-traffic",ze),e.component("amap-tile-layer-flexible",_e),e.component("amap-map-type",Ie),e.component("amap-control-bar",Ne),e.component("amap-over-view",qe),e.component("amap-scale",We),e.component("amap-tool-bar",Ze),e.component("amap-marker-clusterer",Xe),e.component("amap-mouse-tool",rt),e.component("amap-image-layer",it),e.component("amap-video-layer",st),e.component("amap-canvas-layer",pt),e.component("amap-custom-layer",lt),e.component("amap-district-layer-world",dt),e.component("amap-district-layer-country",ut),e.component("amap-district-layer-province",mt)},config:n,loadAMap:p,loadPlugins:l,withAmap:c,Amap:Y,Marker:se,LabelsLayer:pe,LabelMarker:le,Text:ce,Circle:ve,CircleMarker:we,Polygon:xe,Polyline:Ce,BezierCurve:Ee,Rectangle:Be,Ellipse:Oe,InfoWindow:Le,TileLayer:Pe,Satellite:je,Flexible:_e,RoadNet:Te,Traffic:ze,MapType:Ie,ControlBar:Ne,OverView:qe,Scale:We,ToolBar:Ze,MarkerClusterer:Xe,MouseTool:rt,ImageLayer:it,VideoLayer:st,CanvasLayer:pt,CustomLayer:lt,DistrictLayerWorld:dt,DistrictLayerCountry:ut,DistrictLayerProvince:mt};exports.Amap=Y,exports.BezierCurve=Ee,exports.CanvasLayer=pt,exports.Circle=ve,exports.CircleMarker=we,exports.ControlBar=Ne,exports.CustomLayer=lt,exports.DistrictLayerCountry=ut,exports.DistrictLayerProvince=mt,exports.DistrictLayerWorld=dt,exports.Ellipse=Oe,exports.Flexible=_e,exports.ImageLayer=it,exports.InfoWindow=Le,exports.LabelMarker=le,exports.LabelsLayer=pe,exports.MapType=Ie,exports.Marker=se,exports.MarkerClusterer=Xe,exports.MouseTool=rt,exports.OverView=qe,exports.Polygon=xe,exports.Polyline=Ce,exports.Rectangle=Be,exports.RoadNet=Te,exports.Satellite=je,exports.Scale=We,exports.Text=ce,exports.TileLayer=Pe,exports.ToolBar=Ze,exports.Traffic=ze,exports.VideoLayer=st,exports.config=n,exports.default=yt,exports.loadAMap=p,exports.loadPlugins=l,exports.withAmap=c; |
@@ -1,1 +0,1 @@ | ||
import e from"vue";var t={_prefix:"https://webapi.amap.com/maps",_disableMapCache:!1,verbose:!1,version:"1.4.15",key:"",plugins:[]};function n(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}const o=n();let a=!1,r=!1;const i=o.promise;function s(){if(!r){if(r=!0,window.AMap)return o.resolve(window.AMap),i;const e=document.createElement("script"),n=`amap_vue_${Date.now()}_${Math.ceil(1e4*Math.random())}`,s=()=>{a||(a=!0,o.resolve(window.AMap))};window[n]=s;const p=function(e){const t=[];for(const n in e)void 0!==e[n]&&null!==e[n]&&t.push(`${n}=${encodeURIComponent(e[n])}`);return t.join("&")}({v:t.version,key:t.key,callback:n,plugin:t.plugins.join(",")}),l=`${t._prefix}?${p}`;e.src=l,document.body.appendChild(e)}return i}function p(e){return new Promise(t=>{window.AMap.plugin(e,()=>{t()})})}var l=e.extend({inject:["$amapContainer"],computed:{map(){return this.$amapContainer.map}}});function c(e){throw new Error(e)}function d(e,...t){const[n,...o]=t;if(!n)return e;const a=new Set(e);return n.forEach(t=>{a.has(t)||e.push(t)}),d(e,...o)}const m=Object.prototype.hasOwnProperty;function u(e){try{if(e.constructor&&!m.call(e,"constructor")&&!m.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}let t;for(t in e);return void 0===t||m.call(e,t)}function y(e){t.verbose&&console.time(e)}function h(e){t.verbose&&console.timeEnd(e)}function f(e,n,o){t.verbose&&"function"==typeof console[n]&&(e&&e.$options&&e.$options.name&&(o=[`[${e.$options.name}]`,...o]),console[n](...o))}function g(...e){f(this,"warn",e)}function v(...e){f(this,"debug",e)}function w(...t){return e.extend({mixins:t||[]})}function b(e,t){return null!=t&&e instanceof t}function C(e,t,n,o,a){"object"==typeof t&&(n=t.depth,o=t.prototype,a=t.includeNonEnumerable,t=t.circular);let r=[],i=[];return void 0===t&&(t=!0),void 0===n&&(n=1/0),function e(n,s){if(null===n)return null;if(0===s)return n;let p,l;if("object"!=typeof n)return n;if(b(n,Map))p=new Map;else if(b(n,Set))p=new Set;else if(b(n,Promise))p=new Promise((function(t,o){n.then((function(n){t(e(n,s-1))}),(function(t){o(e(t,s-1))}))}));else if(C.__isArray(n))p=[];else if(C.__isRegExp(n))p=new RegExp(n.source,x(n)),n.lastIndex&&(p.lastIndex=n.lastIndex);else if(C.__isDate(n))p=new Date(n.getTime());else if(b(n,Error))p=Object.create(n);else if(void 0===o){if(l=Object.getPrototypeOf(n),b(l,Object))return n;p=Object.create(l)}else p=Object.create(o),l=o;if(t){let e=r.indexOf(n);if(-1!=e)return i[e];r.push(n),i.push(p)}b(n,Map)&&n.forEach((function(t,n){let o=e(n,s-1),a=e(t,s-1);p.set(o,a)})),b(n,Set)&&n.forEach((function(t){let n=e(t,s-1);p.add(n)}));for(let t in n){Object.getOwnPropertyDescriptor(n,t)&&(p[t]=e(n[t],s-1));try{if(void 0===Object.getOwnPropertyDescriptor(n,t).set)continue;p[t]=e(n[t],s-1)}catch(e){if(e instanceof TypeError)continue;if(e instanceof ReferenceError)continue}}if(Object.getOwnPropertySymbols){let t=Object.getOwnPropertySymbols(n);for(let o=0;o<t.length;o++){let r=t[o],i=Object.getOwnPropertyDescriptor(n,r);(!i||i.enumerable||a)&&(p[r]=e(n[r],s-1),Object.defineProperty(p,r,i))}}if(a){let t=Object.getOwnPropertyNames(n);for(let o=0;o<t.length;o++){let a=t[o],r=Object.getOwnPropertyDescriptor(n,a);r&&r.enumerable||(p[a]=e(n[a],s-1),Object.defineProperty(p,a,r))}}return p}(e,n)}function M(e){return Object.prototype.toString.call(e)}function x(e){let t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}function A(e,t){return!(!e&&t)&&(!(e&&!t)&&(e===t||e[0]===t[0]&&e[1]===t[1]))}function $(e,t){return!(!e&&t)&&(!(e&&!t)&&(!e&&!t||(e===t||e.length===t.length&&e.every((e,n)=>A(e,t[n])))))}e.mixin({beforeCreate(){var e;"amapMeta"in this.$options&&(this.$amapLogger=(e=this,{warn:g.bind(e),debug:v.bind(e)}))}}),e.config.optionMergeStrategies.amapMeta=(e,t)=>function e(t,n){const o={...t};for(const a in n){const r=n[a],i=t[a];Array.isArray(r)?o[a]=d(i||[],r):u(r)?o[a]=e(i||{},r):o[a]=r}return o}(e||{},t||{}),C.clonePrototype=function(e){if(null===e)return null;let t=function(){};return t.prototype=e,new t},C.__objToStr=M,C.__isDate=function(e){return"object"==typeof e&&"[object Date]"===M(e)},C.__isArray=function(e){return"object"==typeof e&&"[object Array]"===M(e)},C.__isRegExp=function(e){return"object"==typeof e&&"[object RegExp]"===M(e)},C.__getRegExpFlags=x;function E(e,t,n=1e-7){return Math.abs(e-t)<n}function k(e,t){return!(!e&&t)&&(!(e&&!t)&&(e===t||E(e[0],t[0])&&E(e[1],t[1])))}const B=new WeakMap;function O(e,t){let n=B.get(t);if(!n){n=new Map,B.set(t,n);for(const e in t){const o=t[e];!1!==o.initialize&&n.set(e,o)}}return n.get(e)}function S(e,t,n,o){void 0===t&&(t=e.$options.props),void 0===n&&(n=e.$props);const a={};for(const o in n){const r=n[o];if(void 0===r)continue;const i=O(o,t);i&&(a[o]=i.transform?i.transform.call(e,r):r)}return o?a:C(a)}function L(e){return e.map?e.map:e.component}function P(e){return Array.isArray(e)?[e[0],e[1]]:[e.lng,e.lat]}function j(e){return Array.isArray(e)?e:e.southWest?[[e.southWest.lng,e.southWest.lat],[e.northEast.lng,e.northEast.lat]]:[[e.southwest.lng,e.southwest.lat],[e.northeast.lng,e.northeast.lat]]}function _(e){const t=new window.AMap.LngLat(e[0][0],e[0][1]),n=new window.AMap.LngLat(e[1][0],e[1][1]);return new window.AMap.Bounds(t,n)}function z(e,t,n){const o=e.$amapEvents||(e.$amapEvents={});(o[t]||(o[t]=[])).push(n)}function T(e,t,n){z(e,t,n),L(e.$amapContext).on(t,n)}function D(e){const{events:t=[]}=e.$options.amapMeta,n=L(e.$amapContext);t.forEach(t=>{e.$watch("$listeners."+t,(o,a)=>{a&&n.off(t,a),o&&(z(e,t,o),n.on(t,o))},{immediate:!0})})}function R(e,t,n,o){o||(o=L(e.$amapContext));const{events:a=[]}=n;a.forEach(a=>{const{getter:r}=n;if(!r)return;const i=a=>{const i="function"==typeof r?r.call(e,o,a):o[r](),s=e.$props[t];if("function"==typeof n.equals){if(n.equals(i,s))return}else if(i===s)return;e.$emit("update:"+t,i)};z(e,a,i),o.on(a,i)})}function I(e){const t=L(e.$amapContext),n=e.$amapEvents||{};for(const e in n){n[e].forEach(n=>{t.off(e,n)})}}const N={equals:function(e,t){return e===t},clone:!1};function q(e,t,n,o){const{setter:a}=n;a&&("function"==typeof a?a.call(e,t,o):"string"==typeof a&&(n.clone&&(o=C(o)),t[a](o)))}function W(e,t,n){t||(t=L(e.$amapContext)),n||(n=e.$options.props);for(const o in n){const a=n[o],{setter:r}=a;if(!r)continue;const i={deep:!!a.deep};e.$amapLogger.debug("watch",o,i),e.$watch("$props."+o,(n,o)=>{if(!i.deep||i.deep&&n!==o)if("function"==typeof a.equals){if(a.equals(n,o))return}else if(n===o)return;q(e,t,a,n)},i),a.events&&R(e,o,a,t)}}function F(e,t,n){if("string"==typeof e){const o=e,a={...N,setter:o};return t&&(a.type=t),arguments.length>=3&&(a.default=n),a}return{...N,...e}}function Z(e,t){return function(...n){const o=L(this.$amapContext);return o?"function"!=typeof o[e]?this.$amapLogger.warn(e+" is not a function."):(t&&(n=C(n)),o[e](...n)):this.$amapLogger.warn(`calling ${e} on ${o}`)}}function U(e){return e&&"function"==typeof e.then}function V(e){if(!e)return e;if(U(e))return e;if(e.$amapContext&&e.$amapContext.ready)return e.$amapContext.ready;if(Array.isArray(e))return Promise.all(e.map(V));if(u(e)){const n={},o=Object.keys(e),a=[];function t(e,t){n[t]=void 0,a.push(e.then(e=>{n[t]=e}))}for(let r=0;r<o.length;r++){const i=o[r],s=V(e[i]);s&&U(a)?t(s,i):n[i]=e[i]}return Promise.all(a).then((function(){return n}))}return e}function K(e){return function(t,n){t.setStatus({[e]:n})}}var H,J=e.extend({name:"Amap",amapMeta:{events:["click","dblclick","rightclick","mapmove","movestart","moveend","hotspotclick","hotspotover","hotspotout","mousemove","mousewheel","mouseover","mouseup","mousedown","zoomchange","zoomstart","zoomend","dragstart","dragging","dragend","resize","touchstart","touchmove","touchend"]},props:{cacheKey:F({type:String,initialize:!1}),sync:F({type:Boolean,default:!1,initialize:!1}),showIndoorMap:F({type:Boolean,default:void 0,setter:K("showIndoorMap")}),resizeEnable:F({type:Boolean,default:void 0,setter:K("resizeEnable")}),dragEnable:F({type:Boolean,default:void 0,setter:K("dragEnable")}),pitchEnable:F({type:Boolean,default:void 0,setter:K("pitchEnable")}),rotateEnable:F({type:Boolean,default:void 0,setter:K("rotateEnable")}),zoomEnable:F({type:Boolean,default:void 0,setter:K("zoomEnable")}),doubleClickZoom:F({type:Boolean,default:void 0,setter:K("doubleClickZoom")}),keyboardEnable:F({type:Boolean,default:void 0,setter:K("keyboardEnable")}),jogEnable:F({type:Boolean,default:void 0,setter:K("jogEnable")}),scrollWheel:F({type:Boolean,default:void 0,setter:K("scrollWheel")}),animateEnable:F({type:Boolean,default:void 0,setter:K("animateEnable")}),isHotspot:F({type:Boolean,default:void 0,setter:K("isHotspot")}),touchEnable:F({type:Boolean,default:void 0,setter:K("touchEnable")}),viewMode:{type:String},showBuildingBlock:{type:Boolean,default:void 0},expandZoomRange:{type:Boolean,default:void 0},zooms:{type:Array},zoom:F({type:Number,equals:E,setter(e,t){const n=e;void 0!==t&&(E(n.getZoom(),t)||n.setZoom(t))},getter:"getZoom",events:["zoomchange","zoomend"]}),center:F({type:Array,deep:!0,equals:A,setter(e,t){const n=e;t&&(k(t,P(n.getCenter()))||n.setCenter([t[0],t[1]]))},getter:e=>P(e.getCenter()),events:["mapmove","moveend"]}),pitch:F({type:Number,equals:E,setter:"setPitch",getter:"getPitch",events:["dragging","dragend","moveend","pitchend"]}),rotation:F({type:Number,equals:E,setter:"setRotation",getter:"getRotation",events:["dragging","dragend","moveend","rotateend"]}),lang:F("setLang",String),mapStyle:F("setMapStyle",String),features:F("setFeatures",Array),skyColor:{type:String}},data:()=>({ready:!1}),computed:{context(){return this.$amapContext},map(){return this.context.map}},methods:{_clear(){const{context:e}=this;e.ready.then(()=>{I(this),this.clearMap(),this.clearInfoWindow()})},_getContainer(e){const{cacheKey:n}=this;if(!t._disableMapCache&&n){const t="amap-vue-container-inner-"+n;let o=document.getElementById(t)||this.$el.querySelector("#"+t);return o||(o=document.createElement("div"),o.className="amap-vue-container-inner",o.setAttribute("id",t),o.setAttribute("style","position:relative; width:100%; height:100%;")),e?(this.$el.insertAdjacentElement("afterbegin",o),o.style.display="block",o.style.pointerEvents="initial"):(o.style.display="none",o.style.pointerEvents="none"),o}return this.$el},clearMap:Z("clearMap"),clearInfoWindow:Z("clearInfoWindow"),setCenter:Z("setCenter"),setCity:Z("setCity"),getBounds(){const e=this.context.map.getBounds();return e.path?e.path.map(e=>[e[0],e[1]]):j(this.context.map.getBounds())},getSize:Z("getSize"),getResolution:Z("getResolution"),setFitView:(H="setFitView",async function(...e){const t=this.$amapContext;await t.ready;const n=L(t);if(!n)return this.$amapLogger.warn(`calling ${H} on ${n}`);if("function"!=typeof n[H])return this.$amapLogger.warn(H+" is not a function.");const o=e.map(V),a=await Promise.all(o);return t.destroyed?void 0:n[H](...a)}),lngLatToContainer(e){const t=this.map.lngLatToContainer(e);return[t.getX(),t.getY()]}},beforeCreate(){s(),this.$amapReady=n();const e={AMap:null,wrapper:null,ready:this.$amapReady.promise,map:null,vm:this,destroyed:!1};this.$amapContext=e},async mounted(){const{context:e}=this,t=await s();if(e.AMap=t,e.destroyed)return;const n=S(this),o=this._getContainer(!0),a=!!o.$amap;if(a)for(let e in n){const t=this.$options.props[e],a=n[e];q(this,o.$amap,t,a)}else o.$amap=new t.Map(o,n);const r=o.$amap;r.$vm=this,e.wrapper=o,e.map=r,W(this),D(this);const i=()=>{this.ready=!0,this.$amapReady.resolve(r),this.$emit("complete",this)};a?(await this.$nextTick(),i()):r.on("complete",i)},destroyed(){const{context:e}=this;if(!t._disableMapCache&&this.cacheKey){const e=this._getContainer(!1);document.body.appendChild(e),this._clear()}else e.map&&e.map.destroy();e.destroyed=!0},provide(){return{$amapContainer:this.context}},render(e){let t=this.$slots.default;return this.sync||this.ready||(t=void 0),e("div",{class:"amap-vue-container",style:"position:relative; width:100%; height:100%;"},t)}}),Y=e.extend({computed:{context(){return this.$amapContext},component(){return this.context.component},map(){return this.context.container.map},wrapper(){return this.context.container.vm},AMap(){return this.context.AMap}}}),G=w(Y).extend({inject:["$amapContainer"],amapMeta:{slot:!1,initComponent:c,add(e,t){const n=e;t.setMap(n.map)},remove(e,t){t.setMap(null)}},beforeCreate(){this.$amapReady=n(),this.$amapContext={}},created(){Object.assign(this.$amapContext,{AMap:null,ready:this.$amapReady.promise,container:this.$amapContainer,component:null,destroyed:!1})},async mounted(){const{context:e}=this,t=this.$options.amapMeta,{container:n}=e;await n.ready,e.AMap=n.AMap,t.prepare&&await t.prepare();const o=S(this);if(e.destroyed)return;const a=await t.initComponent.call(this,window.AMap,o);a.$vm=this,e.component=a,t.add.call(this,n,a),W(this),D(this),this.$amapReady.resolve(a),this.$emit("amap-ready",this)},beforeDestroy(){const{context:e}=this,{container:t,component:n}=e;if(n){I(this),this.$options.amapMeta.remove.call(this,t,n)}e.destroyed=!0},render(e){return this.$options.amapMeta.slot&&this.$slots.default?e("div",{class:"amap-vue-placeholder",style:"visibility: hidden; pointer-events: none;"},this.$slots.default):null}}),X=w(G).extend({amapMeta:{events:["click","dblclick","rightclick","mousemove","mouseover","mouseout","mousedown","mouseup","dragstart","dragging","dragend","moving","moveend","movealong","touchstart","touchmove","touchend"]},props:{visible:F({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),cursor:F("setCursor",String),zIndex:F("setzIndex",Number),bubble:F("setBubble",Boolean,void 0),clickable:F("setClickable",Boolean,void 0),draggable:F("setDraggable",Boolean,void 0),extData:F("setExtData",Object)},methods:{show:Z("show"),hide:Z("hide"),getExtData:Z("getExtData")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}});const Q=["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"],ee=["miter","round","bevel"],te=["butt","round","square"],ne=["solid","dashed"];var oe=w(X).extend({props:{position:F({type:Array,deep:!0,equals:A,setter(e,t){if(!t)return;const n=e;k(t,P(n.getPosition()))||n.setPosition([t[0],t[1]])},getter:e=>P(e.getPosition()),events:["dragging","dragend","moving","moveend"]}),topWhenClick:{type:Boolean,default:void 0},animation:F("setAnimation",String),angle:F({type:Number,equals:E,setter(e,t){void 0!==t&&e.setAngle(t)},getter:e=>e.getAngle(),events:["moving"]}),autoRotation:{type:Boolean,default:void 0},title:F("setTitle",String),anchor:F({type:String,setter:"setAnchor",validator:e=>Q.includes(e)}),offset:F({type:Array,deep:!0,equals:A,setter(e,t){const n=e;var o;t&&(k(t,(o=n.getOffset(),Array.isArray(o)?[o[0],o[1]]:[o.x,o.y]))||n.setOffset(new window.AMap.Pixel(t[0],t[1])))},transform:e=>new window.AMap.Pixel(e[0],e[1])}),raiseOnDrag:{type:Boolean,default:void 0}},methods:{moveAlong:Z("moveAlong",!0),moveTo:Z("moveTo",!0),stopMove:Z("stopMove")},beforeDestroy(){this.context.component&&this.stopMove()}});function ae(e){if(!e)return;const t={...e};return t.offset&&(t.offset=new window.AMap.Pixel(t.offset[0],t.offset[1])),t}function re(e){return"string"==typeof e?e:new window.AMap.Icon(e)}var ie=w(oe).extend({name:"AmapMarker",amapMeta:{slot:!0,async initComponent(e,t){const n={...t};return this.$slots.default&&this.$slots.default.length>0&&(n.content=this.$slots.default[0].elm),new e.Marker(n)}},props:{content:F("setContent",String),icon:F({setter(e,t){if(!t)return;const n=e,o=re(t);n.setIcon(o)},transform:re}),shadow:F("setShadow"),shape:F("setShape"),label:F({type:Object,setter(e,t){t&&e.setLabel(ae(t))},deep:!0,transform:ae})}}),se=w(G).extend({name:"AmapLabelsLayer",amapMeta:{slot:!0,initComponent:async(e,t)=>new e.LabelsLayer(t)},props:{visible:F({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:{type:Number},opacity:{type:Number},collision:{type:Boolean,default:void 0},animation:{type:Boolean,default:void 0}},provide(){return{$amapLabelsLayer:this.context}}}),pe=w(G).extend({name:"AmapLabelMarker",inject:["$amapLabelsLayer"],amapMeta:{initComponent:async(e,t)=>new e.LabelMarker(t),async add(e,t){const n=await this.$amapLabelsLayer.ready;this.$amapContext.destroyed||n.add(t)},async remove(e,t){(await this.$amapLabelsLayer.ready).remove(t)}},props:{position:F({type:Array,deep:!0,equals:A,setter(e,t){const n=e;t&&(k(t,P(n.getPosition()))||n.setPosition([t[0],t[1]]))}}),zooms:F({type:Array,deep:!0,equals:A,setter:"setZooms"}),opacity:F("setOpacity",Number),rank:{type:Number},icon:F({type:Object,setter:"setIcon",deep:!0}),text:F({type:Object,setter:"setText",deep:!0})}}),le=w(oe).extend({name:"AmapText",amapMeta:{initComponent:async(e,t)=>(t.domStyle&&(t.style=t.domStyle,delete t.domStyle),new e.Text(t))},props:{text:F("setText",String),domStyle:F({type:Object,setter(e,t){e.setStyle(t)},deep:!0})}});function ce(e){return(t,n)=>{t.setOptions({[e]:n})}}const de=w(X).extend({props:{strokeColor:F({type:String,setter:ce("strokeColor")}),strokeOpacity:F({type:Number,setter:ce("strokeOpacity")}),strokeWeight:F({type:Number,setter:ce("strokeWeight")}),strokeStyle:F({type:String,setter:ce("strokeStyle"),validator:e=>ne.includes(e)}),strokeDasharray:F({type:Array,deep:!0,equals:function(e,t){return!(!e&&t)&&(!(e&&!t)&&(e===t||e.length===t.length&&e.every((e,n)=>e===t[n])))},setter:ce("strokeDasharray")})},methods:{getBounds:Z("getBounds")}}),me=w(de).extend({props:{fillColor:F({type:String,setter:ce("fillColor")}),fillOpacity:F({type:Number,setter:ce("fillOpacity")})},methods:{contains:Z("contains")}}),ue=w(de).extend({props:{lineJoin:F({type:String,setter:ce("lineJoin"),validator:e=>ee.includes(e)}),lineCap:F({type:String,setter:ce("lineCap"),validator:e=>te.includes(e)}),showDir:F({type:Boolean,default:void 0,setter:ce("showDir")}),dirColor:F({type:String,setter:ce("dirColor")}),dirImg:F({type:String,setter:ce("dirImg")}),isOutline:F({type:Boolean,default:void 0,setter:ce("isOutline")}),outlineColor:F({type:String,setter:ce("outlineColor")}),borderWeight:F({type:Number,setter:ce("borderWeight")})},methods:{getLength:Z("getLength")}});var ye=w(me).extend({props:{center:F({type:Array,clone:!0,deep:!0,equals:A,setter(e,t){if(!t)return;const n=e;if(this.$props.draggable||this.$props.editable){if(k(t,P(n.getCenter())))return}n.setCenter(new window.AMap.LngLat(t[0],t[1]))},getter:e=>P(e.getCenter()),events:["dragging","dragend"]}),radius:F({type:Number,setter:"setRadius"})}});const he=w(Y).extend({data:()=>({$amapEditor:null}),props:{editable:F({type:Boolean,default:!1,initialize:!1})},async mounted(){await this.context.ready;const e=this.$options.amapMeta.editable;this.editable&&e.startEditing.call(this)},beforeDestroy(){const e=this.$amapEditor;if(e){this.$options.amapMeta.editable.events.forEach(t=>{e.off(t,this.$onAmapEdit)}),e.close()}},watch:{"$props.editable"(e){const t=this.$options.amapMeta.editable;e?this.context.destroyed||t.startEditing.call(this):t.endEditing.call(this)}}});var fe=w(he).extend({amapMeta:{editable:{events:[],loadEditor:c,initEditor:c,onEdit:c,async initEditing(){if(this.$amapEditor)return this.$amapEditor;const e=this.$options.amapMeta.editable,{context:t}=this;await t.container.ready,await this.$options.amapMeta.editable.loadEditor();const n=t.container.map,o=t.component,{AMap:a}=this;this.$amapEditor=await e.initEditor.call(this,a,n,o);const r=this.$onAmapEdit=e.onEdit.bind(this);return e.events.forEach(e=>{this.$amapEditor.on(e,r)}),this.$amapEditor},async startEditing(){const e=this.$options.amapMeta.editable;(await e.initEditing.call(this)).open()},endEditing(){this.$amapEditor&&this.$amapEditor.close()}}}}),ge=w(ye,fe).extend({name:"AmapCircle",amapMeta:{initComponent:async(e,t)=>new e.Circle(t),editable:{events:["end","move","adjust"],async loadEditor(){await p("AMap.CircleEditor")},async initEditor(e,t,n){return new e.CircleEditor(t,n,this.draggable)},onEdit(e){const{target:t}=e,n=t.getCenter();this.$emit("update:center",[n.lng,n.lat]),this.$emit("update:radius",t.getRadius())}}}}),ve=w(ye).extend({name:"AmapCircleMarker",amapMeta:{initComponent:async(e,t)=>new e.CircleMarker(t)}}),we=w(de,fe).extend({amapMeta:{editable:{events:["end","move","adjust"],async loadEditor(){await p("AMap.PolyEditor")},async initEditor(e,t,n){return new e.PolyEditor(t,n,this.draggable)},onEdit(e){const t=e.target.getPath().map(P);this.$emit("update:path",t)}}},props:{path:F({type:Array,setter(e,t){const n=e;if(this.$props.editable||this.$props.editable){if($(n.getPath().map(P),t))return}n.setPath(t)},getter:e=>e.getPath().map(P),clone:!0,equals:$,events:["dragging","dragend"]})}}),be=w(me,we).extend({name:"AmapPolygon",amapMeta:{initComponent:async(e,t)=>new e.Polygon(t)},methods:{getArea:Z("getArea")}}),Ce=w(we,ue).extend({name:"AmapPolyline",amapMeta:{initComponent:async(e,t)=>new e.Polyline(t)},props:{geodesic:F({type:Boolean,default:void 0,setter:ce("geodesic")})}});const Me="undefined"!=typeof BigInt64Array;function xe(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const n=e.length;if(n!=t.length)return!1;for(let o=n;0!=o--;)if(!xe(e[o],t[o]))return!1;return!0}if(e instanceof Map){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;for(const n of e.entries())if(!xe(n[1],t.get(n[0])))return!1;return!0}if(e instanceof Set){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;return!0}if(e.constructor.BYTES_PER_ELEMENT&&(e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array||Me&&(e instanceof BigInt64Array||e instanceof BigUint64Array))){const n=e.length;if(n!=t.length)return!1;for(let o=n;0!=o--;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),o=n.length;if(o!==Object.keys(t).length)return!1;for(let e=o;0!=e--;)if(!Object.prototype.hasOwnProperty.call(t,n[e]))return!1;for(let a=o;0!=a--;){const o=n[a];if(!xe(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function Ae(e){if(!e)return;return e.map(e=>{const t=[],n=e.controlPoints;return n&&t.push(...n.map(e=>P(e))),t.push(P(e)),t})}var $e=w(ue,fe).extend({name:"AmapBezierCurve",amapMeta:{initComponent:async(e,t)=>new e.BezierCurve(t),editable:{events:["end","adjust","addnode","removenode"],async loadEditor(){await p("AMap.BezierCurveEditor")},async initEditor(e,t,n){return new e.BezierCurveEditor(t,n,this.draggable)},onEdit(e){const t=e.target.getPath();this.$emit("update:path",Ae(t))}}},props:{path:F({type:Array,setter(e,t){const n=e;if(this.$props.editable||this.$props.editable){if(xe(Ae(n.getPath()),t))return}n.setPath(t)},getter:e=>Ae(e.getPath()),clone:!0,equals:xe,events:["dragging","dragend"]})}});function Ee(e,t){return!(!e||!t)&&(E(e[0][0],t[0][0])&&E(e[0][1],t[0][1])&&E(e[1][0],t[1][0])&&E(e[1][1],t[1][1]))}var ke=w(me,fe).extend({name:"AmapRectangle",amapMeta:{initComponent:async(e,t)=>new e.Rectangle(t),editable:{events:["move","end","adjust"],async loadEditor(){await p("AMap.RectangleEditor")},async initEditor(e,t,n){return new e.RectangleEditor(t,n,this.draggable)},onEdit(e){const t=j(e.target.getBounds());this.$emit("update:bounds",t)}}},props:{bounds:F({type:Array,deep:!0,setter(e,t){if(this.$props.editable||this.$props.draggable){if(Ee(j(e.getBounds()),t))return}e.setBounds(_(t))},getter:e=>j(e.getBounds()),transform:_,clone:!0,equals:Ee,events:["dragging","dragend"]})},methods:{getArea:Z("getArea")}}),Be=w(me,fe).extend({name:"AmapEllipse",amapMeta:{initComponent:async(e,t)=>new e.Ellipse(t),editable:{events:["move","end","adjust"],async loadEditor(){await p("AMap.EllipseEditor")},async initEditor(e,t,n){return new e.EllipseEditor(t,n,this.draggable)},onEdit(e){const t=P(e.target.getCenter());k(this.center,t)||this.$emit("update:center",t);const n=e.target.getRadius();k(this.radius,n)||this.$emit("update:radius",n.slice(0))}}},props:{center:F({type:Array,setter(e,t){if(this.$props.editable||this.$props.draggable){if(k(t,P(e.getCenter())))return}e.setCenter(t)},getter:e=>P(e.getCenter()),clone:!0,deep:!0,equals:k,events:["dragging","dragend"]}),radius:F({type:Array,setter(e,t){const n=e;if(this.$props.editable){if(k(t,n.getRadius()))return}n.setRadius(t)},clone:!0,deep:!0,equals:k})},methods:{getBounds(){return j(this.context.component.getBounds())}}}),Oe=w(X).extend({name:"AmapInfoWindow",amapMeta:{slot:!0,initComponent:async(e,t)=>new e.InfoWindow(t),events:["change","open","close"]},props:{isCustom:{type:Boolean,default:void 0},autoMove:{type:Boolean,default:void 0},closeWhenClickMap:{type:Boolean,default:void 0},visible:F({type:Boolean,default:!0,setter(e,t){t?this.open():this.close()}}),position:F({type:Array,deep:!0,setter(e,t){const n=e;if(!t)return;const o=n.getPosition();o&&k(t,P(o))||n.setPosition([t[0],t[1]])},getter:e=>P(e.getPosition()),equals:A}),offset:F({type:Array,transform:e=>new window.AMap.Pixel(e[0],e[1])}),anchor:F({type:String,setter:"setAnchor",validator:e=>Q.includes(e)}),showShadow:{type:Boolean,default:void 0}},methods:{open(){this.context.ready.then(e=>{const t=e,n=this.position;t.open(this.context.container.map,n)})},close(){this.context.ready.then(e=>{e.close()})},show(){this.open()},hide(){this.close()},onOpen(){this.visible||this.$emit("update:visible",!0)},onClose(){this.visible&&this.$emit("update:visible",!1)},_updateContent(){this.visible&&this.$nextTick(()=>{const e=this.$slots.default[0];e&&e.elm&&this.context.ready.then(t=>{t.setContent(e.elm)})})}},async mounted(){const e=await this.context.ready;this.visible&&(this._updateContent(),this.open()),e.on("open",this.onOpen),e.on("close",this.onClose)},watch:{visible:"_updateContent"}}),Se=w(G).extend({amapMeta:{events:["complete"]},props:{visible:F({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:F("setzIndex",Number),opacity:F({setter:"setOpacity",type:Number}),zooms:F({type:Array}),detectRetina:F({type:Boolean,default:void 0})},methods:{show:Z("show"),hide:Z("hide"),reload:Z("reload")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}}),Le=w(Se).extend({name:"AmapTileLayer",amapMeta:{initComponent:async(e,t)=>new e.TileLayer(t)},props:{tileSize:F({type:Number}),tileUrl:F({type:String,setter:"setTileUrl"}),errorUrl:{type:String},getTileUrl:{type:[String,Function]}}}),Pe=w(Se).extend({name:"AmapTileLayerSatellite",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.Satellite(t)}}),je=w(Se).extend({name:"AmapTileLayerFlexible",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.Flexible(t)},props:{createTile:{type:Function},cacheSize:{type:Number}}}),_e=w(Se).extend({name:"AmapTileLayerRoadNet",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.RoadNet(t)}}),ze=w(Se).extend({name:"AmapTileLayerTraffic",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.Traffic(t)}});const Te=["LT","RT","LB","RB"];var De=w(G).extend({amapMeta:{add(e,t){e.map.addControl(t)},remove(e,t){e.map.removeControl(t)}}}),Re=w(De).extend({name:"AmapMapType",amapMeta:{prepare:()=>p("AMap.MapType"),initComponent:async(e,t)=>new e.MapType(t)},props:{defaultType:{type:Number},showTraffic:{type:Boolean,default:void 0},showRoad:{type:Boolean,default:void 0}}}),Ie=w(De).extend({name:"AmapControlBar",amapMeta:{prepare:()=>p("AMap.ControlBar"),initComponent:async(e,t)=>new e.ControlBar(t)},props:{position:{type:Object},showZoomBar:{type:Boolean,default:void 0},showControlButton:{type:Boolean,default:void 0}}}),Ne=w(De).extend({name:"AmapOverView",amapMeta:{prepare:()=>p("AMap.OverView"),initComponent:async(e,t)=>new e.OverView(t)},props:{visible:F({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),isOpen:F({type:Boolean,default:void 0,setter(e,t){const n=e;t?n.open():n.close()}}),tileLayer:F("setTileLayer")},methods:{show:Z("show"),hide:Z("hide"),open:Z("open"),close:Z("close")},async mounted(){await this.context.ready,T(this,"open",()=>{this.$emit("update:is-open",!0)}),T(this,"close",()=>{this.$emit("update:is-open",!1)})}}),qe=w(De).extend({name:"AmapScale",amapMeta:{prepare:()=>p("AMap.Scale"),initComponent:async(e,t)=>new e.Scale(t)},props:{position:F({type:String,validator:e=>Te.includes(e)}),visible:F({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),offset:F({type:Array,transform:e=>new window.AMap.Pixel(e[0],e[1])})},methods:{show:Z("show"),hide:Z("hide"),setPosition:Z("position"),setOffset(e){this.context.component.setOffset(new window.AMap.Pixel(e[0],e[1]))}}});function We(e){return function(t,n){if(void 0===n)return;t[`${n?"show":"hide"}${e}`]()}}var Fe=w(De).extend({name:"AmapToolBar",amapMeta:{prepare:()=>p("AMap.ToolBar"),initComponent:async(e,t)=>new e.ToolBar(t),events:["location","zoomchanged"]},props:{visible:F({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),position:{type:String,validator:e=>Te.includes(e)},ruler:F({type:Boolean,default:void 0,setter:We("Ruler")}),direction:F({type:Boolean,default:void 0,setter:We("Direction")}),locate:F({type:Boolean,default:void 0,setter:We("Location")}),noIpLocale:{type:Boolean,default:void 0},liteStyle:{type:Boolean,default:void 0},autoPosition:{type:Boolean,default:void 0}},methods:{show:Z("show"),hide:Z("hide"),doLocation:Z("doLocation"),getLocation(){const e=this.context.component.getLocation();if(e)return P(e)}}});function Ze(e,t,n){if(!e)return n;var o,a;if(Array.isArray(t)&&(o=t.slice(0)),"string"==typeof t&&(o=t.split(".")),"symbol"==typeof t&&(o=[t]),!Array.isArray(o))throw new Error("props arg must be an array, a string or a symbol");for(;o.length;){if(a=o.shift(),!e)return n;if(void 0===(e=e[a]))return n}return e}const Ue=ie.sealedOptions,Ve=e.extend({props:Ue.props});let Ke=void 0;function He(e,t){Ke||(Ke=document.createElement("div"));const n=e;return n._props=t,n._vnode=null,n.$mount(Ke),n._vnode.elm}function Je(e,t,n){const o=e[t];Array.isArray(o)&&(e[t]=new n(o[0],o[1]))}function Ye(e){return e&&0!==e.length?e.map(e=>{const t={...e};return Je(t,"size",window.AMap.Size),Je(t,"offset",window.AMap.Pixel),Je(t,"imageOffset",window.AMap.Pixel),t}):e}var Ge=w(G).extend({name:"AmapMarkerCluster",amapMeta:{prepare:()=>p("AMap.MarkerClusterer"),async initComponent(e,t){return this.$scopedSlots.cluster&&(t.renderClusterMarker=this._renderCluster),new e.MarkerClusterer(this.map,[],t)},events:["click"]},data:()=>({_mcc:null}),props:{data:F({type:Array,required:!0,initialize:!1}),keyProp:F({type:[String,Function],default:"key",initialize:!1}),positionProp:F({type:[String,Function],default:"position",initialize:!1}),gridSize:F("setGridSize",Number),minClusterSize:F("setMinClusterSize",Number),maxZoom:F("setMaxZoom",Number),averageCenter:F({type:Boolean,default:void 0,setter:"setAverageCenter"}),styles:F({type:Array,setter(e,t){e.setStyles(Ye(t))},transform:Ye}),zoomOnClick:F({type:Boolean,default:void 0}),markerOptions:F({type:Function,initialize:!1}),clusterOptions:F({type:Function,initialize:!1})},mounted(){const t=function(e,t,n){let o,a,r,i,s;function p(){var l=Date.now()-i;l<t&&l>=0?o=setTimeout(p,t-l):(o=null,n||(s=e.apply(r,a),r=a=null))}null==t&&(t=100);var l=function(...l){r=this,a=l,i=Date.now();var c=n&&!o;return o||(o=setTimeout(p,t)),c&&(s=e.apply(r,a),r=a=null),s};return l.clear=function(){o&&(clearTimeout(o),o=null)},l.flush=function(){o&&(s=e.apply(r,a),r=a=null,clearTimeout(o),o=null)},l}(this._onDataChange,100),n=this.$scopedSlots.marker,o=this.$scopedSlots.cluster;this.context.ready.then(()=>{this._onDataChange()}),this._mcc={markers:new Map,clusters:new Map,MarkerRenderer:e.extend({name:"AmapMarkerClusterMarkerRenderer",props:{point:{type:Object}},render(){if(!n)return null;return Ze(n(this.point),"0",null)}}),ClusterRenderer:e.extend({name:"AmapMarkerClusterClusterRenderer",props:{context:{type:Object}},render(){if(!o)return null;return Ze(o(this.context),"0",null)}}),dummy:new Ve},this._mcc.marker=new this._mcc.MarkerRenderer,this._mcc.cluster=new this._mcc.ClusterRenderer,this.$watch("data",{handler:t})},beforeDestroy(){this._mcc.markers.clear()},methods:{_getKey(e,t){const{keyProp:n}=this;return n&&("$index"!==n||"$index"in e)?"function"==typeof n?n(e):e[n]:t},_getPosition(e){const{positionProp:t}=this;return"function"==typeof t?t(e):e[t]},async _onDataChange(){const{data:e}=this;if(await this.context.ready,this.context.destroyed)return;y("Render Markers");const t=e.map((e,t)=>this._getMarker(e,t));h("Render Markers"),y("Set Markers"),this.component.setMarkers(t),h("Set Markers")},_renderMarkerContent(e){if(this.$scopedSlots.marker)return He(this._mcc.marker,{point:e})},_getMarker(e,t){const n=this._getKey(e,t),o=this._mcc.markers;if(o.has(n))return o.get(n);const a={};this.positionProp&&(a.position=this._getPosition(e)),"function"==typeof this.markerOptions&&Object.assign(a,this.markerOptions(e));const r=S(this,Ue.props,a,!0),i=this._renderMarkerContent(e);i&&(r.content=i);const s=new window.AMap.Marker(r);return o.set(n,s),s},_renderCluster(e){const t=He(this._mcc.cluster,{context:e});e.marker.setContent(t);const n={};"function"==typeof this.clusterOptions&&Object.assign(n,this.clusterOptions(e));const o=Object.keys(n);if(o.length>0){const{dummy:t}=this._mcc;for(let a=0;a<o.length;++a){const r=o[a],i=n[r],s=Ue.props[r];void 0!==s&&q(t,e.marker,s,i)}}}},render:e=>null});const Xe=ie.sealedOptions,Qe=Ce.sealedOptions,et=be.sealedOptions,tt=ke.sealedOptions,nt=ge.sealedOptions;var ot=w(G).extend({amapMeta:{prepare:()=>p("AMap.MouseTool"),async initComponent(e){return new e.MouseTool(this.map)},add(){},remove(){}},props:{mode:F({type:String,default:"none"}),clearWhenClose:{type:Boolean,default:!0},options:{type:Object}},data:()=>({drawingMode:void 0}),methods:{close(e){this.component.close(e)},draw(){if(this.mode===this.drawingMode)return;const{mode:e}=this,t=this.component;switch(e){case"none":this.close(this.clearWhenClose);break;case"marker":t.marker(S(this,Xe.props,this.options||{}));break;case"polyline":t.polyline(S(this,Qe.props,this.options||{}));break;case"polygon":t.polygon(S(this,et.props,this.options||{}));break;case"rectangle":t.rectangle(S(this,tt.props,this.options||{}));break;case"circle":t.circle(S(this,nt.props,this.options||{}));break;case"rule":t.rule(S(this,et.props,this.options||{}));break;case"measureArea":t.measureArea(S(this,et.props,this.options||{}));break;case"rectZoomIn":t.rectZoomIn(S(this,et.props,this.options||{}));break;case"rectZoomOut":t.rectZoomOut(S(this,et.props,this.options||{}))}this.drawingMode=e},_onDraw(e){if(this.mode!==this.drawingMode)return this.close(!0),void this.draw();const t=e.obj,n=this.drawingMode;let o=t;switch(n){case"marker":o=P(t.getPosition());break;case"polyline":case"polygon":o=t.getPath().map(e=>P(e));break;case"rectangle":o=j(t.getBounds());break;case"circle":o={center:P(t.getCenter()),radius:t.getRadius()};break;case"rule":o={path:t.getPath().map(e=>P(e)),length:t.getLength()};break;case"measureArea":o={path:t.getPath().map(e=>P(e)),area:t.getArea()}}this.$emit("draw",n,o),this.$emit("update:mode","none")}},async mounted(){if(await this.context.ready,this.context.destroyed)return;this.component.on("draw",this._onDraw),this.$watch("mode",async e=>{"none"!==e&&"none"!==this.drawingMode&&this.close(!0),this.draw()},{immediate:!0})}}),at=w(G).extend({amapMeta:{events:["complete"]},props:{visible:F({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:F("setzIndex",Number),opacity:F({setter:"setOpacity",type:Number}),zooms:F({type:Array})},methods:{show:Z("show"),hide:Z("hide")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}}),rt=w(at).extend({name:"AmapImageLayer",amapMeta:{initComponent:async(e,t)=>new e.ImageLayer(t)},props:{bounds:F({type:Array,transform:_,deep:!0,setter(e,t){e.setBounds(_(t))}}),url:F({type:String,setter:"setImageUrl"})},methods:{getElement:Z("getElement")}}),it=w(at).extend({name:"AmapVideoLayer",amapMeta:{initComponent:async(e,t)=>new e.VideoLayer(t)},props:{autoplay:{type:Boolean},loop:{type:Boolean},bounds:F({type:Array,transform:_}),url:F({type:[String,Array],setter:"setVideoUrl"})},methods:{getElement:Z("getElement")}}),st=w(at).extend({name:"AmapCanvasLayer",amapMeta:{slot:!0,async initComponent(e,t){const n=Ze(this,"$slots.default.0.elm");if(!n||"CANVAS"!==n.tagName)throw this.$amapLogger.warn("slot内容必须是canvas"),new Error;return t.canvas=n,new e.CanvasLayer(t)}},props:{bounds:F({type:Array,transform:_})},methods:{reFresh:Z("reFresh")}}),pt=w(at).extend({name:"AmapCustomLayer",amapMeta:{slot:!0,async initComponent(e,t){const n=Ze(this,"$slots.default.0.elm",null),o=new e.CustomLayer(n,t);return this.render&&(o.render=this.render),o}},props:{render:F({type:Function,setter(e,t){e.render=t}})}}),lt=w(G).extend({amapMeta:{events:["complete"]},props:{visible:F({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:F("setzIndex",Number),opacity:F({setter:"setOpacity",type:Number})},methods:{show:Z("show"),hide:Z("hide")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}}),ct=w(lt).extend({name:"AmapDistrictLayerWorld",amapMeta:{prepare:()=>p("AMap.DistrictLayer"),initComponent:async(e,t)=>new e.DistrictLayer.World(t)},props:{styles:F({type:Object,setter:"setStyles"})},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}}),dt=w(lt).extend({name:"AmapDistrictLayerCountry",amapMeta:{prepare:()=>p("AMap.DistrictLayer"),initComponent:async(e,t)=>("soc"in t&&(t.SOC=t.soc,delete t.soc),new e.DistrictLayer.Country(t))},props:{styles:F({type:Object,setter:"setStyles"}),soc:F({type:String,setter:"setSOC"}),depth:{type:Number}},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}}),mt=w(lt).extend({name:"AmapDistrictLayerProvince",amapMeta:{prepare:()=>p("AMap.DistrictLayer"),initComponent:async(e,t)=>("soc"in t&&(t.SOC=t.soc,delete t.soc),new e.DistrictLayer.Province(t))},props:{styles:F({type:Object,setter:"setStyles"}),depth:{type:Number},adcode:F({type:Array})},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}}),ut={install(e){e.component("amap",J),e.component("amap-marker",ie),e.component("amap-labels-layer",se),e.component("amap-label-marker",pe),e.component("amap-text",le),e.component("amap-circle",ge),e.component("amap-circle-marker",ve),e.component("amap-polygon",be),e.component("amap-polyline",Ce),e.component("amap-bezier-curve",$e),e.component("amap-rectangle",ke),e.component("amap-ellipse",Be),e.component("amap-info-window",Oe),e.component("amap-tile-layer",Le),e.component("amap-tile-layer-satellite",Pe),e.component("amap-tile-layer-road-net",_e),e.component("amap-tile-layer-traffic",ze),e.component("amap-tile-layer-flexible",je),e.component("amap-map-type",Re),e.component("amap-control-bar",Ie),e.component("amap-over-view",Ne),e.component("amap-scale",qe),e.component("amap-tool-bar",Fe),e.component("amap-marker-clusterer",Ge),e.component("amap-mouse-tool",ot),e.component("amap-image-layer",rt),e.component("amap-video-layer",it),e.component("amap-canvas-layer",st),e.component("amap-custom-layer",pt),e.component("amap-district-layer-world",ct),e.component("amap-district-layer-country",dt),e.component("amap-district-layer-province",mt)},config:t,loadAMap:s,loadPlugins:p,withAmap:l,Amap:J,Marker:ie,LabelsLayer:se,LabelMarker:pe,Text:le,Circle:ge,CircleMarker:ve,Polygon:be,Polyline:Ce,BezierCurve:$e,Rectangle:ke,Ellipse:Be,InfoWindow:Oe,TileLayer:Le,Satellite:Pe,Flexible:je,RoadNet:_e,Traffic:ze,MapType:Re,ControlBar:Ie,OverView:Ne,Scale:qe,ToolBar:Fe,MarkerClusterer:Ge,MouseTool:ot,ImageLayer:rt,VideoLayer:it,CanvasLayer:st,CustomLayer:pt,DistrictLayerWorld:ct,DistrictLayerCountry:dt,DistrictLayerProvince:mt};export default ut;export{J as Amap,$e as BezierCurve,st as CanvasLayer,ge as Circle,ve as CircleMarker,Ie as ControlBar,pt as CustomLayer,dt as DistrictLayerCountry,mt as DistrictLayerProvince,ct as DistrictLayerWorld,Be as Ellipse,je as Flexible,rt as ImageLayer,Oe as InfoWindow,pe as LabelMarker,se as LabelsLayer,Re as MapType,ie as Marker,Ge as MarkerClusterer,ot as MouseTool,Ne as OverView,be as Polygon,Ce as Polyline,ke as Rectangle,_e as RoadNet,Pe as Satellite,qe as Scale,le as Text,Le as TileLayer,Fe as ToolBar,ze as Traffic,it as VideoLayer,t as config,s as loadAMap,p as loadPlugins,l as withAmap}; | ||
import e from"vue";var t={_prefix:"https://webapi.amap.com/maps",_disableMapCache:!1,verbose:!1,version:"1.4.15",key:"",plugins:[]};function n(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}const o=n();let a=!1,r=!1;const i=o.promise;function s(){if(!r){if(r=!0,window.AMap)return o.resolve(window.AMap),i;const e=document.createElement("script"),n=`amap_vue_${Date.now()}_${Math.ceil(1e4*Math.random())}`,s=()=>{a||(a=!0,o.resolve(window.AMap))};window[n]=s;const p=function(e){const t=[];for(const n in e)void 0!==e[n]&&null!==e[n]&&t.push(`${n}=${encodeURIComponent(e[n])}`);return t.join("&")}({v:t.version,key:t.key,callback:n,plugin:t.plugins.join(",")}),l=`${t._prefix}?${p}`;e.src=l,document.body.appendChild(e)}return i}function p(e){return new Promise(t=>{window.AMap.plugin(e,()=>{t()})})}var l=e.extend({inject:["$amapContainer"],computed:{map(){return this.$amapContainer.map}}});function c(e){throw new Error(e)}function d(e,...t){const[n,...o]=t;if(!n)return e;const a=new Set(e);return n.forEach(t=>{a.has(t)||e.push(t)}),d(e,...o)}const m=Object.prototype.hasOwnProperty;function u(e){try{if(e.constructor&&!m.call(e,"constructor")&&!m.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}let t;for(t in e);return void 0===t||m.call(e,t)}function h(e){t.verbose&&console.time(e)}function y(e){t.verbose&&console.timeEnd(e)}function f(e,n,o){t.verbose&&"function"==typeof console[n]&&(e&&e.$options&&e.$options.name&&(o=[`[${e.$options.name}]`,...o]),console[n](...o))}function g(...e){f(this,"warn",e)}function v(...e){f(this,"debug",e)}function w(...t){return e.extend({mixins:t||[]})}function b(e,t){return null!=t&&e instanceof t}function C(e,t,n,o,a){"object"==typeof t&&(n=t.depth,o=t.prototype,a=t.includeNonEnumerable,t=t.circular);let r=[],i=[];return void 0===t&&(t=!0),void 0===n&&(n=1/0),function e(n,s){if(null===n)return null;if(0===s)return n;let p,l;if("object"!=typeof n)return n;if(b(n,Map))p=new Map;else if(b(n,Set))p=new Set;else if(b(n,Promise))p=new Promise((function(t,o){n.then((function(n){t(e(n,s-1))}),(function(t){o(e(t,s-1))}))}));else if(C.__isArray(n))p=[];else if(C.__isRegExp(n))p=new RegExp(n.source,x(n)),n.lastIndex&&(p.lastIndex=n.lastIndex);else if(C.__isDate(n))p=new Date(n.getTime());else if(b(n,Error))p=Object.create(n);else if(void 0===o){if(l=Object.getPrototypeOf(n),b(l,Object))return n;p=Object.create(l)}else p=Object.create(o),l=o;if(t){let e=r.indexOf(n);if(-1!=e)return i[e];r.push(n),i.push(p)}b(n,Map)&&n.forEach((function(t,n){let o=e(n,s-1),a=e(t,s-1);p.set(o,a)})),b(n,Set)&&n.forEach((function(t){let n=e(t,s-1);p.add(n)}));for(let t in n){Object.getOwnPropertyDescriptor(n,t)&&(p[t]=e(n[t],s-1));try{if(void 0===Object.getOwnPropertyDescriptor(n,t).set)continue;p[t]=e(n[t],s-1)}catch(e){if(e instanceof TypeError)continue;if(e instanceof ReferenceError)continue}}if(Object.getOwnPropertySymbols){let t=Object.getOwnPropertySymbols(n);for(let o=0;o<t.length;o++){let r=t[o],i=Object.getOwnPropertyDescriptor(n,r);(!i||i.enumerable||a)&&(p[r]=e(n[r],s-1),Object.defineProperty(p,r,i))}}if(a){let t=Object.getOwnPropertyNames(n);for(let o=0;o<t.length;o++){let a=t[o],r=Object.getOwnPropertyDescriptor(n,a);r&&r.enumerable||(p[a]=e(n[a],s-1),Object.defineProperty(p,a,r))}}return p}(e,n)}function M(e){return Object.prototype.toString.call(e)}function x(e){let t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}function A(e,t){return!(!e&&t)&&(!(e&&!t)&&(e===t||e[0]===t[0]&&e[1]===t[1]))}function $(e,t){return!(!e&&t)&&(!(e&&!t)&&(!e&&!t||(e===t||e.length===t.length&&e.every((e,n)=>A(e,t[n])))))}e.mixin({beforeCreate(){var e;"amapMeta"in this.$options&&(this.$amapLogger=(e=this,{warn:g.bind(e),debug:v.bind(e)}))}}),e.config.optionMergeStrategies.amapMeta=(e,t)=>function e(t,n){const o={...t};for(const a in n){const r=n[a],i=t[a];Array.isArray(r)?o[a]=d(i||[],r):u(r)?o[a]=e(i||{},r):o[a]=r}return o}(e||{},t||{}),C.clonePrototype=function(e){if(null===e)return null;let t=function(){};return t.prototype=e,new t},C.__objToStr=M,C.__isDate=function(e){return"object"==typeof e&&"[object Date]"===M(e)},C.__isArray=function(e){return"object"==typeof e&&"[object Array]"===M(e)},C.__isRegExp=function(e){return"object"==typeof e&&"[object RegExp]"===M(e)},C.__getRegExpFlags=x;function E(e,t,n=1e-7){return Math.abs(e-t)<n}function k(e,t){return!(!e&&t)&&(!(e&&!t)&&(e===t||E(e[0],t[0])&&E(e[1],t[1])))}const B=new WeakMap;function O(e,t){let n=B.get(t);if(!n){n=new Map,B.set(t,n);for(const e in t){const o=t[e];!1!==o.initialize&&n.set(e,o)}}return n.get(e)}function S(e,t,n,o){void 0===t&&(t=e.$options.props),void 0===n&&(n=e.$props);const a={};for(const o in n){const r=n[o];if(void 0===r)continue;const i=O(o,t);i&&(a[o]=i.transform?i.transform.call(e,r):r)}return o?a:C(a)}function L(e){return e.map?e.map:e.component}function P(e){return Array.isArray(e)?[e[0],e[1]]:[e.lng,e.lat]}function j(e){return Array.isArray(e)?e:e.southWest?[[e.southWest.lng,e.southWest.lat],[e.northEast.lng,e.northEast.lat]]:[[e.southwest.lng,e.southwest.lat],[e.northeast.lng,e.northeast.lat]]}function _(e){const t=new window.AMap.LngLat(e[0][0],e[0][1]),n=new window.AMap.LngLat(e[1][0],e[1][1]);return new window.AMap.Bounds(t,n)}function z(e,t,n){const o=e.$amapEvents||(e.$amapEvents={});(o[t]||(o[t]=[])).push(n)}function T(e,t,n){z(e,t,n),L(e.$amapContext).on(t,n)}function D(e){const{events:t=[]}=e.$options.amapMeta,n=L(e.$amapContext);t.forEach(t=>{e.$watch("$listeners."+t,(o,a)=>{a&&n.off(t,a),o&&(z(e,t,o),n.on(t,o))},{immediate:!0})})}function R(e,t,n,o){o||(o=L(e.$amapContext));const{events:a=[]}=n;a.forEach(a=>{const{getter:r}=n;if(!r)return;const i=a=>{const i="function"==typeof r?r.call(e,o,a):o[r](),s=e.$props[t];if("function"==typeof n.equals){if(n.equals(i,s))return}else if(i===s)return;e.$emit("update:"+t,i)};z(e,a,i),o.on(a,i)})}function I(e){const t=L(e.$amapContext),n=e.$amapEvents||{};for(const e in n){n[e].forEach(n=>{t.off(e,n)})}}const N={equals:function(e,t){return e===t},clone:!1};function q(e,t,n,o){const{setter:a}=n;a&&("function"==typeof a?a.call(e,t,o):"string"==typeof a&&(n.clone&&(o=C(o)),t[a](o)))}function W(e,t,n){t||(t=L(e.$amapContext)),n||(n=e.$options.props);for(const o in n){const a=n[o],{setter:r}=a;if(!r)continue;const i={deep:!!a.deep};e.$amapLogger.debug("watch",o,i),e.$watch("$props."+o,(n,o)=>{if(!i.deep||i.deep&&n!==o)if("function"==typeof a.equals){if(a.equals(n,o))return}else if(n===o)return;q(e,t,a,n)},i),a.events&&R(e,o,a,t)}}function F(e,t,n){if("string"==typeof e){const o=e,a={...N,setter:o};return t&&(a.type=t),arguments.length>=3&&(a.default=n),a}return{...N,...e}}function Z(e,t){return function(...n){const o=L(this.$amapContext);return o?"function"!=typeof o[e]?this.$amapLogger.warn(e+" is not a function."):(t&&(n=C(n)),o[e](...n)):this.$amapLogger.warn(`calling ${e} on ${o}`)}}function U(e){return e&&"function"==typeof e.then}function V(e){if(!e)return e;if(U(e))return e;if(e.$amapContext&&e.$amapContext.ready)return e.$amapContext.ready;if(Array.isArray(e))return Promise.all(e.map(V));if(u(e)){const n={},o=Object.keys(e),a=[];function t(e,t){n[t]=void 0,a.push(e.then(e=>{n[t]=e}))}for(let r=0;r<o.length;r++){const i=o[r],s=V(e[i]);s&&U(a)?t(s,i):n[i]=e[i]}return Promise.all(a).then((function(){return n}))}return e}function K(e){return function(t,n){t.setStatus({[e]:n})}}var H,J=e.extend({name:"Amap",amapMeta:{events:["click","dblclick","rightclick","mapmove","movestart","moveend","hotspotclick","hotspotover","hotspotout","mousemove","mousewheel","mouseover","mouseup","mousedown","zoomchange","zoomstart","zoomend","dragstart","dragging","dragend","resize","touchstart","touchmove","touchend"]},props:{cacheKey:F({type:String,initialize:!1}),sync:F({type:Boolean,default:!1,initialize:!1}),showIndoorMap:F({type:Boolean,default:void 0,setter:K("showIndoorMap")}),resizeEnable:F({type:Boolean,default:void 0,setter:K("resizeEnable")}),dragEnable:F({type:Boolean,default:void 0,setter:K("dragEnable")}),pitchEnable:F({type:Boolean,default:void 0,setter:K("pitchEnable")}),rotateEnable:F({type:Boolean,default:void 0,setter:K("rotateEnable")}),zoomEnable:F({type:Boolean,default:void 0,setter:K("zoomEnable")}),doubleClickZoom:F({type:Boolean,default:void 0,setter:K("doubleClickZoom")}),keyboardEnable:F({type:Boolean,default:void 0,setter:K("keyboardEnable")}),jogEnable:F({type:Boolean,default:void 0,setter:K("jogEnable")}),scrollWheel:F({type:Boolean,default:void 0,setter:K("scrollWheel")}),animateEnable:F({type:Boolean,default:void 0,setter:K("animateEnable")}),isHotspot:F({type:Boolean,default:void 0,setter:K("isHotspot")}),touchEnable:F({type:Boolean,default:void 0,setter:K("touchEnable")}),viewMode:{type:String},showBuildingBlock:{type:Boolean,default:void 0},expandZoomRange:{type:Boolean,default:void 0},zooms:{type:Array},zoom:F({type:Number,equals:E,setter(e,t){const n=e;void 0!==t&&(E(n.getZoom(),t)||n.setZoom(t))},getter:"getZoom",events:["zoomchange","zoomend"]}),center:F({type:Array,deep:!0,equals:A,setter(e,t){const n=e;t&&(k(t,P(n.getCenter()))||n.setCenter([t[0],t[1]]))},getter:e=>P(e.getCenter()),events:["mapmove","moveend"]}),pitch:F({type:Number,equals:E,setter:"setPitch",getter:"getPitch",events:["dragging","dragend","moveend","pitchend"]}),rotation:F({type:Number,equals:E,setter:"setRotation",getter:"getRotation",events:["dragging","dragend","moveend","rotateend"]}),lang:F("setLang",String),mapStyle:F("setMapStyle",String),features:F("setFeatures",Array),skyColor:{type:String}},data:()=>({ready:!1}),computed:{context(){return this.$amapContext},map(){return this.context.map}},methods:{_clear(){const{context:e}=this;e.ready.then(()=>{I(this),this.clearMap(),this.clearInfoWindow()})},_getContainer(e){const{cacheKey:n}=this;if(!t._disableMapCache&&n){const t="amap-vue-container-inner-"+n;let o=document.getElementById(t)||this.$el.querySelector("#"+t);return o||(o=document.createElement("div"),o.className="amap-vue-container-inner",o.setAttribute("id",t),o.setAttribute("style","position:relative; width:100%; height:100%;")),e?(this.$el.insertAdjacentElement("afterbegin",o),o.style.display="block",o.style.pointerEvents="initial"):(o.style.display="none",o.style.pointerEvents="none"),o}return this.$el},clearMap:Z("clearMap"),clearInfoWindow:Z("clearInfoWindow"),setCenter:Z("setCenter"),setCity:Z("setCity"),getBounds(){const e=this.context.map.getBounds();return e.path?e.path.map(e=>[e[0],e[1]]):j(this.context.map.getBounds())},getSize:Z("getSize"),getResolution:Z("getResolution"),setFitView:(H="setFitView",async function(...e){const t=this.$amapContext;await t.ready;const n=L(t);if(!n)return this.$amapLogger.warn(`calling ${H} on ${n}`);if("function"!=typeof n[H])return this.$amapLogger.warn(H+" is not a function.");const o=e.map(V),a=await Promise.all(o);return t.destroyed?void 0:n[H](...a)}),lngLatToContainer(e){const t=this.map.lngLatToContainer(e);return[t.getX(),t.getY()]}},beforeCreate(){s(),this.$amapReady=n();const e={AMap:null,wrapper:null,ready:this.$amapReady.promise,map:null,vm:this,destroyed:!1};this.$amapContext=e},async mounted(){const{context:e}=this,t=await s();if(e.AMap=t,e.destroyed)return;const n=S(this),o=this._getContainer(!0),a=!!o.$amap;if(a)for(let e in n){const t=this.$options.props[e],a=n[e];q(this,o.$amap,t,a)}else o.$amap=new t.Map(o,n);const r=o.$amap;r.$vm=this,e.wrapper=o,e.map=r,W(this),D(this);const i=()=>{this.ready=!0,this.$amapReady.resolve(r),this.$emit("complete",this)};a?(await this.$nextTick(),i()):r.on("complete",i)},destroyed(){const{context:e}=this;if(!t._disableMapCache&&this.cacheKey){const e=this._getContainer(!1);document.body.appendChild(e),this._clear()}else e.map&&e.map.destroy();e.destroyed=!0},provide(){return{$amapContainer:this.context}},render(e){let t=this.$slots.default;return this.sync||this.ready||(t=void 0),e("div",{class:"amap-vue-container",style:"position:relative; width:100%; height:100%;"},t)}}),Y=e.extend({computed:{context(){return this.$amapContext},component(){return this.context.component},map(){return this.context.container.map},wrapper(){return this.context.container.vm},AMap(){return this.context.AMap}}}),G=w(Y).extend({inject:["$amapContainer"],amapMeta:{slot:!1,initComponent:c,add(e,t){const n=e;t.setMap(n.map)},remove(e,t){t.setMap(null)}},beforeCreate(){this.$amapReady=n(),this.$amapContext={}},created(){Object.assign(this.$amapContext,{AMap:null,ready:this.$amapReady.promise,container:this.$amapContainer,component:null,destroyed:!1})},async mounted(){const{context:e}=this,t=this.$options.amapMeta,{container:n}=e;await n.ready,e.AMap=n.AMap,t.prepare&&await t.prepare();const o=S(this);if(e.destroyed)return;const a=await t.initComponent.call(this,window.AMap,o);a.$vm=this,e.component=a,t.add.call(this,n,a),W(this),D(this),this.$amapReady.resolve(a),this.$emit("amap-ready",this)},beforeDestroy(){const{context:e}=this,{container:t,component:n}=e;if(n){I(this),this.$options.amapMeta.remove.call(this,t,n)}e.destroyed=!0},render(e){return this.$options.amapMeta.slot&&this.$slots.default?e("div",{class:"amap-vue-placeholder",style:"visibility: hidden; pointer-events: none;"},this.$slots.default):null}}),X=w(G).extend({amapMeta:{events:["click","dblclick","rightclick","mousemove","mouseover","mouseout","mousedown","mouseup","dragstart","dragging","dragend","moving","moveend","movealong","touchstart","touchmove","touchend"]},props:{visible:F({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),cursor:F("setCursor",String),zIndex:F("setzIndex",Number),bubble:F("setBubble",Boolean,void 0),clickable:F("setClickable",Boolean,void 0),draggable:F("setDraggable",Boolean,void 0),extData:F("setExtData",Object)},methods:{show:Z("show"),hide:Z("hide"),getExtData:Z("getExtData")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}});const Q=["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"],ee=["miter","round","bevel"],te=["butt","round","square"],ne=["solid","dashed"];var oe=w(X).extend({props:{position:F({type:Array,deep:!0,equals:A,setter(e,t){if(!t)return;const n=e;k(t,P(n.getPosition()))||n.setPosition([t[0],t[1]])},getter:e=>P(e.getPosition()),events:["dragging","dragend","moving","moveend"]}),topWhenClick:{type:Boolean,default:void 0},animation:F("setAnimation",String),angle:F({type:Number,equals:E,setter(e,t){void 0!==t&&e.setAngle(t)},getter:e=>e.getAngle(),events:["moving"]}),autoRotation:{type:Boolean,default:void 0},title:F("setTitle",String),anchor:F({type:String,setter:"setAnchor",validator:e=>Q.includes(e)}),offset:F({type:Array,deep:!0,equals:A,setter(e,t){const n=e;var o;t&&(k(t,(o=n.getOffset(),Array.isArray(o)?[o[0],o[1]]:[o.x,o.y]))||n.setOffset(new window.AMap.Pixel(t[0],t[1])))},transform:e=>new window.AMap.Pixel(e[0],e[1])}),raiseOnDrag:{type:Boolean,default:void 0}},methods:{moveAlong:Z("moveAlong",!0),moveTo:Z("moveTo",!0),stopMove:Z("stopMove")},beforeDestroy(){this.context.component&&this.stopMove()}});function ae(e){if(!e)return;const t={...e};return t.offset&&(t.offset=new window.AMap.Pixel(t.offset[0],t.offset[1])),t}function re(e){return"string"==typeof e?e:new window.AMap.Icon(e)}var ie=w(oe).extend({name:"AmapMarker",amapMeta:{slot:!0,async initComponent(e,t){const n={...t};return this.$slots.default&&this.$slots.default.length>0&&(n.content=this.$slots.default[0].elm),new e.Marker(n)}},props:{content:F("setContent",String),icon:F({setter(e,t){if(!t)return;const n=e,o=re(t);n.setIcon(o)},transform:re}),shadow:F("setShadow"),shape:F("setShape"),label:F({type:Object,setter(e,t){t&&e.setLabel(ae(t))},deep:!0,transform:ae})}}),se=w(G).extend({name:"AmapLabelsLayer",amapMeta:{slot:!0,initComponent:async(e,t)=>new e.LabelsLayer(t)},props:{visible:F({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:{type:Number},opacity:{type:Number},collision:{type:Boolean,default:void 0},animation:{type:Boolean,default:void 0}},provide(){return{$amapLabelsLayer:this.context}}}),pe=w(G).extend({name:"AmapLabelMarker",inject:["$amapLabelsLayer"],amapMeta:{initComponent:async(e,t)=>new e.LabelMarker(t),async add(e,t){const n=await this.$amapLabelsLayer.ready;this.$amapContext.destroyed||n.add(t)},async remove(e,t){(await this.$amapLabelsLayer.ready).remove(t)},events:["click","mouseover","mousemove","mouseput","mousedown","mouseup","touchstart","touchend"]},props:{position:F({type:Array,deep:!0,equals:A,setter(e,t){const n=e;t&&(k(t,P(n.getPosition()))||n.setPosition([t[0],t[1]]))}}),zooms:F({type:Array,deep:!0,equals:A,setter:"setZooms"}),opacity:F("setOpacity",Number),rank:{type:Number},icon:F({type:Object,setter:"setIcon",deep:!0}),text:F({type:Object,setter:"setText",deep:!0})}}),le=w(oe).extend({name:"AmapText",amapMeta:{initComponent:async(e,t)=>(t.domStyle&&(t.style=t.domStyle,delete t.domStyle),new e.Text(t))},props:{text:F("setText",String),domStyle:F({type:Object,setter(e,t){e.setStyle(t)},deep:!0})}});function ce(e){return(t,n)=>{t.setOptions({[e]:n})}}const de=w(X).extend({props:{strokeColor:F({type:String,setter:ce("strokeColor")}),strokeOpacity:F({type:Number,setter:ce("strokeOpacity")}),strokeWeight:F({type:Number,setter:ce("strokeWeight")}),strokeStyle:F({type:String,setter:ce("strokeStyle"),validator:e=>ne.includes(e)}),strokeDasharray:F({type:Array,deep:!0,equals:function(e,t){return!(!e&&t)&&(!(e&&!t)&&(e===t||e.length===t.length&&e.every((e,n)=>e===t[n])))},setter:ce("strokeDasharray")})},methods:{getBounds:Z("getBounds")}}),me=w(de).extend({props:{fillColor:F({type:String,setter:ce("fillColor")}),fillOpacity:F({type:Number,setter:ce("fillOpacity")})},methods:{contains:Z("contains")}}),ue=w(de).extend({props:{lineJoin:F({type:String,setter:ce("lineJoin"),validator:e=>ee.includes(e)}),lineCap:F({type:String,setter:ce("lineCap"),validator:e=>te.includes(e)}),showDir:F({type:Boolean,default:void 0,setter:ce("showDir")}),dirColor:F({type:String,setter:ce("dirColor")}),dirImg:F({type:String,setter:ce("dirImg")}),isOutline:F({type:Boolean,default:void 0,setter:ce("isOutline")}),outlineColor:F({type:String,setter:ce("outlineColor")}),borderWeight:F({type:Number,setter:ce("borderWeight")})},methods:{getLength:Z("getLength")}});var he=w(me).extend({props:{center:F({type:Array,clone:!0,deep:!0,equals:A,setter(e,t){if(!t)return;const n=e;if(this.$props.draggable||this.$props.editable){if(k(t,P(n.getCenter())))return}n.setCenter(new window.AMap.LngLat(t[0],t[1]))},getter:e=>P(e.getCenter()),events:["dragging","dragend"]}),radius:F({type:Number,setter:"setRadius"})}});const ye=w(Y).extend({data:()=>({$amapEditor:null}),props:{editable:F({type:Boolean,default:!1,initialize:!1})},async mounted(){await this.context.ready;const e=this.$options.amapMeta.editable;this.editable&&e.startEditing.call(this)},beforeDestroy(){const e=this.$amapEditor;if(e){this.$options.amapMeta.editable.events.forEach(t=>{e.off(t,this.$onAmapEdit)}),e.close()}},watch:{"$props.editable"(e){const t=this.$options.amapMeta.editable;e?this.context.destroyed||t.startEditing.call(this):t.endEditing.call(this)}}});var fe=w(ye).extend({amapMeta:{editable:{events:[],loadEditor:c,initEditor:c,onEdit:c,async initEditing(){if(this.$amapEditor)return this.$amapEditor;const e=this.$options.amapMeta.editable,{context:t}=this;await t.container.ready,await this.$options.amapMeta.editable.loadEditor();const n=t.container.map,o=t.component,{AMap:a}=this;this.$amapEditor=await e.initEditor.call(this,a,n,o);const r=this.$onAmapEdit=e.onEdit.bind(this);return e.events.forEach(e=>{this.$amapEditor.on(e,r)}),this.$amapEditor},async startEditing(){const e=this.$options.amapMeta.editable;(await e.initEditing.call(this)).open()},endEditing(){this.$amapEditor&&this.$amapEditor.close()}}}}),ge=w(he,fe).extend({name:"AmapCircle",amapMeta:{initComponent:async(e,t)=>new e.Circle(t),editable:{events:["end","move","adjust"],async loadEditor(){await p("AMap.CircleEditor")},async initEditor(e,t,n){return new e.CircleEditor(t,n,this.draggable)},onEdit(e){const{target:t}=e,n=t.getCenter();this.$emit("update:center",[n.lng,n.lat]),this.$emit("update:radius",t.getRadius())}}}}),ve=w(he).extend({name:"AmapCircleMarker",amapMeta:{initComponent:async(e,t)=>new e.CircleMarker(t)}}),we=w(de,fe).extend({amapMeta:{editable:{events:["end","move","adjust"],async loadEditor(){await p("AMap.PolyEditor")},async initEditor(e,t,n){return new e.PolyEditor(t,n,this.draggable)},onEdit(e){const t=e.target.getPath().map(P);this.$emit("update:path",t)}}},props:{path:F({type:Array,setter(e,t){const n=e;if(this.$props.editable||this.$props.editable){if($(n.getPath().map(P),t))return}n.setPath(t)},getter:e=>e.getPath().map(P),clone:!0,equals:$,events:["dragging","dragend"]})}}),be=w(me,we).extend({name:"AmapPolygon",amapMeta:{initComponent:async(e,t)=>new e.Polygon(t)},methods:{getArea:Z("getArea")}}),Ce=w(we,ue).extend({name:"AmapPolyline",amapMeta:{initComponent:async(e,t)=>new e.Polyline(t)},props:{geodesic:F({type:Boolean,default:void 0,setter:ce("geodesic")})}});const Me="undefined"!=typeof BigInt64Array;function xe(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const n=e.length;if(n!=t.length)return!1;for(let o=n;0!=o--;)if(!xe(e[o],t[o]))return!1;return!0}if(e instanceof Map){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;for(const n of e.entries())if(!xe(n[1],t.get(n[0])))return!1;return!0}if(e instanceof Set){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;return!0}if(e.constructor.BYTES_PER_ELEMENT&&(e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array||Me&&(e instanceof BigInt64Array||e instanceof BigUint64Array))){const n=e.length;if(n!=t.length)return!1;for(let o=n;0!=o--;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),o=n.length;if(o!==Object.keys(t).length)return!1;for(let e=o;0!=e--;)if(!Object.prototype.hasOwnProperty.call(t,n[e]))return!1;for(let a=o;0!=a--;){const o=n[a];if(!xe(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function Ae(e){if(!e)return;return e.map(e=>{const t=[],n=e.controlPoints;return n&&t.push(...n.map(e=>P(e))),t.push(P(e)),t})}var $e=w(ue,fe).extend({name:"AmapBezierCurve",amapMeta:{initComponent:async(e,t)=>new e.BezierCurve(t),editable:{events:["end","adjust","addnode","removenode"],async loadEditor(){await p("AMap.BezierCurveEditor")},async initEditor(e,t,n){return new e.BezierCurveEditor(t,n,this.draggable)},onEdit(e){const t=e.target.getPath();this.$emit("update:path",Ae(t))}}},props:{path:F({type:Array,setter(e,t){const n=e;if(this.$props.editable||this.$props.editable){if(xe(Ae(n.getPath()),t))return}n.setPath(t)},getter:e=>Ae(e.getPath()),clone:!0,equals:xe,events:["dragging","dragend"]})}});function Ee(e,t){return!(!e||!t)&&(E(e[0][0],t[0][0])&&E(e[0][1],t[0][1])&&E(e[1][0],t[1][0])&&E(e[1][1],t[1][1]))}var ke=w(me,fe).extend({name:"AmapRectangle",amapMeta:{initComponent:async(e,t)=>new e.Rectangle(t),editable:{events:["move","end","adjust"],async loadEditor(){await p("AMap.RectangleEditor")},async initEditor(e,t,n){return new e.RectangleEditor(t,n,this.draggable)},onEdit(e){const t=j(e.target.getBounds());this.$emit("update:bounds",t)}}},props:{bounds:F({type:Array,deep:!0,setter(e,t){if(this.$props.editable||this.$props.draggable){if(Ee(j(e.getBounds()),t))return}e.setBounds(_(t))},getter:e=>j(e.getBounds()),transform:_,clone:!0,equals:Ee,events:["dragging","dragend"]})},methods:{getArea:Z("getArea")}}),Be=w(me,fe).extend({name:"AmapEllipse",amapMeta:{initComponent:async(e,t)=>new e.Ellipse(t),editable:{events:["move","end","adjust"],async loadEditor(){await p("AMap.EllipseEditor")},async initEditor(e,t,n){return new e.EllipseEditor(t,n,this.draggable)},onEdit(e){const t=P(e.target.getCenter());k(this.center,t)||this.$emit("update:center",t);const n=e.target.getRadius();k(this.radius,n)||this.$emit("update:radius",n.slice(0))}}},props:{center:F({type:Array,setter(e,t){if(this.$props.editable||this.$props.draggable){if(k(t,P(e.getCenter())))return}e.setCenter(t)},getter:e=>P(e.getCenter()),clone:!0,deep:!0,equals:k,events:["dragging","dragend"]}),radius:F({type:Array,setter(e,t){const n=e;if(this.$props.editable){if(k(t,n.getRadius()))return}n.setRadius(t)},clone:!0,deep:!0,equals:k})},methods:{getBounds(){return j(this.context.component.getBounds())}}}),Oe=w(X).extend({name:"AmapInfoWindow",amapMeta:{slot:!0,initComponent:async(e,t)=>new e.InfoWindow(t),events:["change","open","close"]},props:{isCustom:{type:Boolean,default:void 0},autoMove:{type:Boolean,default:void 0},closeWhenClickMap:{type:Boolean,default:void 0},visible:F({type:Boolean,default:!0,setter(e,t){t?this.open():this.close()}}),position:F({type:Array,deep:!0,setter(e,t){const n=e;if(!t)return;const o=n.getPosition();o&&k(t,P(o))||n.setPosition([t[0],t[1]])},getter:e=>P(e.getPosition()),equals:A}),offset:F({type:Array,transform:e=>new window.AMap.Pixel(e[0],e[1])}),anchor:F({type:String,setter:"setAnchor",validator:e=>Q.includes(e)}),showShadow:{type:Boolean,default:void 0}},methods:{open(){this.context.ready.then(e=>{const t=e,n=this.position;t.open(this.context.container.map,n)})},close(){this.context.ready.then(e=>{e.close()})},show(){this.open()},hide(){this.close()},onOpen(){this.visible||this.$emit("update:visible",!0)},onClose(){this.visible&&this.$emit("update:visible",!1)},_updateContent(){this.visible&&this.$nextTick(()=>{const e=this.$slots.default[0];e&&e.elm&&this.context.ready.then(t=>{t.setContent(e.elm)})})}},async mounted(){const e=await this.context.ready;this.visible&&(this._updateContent(),this.open()),e.on("open",this.onOpen),e.on("close",this.onClose)},watch:{visible:"_updateContent"}}),Se=w(G).extend({amapMeta:{events:["complete"]},props:{visible:F({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:F("setzIndex",Number),opacity:F({setter:"setOpacity",type:Number}),zooms:F({type:Array}),detectRetina:F({type:Boolean,default:void 0})},methods:{show:Z("show"),hide:Z("hide"),reload:Z("reload")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}}),Le=w(Se).extend({name:"AmapTileLayer",amapMeta:{initComponent:async(e,t)=>new e.TileLayer(t)},props:{tileSize:F({type:Number}),tileUrl:F({type:String,setter:"setTileUrl"}),errorUrl:{type:String},getTileUrl:{type:[String,Function]}}}),Pe=w(Se).extend({name:"AmapTileLayerSatellite",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.Satellite(t)}}),je=w(Se).extend({name:"AmapTileLayerFlexible",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.Flexible(t)},props:{createTile:{type:Function},cacheSize:{type:Number}}}),_e=w(Se).extend({name:"AmapTileLayerRoadNet",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.RoadNet(t)}}),ze=w(Se).extend({name:"AmapTileLayerTraffic",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.Traffic(t)}});const Te=["LT","RT","LB","RB"];var De=w(G).extend({amapMeta:{add(e,t){e.map.addControl(t)},remove(e,t){e.map.removeControl(t)}}}),Re=w(De).extend({name:"AmapMapType",amapMeta:{prepare:()=>p("AMap.MapType"),initComponent:async(e,t)=>new e.MapType(t)},props:{defaultType:{type:Number},showTraffic:{type:Boolean,default:void 0},showRoad:{type:Boolean,default:void 0}}}),Ie=w(De).extend({name:"AmapControlBar",amapMeta:{prepare:()=>p("AMap.ControlBar"),initComponent:async(e,t)=>new e.ControlBar(t)},props:{position:{type:Object},showZoomBar:{type:Boolean,default:void 0},showControlButton:{type:Boolean,default:void 0}}}),Ne=w(De).extend({name:"AmapOverView",amapMeta:{prepare:()=>p("AMap.OverView"),initComponent:async(e,t)=>new e.OverView(t)},props:{visible:F({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),isOpen:F({type:Boolean,default:void 0,setter(e,t){const n=e;t?n.open():n.close()}}),tileLayer:F("setTileLayer")},methods:{show:Z("show"),hide:Z("hide"),open:Z("open"),close:Z("close")},async mounted(){await this.context.ready,T(this,"open",()=>{this.$emit("update:is-open",!0)}),T(this,"close",()=>{this.$emit("update:is-open",!1)})}}),qe=w(De).extend({name:"AmapScale",amapMeta:{prepare:()=>p("AMap.Scale"),initComponent:async(e,t)=>new e.Scale(t)},props:{position:F({type:String,validator:e=>Te.includes(e)}),visible:F({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),offset:F({type:Array,transform:e=>new window.AMap.Pixel(e[0],e[1])})},methods:{show:Z("show"),hide:Z("hide"),setPosition:Z("position"),setOffset(e){this.context.component.setOffset(new window.AMap.Pixel(e[0],e[1]))}}});function We(e){return function(t,n){if(void 0===n)return;t[`${n?"show":"hide"}${e}`]()}}var Fe=w(De).extend({name:"AmapToolBar",amapMeta:{prepare:()=>p("AMap.ToolBar"),initComponent:async(e,t)=>new e.ToolBar(t),events:["location","zoomchanged"]},props:{visible:F({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),position:{type:String,validator:e=>Te.includes(e)},ruler:F({type:Boolean,default:void 0,setter:We("Ruler")}),direction:F({type:Boolean,default:void 0,setter:We("Direction")}),locate:F({type:Boolean,default:void 0,setter:We("Location")}),noIpLocale:{type:Boolean,default:void 0},liteStyle:{type:Boolean,default:void 0},autoPosition:{type:Boolean,default:void 0}},methods:{show:Z("show"),hide:Z("hide"),doLocation:Z("doLocation"),getLocation(){const e=this.context.component.getLocation();if(e)return P(e)}}});function Ze(e,t,n){if(!e)return n;var o,a;if(Array.isArray(t)&&(o=t.slice(0)),"string"==typeof t&&(o=t.split(".")),"symbol"==typeof t&&(o=[t]),!Array.isArray(o))throw new Error("props arg must be an array, a string or a symbol");for(;o.length;){if(a=o.shift(),!e)return n;if(void 0===(e=e[a]))return n}return e}const Ue=ie.sealedOptions,Ve=e.extend({props:Ue.props});let Ke=void 0;function He(e,t){Ke||(Ke=document.createElement("div"));const n=e;return n._props=t,n._vnode=null,n.$mount(Ke),n._vnode.elm}function Je(e,t,n){const o=e[t];Array.isArray(o)&&(e[t]=new n(o[0],o[1]))}function Ye(e){return e&&0!==e.length?e.map(e=>{const t={...e};return Je(t,"size",window.AMap.Size),Je(t,"offset",window.AMap.Pixel),Je(t,"imageOffset",window.AMap.Pixel),t}):e}var Ge=w(G).extend({name:"AmapMarkerCluster",amapMeta:{prepare:()=>p("AMap.MarkerClusterer"),async initComponent(e,t){return this.$scopedSlots.cluster&&(t.renderClusterMarker=this._renderCluster),new e.MarkerClusterer(this.map,[],t)},events:["click"]},data:()=>({_mcc:null}),props:{data:F({type:Array,required:!0,initialize:!1}),keyProp:F({type:[String,Function],default:"key",initialize:!1}),positionProp:F({type:[String,Function],default:"position",initialize:!1}),gridSize:F("setGridSize",Number),minClusterSize:F("setMinClusterSize",Number),maxZoom:F("setMaxZoom",Number),averageCenter:F({type:Boolean,default:void 0,setter:"setAverageCenter"}),styles:F({type:Array,setter(e,t){e.setStyles(Ye(t))},transform:Ye}),zoomOnClick:F({type:Boolean,default:void 0}),markerOptions:F({type:Function,initialize:!1}),clusterOptions:F({type:Function,initialize:!1})},mounted(){const t=function(e,t,n){let o,a,r,i,s;function p(){var l=Date.now()-i;l<t&&l>=0?o=setTimeout(p,t-l):(o=null,n||(s=e.apply(r,a),r=a=null))}null==t&&(t=100);var l=function(...l){r=this,a=l,i=Date.now();var c=n&&!o;return o||(o=setTimeout(p,t)),c&&(s=e.apply(r,a),r=a=null),s};return l.clear=function(){o&&(clearTimeout(o),o=null)},l.flush=function(){o&&(s=e.apply(r,a),r=a=null,clearTimeout(o),o=null)},l}(this._onDataChange,100),n=this.$scopedSlots.marker,o=this.$scopedSlots.cluster;this.context.ready.then(()=>{this._onDataChange()}),this._mcc={markers:new Map,clusters:new Map,MarkerRenderer:e.extend({name:"AmapMarkerClusterMarkerRenderer",props:{point:{type:Object}},render(){if(!n)return null;return Ze(n(this.point),"0",null)}}),ClusterRenderer:e.extend({name:"AmapMarkerClusterClusterRenderer",props:{context:{type:Object}},render(){if(!o)return null;return Ze(o(this.context),"0",null)}}),dummy:new Ve},this._mcc.marker=new this._mcc.MarkerRenderer,this._mcc.cluster=new this._mcc.ClusterRenderer,this.$watch("data",{handler:t})},beforeDestroy(){this._mcc.markers.clear()},methods:{_getKey(e,t){const{keyProp:n}=this;return n&&("$index"!==n||"$index"in e)?"function"==typeof n?n(e):e[n]:t},_getPosition(e){const{positionProp:t}=this;return"function"==typeof t?t(e):e[t]},async _onDataChange(){const{data:e}=this;if(await this.context.ready,this.context.destroyed)return;h("Render Markers");const t=e.map((e,t)=>this._getMarker(e,t));y("Render Markers"),h("Set Markers"),this.component.setMarkers(t),y("Set Markers")},_renderMarkerContent(e){if(this.$scopedSlots.marker)return He(this._mcc.marker,{point:e})},_getMarker(e,t){const n=this._getKey(e,t),o=this._mcc.markers;if(o.has(n))return o.get(n);const a={};this.positionProp&&(a.position=this._getPosition(e)),"function"==typeof this.markerOptions&&Object.assign(a,this.markerOptions(e));const r=S(this,Ue.props,a,!0),i=this._renderMarkerContent(e);i&&(r.content=i);const s=new window.AMap.Marker(r);return o.set(n,s),s},_renderCluster(e){const t=He(this._mcc.cluster,{context:e});e.marker.setContent(t);const n={};"function"==typeof this.clusterOptions&&Object.assign(n,this.clusterOptions(e));const o=Object.keys(n);if(o.length>0){const{dummy:t}=this._mcc;for(let a=0;a<o.length;++a){const r=o[a],i=n[r],s=Ue.props[r];void 0!==s&&q(t,e.marker,s,i)}}}},render:e=>null});const Xe=ie.sealedOptions,Qe=Ce.sealedOptions,et=be.sealedOptions,tt=ke.sealedOptions,nt=ge.sealedOptions;var ot=w(G).extend({amapMeta:{prepare:()=>p("AMap.MouseTool"),async initComponent(e){return new e.MouseTool(this.map)},add(){},remove(){}},props:{mode:F({type:String,default:"none"}),clearWhenClose:{type:Boolean,default:!0},options:{type:Object}},data:()=>({drawingMode:void 0}),methods:{close(e){this.component.close(e)},draw(){if(this.mode===this.drawingMode)return;const{mode:e}=this,t=this.component;switch(e){case"none":this.close(this.clearWhenClose);break;case"marker":t.marker(S(this,Xe.props,this.options||{}));break;case"polyline":t.polyline(S(this,Qe.props,this.options||{}));break;case"polygon":t.polygon(S(this,et.props,this.options||{}));break;case"rectangle":t.rectangle(S(this,tt.props,this.options||{}));break;case"circle":t.circle(S(this,nt.props,this.options||{}));break;case"rule":t.rule(S(this,et.props,this.options||{}));break;case"measureArea":t.measureArea(S(this,et.props,this.options||{}));break;case"rectZoomIn":t.rectZoomIn(S(this,et.props,this.options||{}));break;case"rectZoomOut":t.rectZoomOut(S(this,et.props,this.options||{}))}this.drawingMode=e},_onDraw(e){if(this.mode!==this.drawingMode)return this.close(!0),void this.draw();const t=e.obj,n=this.drawingMode;let o=t;switch(n){case"marker":o=P(t.getPosition());break;case"polyline":case"polygon":o=t.getPath().map(e=>P(e));break;case"rectangle":o=j(t.getBounds());break;case"circle":o={center:P(t.getCenter()),radius:t.getRadius()};break;case"rule":o={path:t.getPath().map(e=>P(e)),length:t.getLength()};break;case"measureArea":o={path:t.getPath().map(e=>P(e)),area:t.getArea()}}this.$emit("draw",n,o),this.$emit("update:mode","none")}},async mounted(){if(await this.context.ready,this.context.destroyed)return;this.component.on("draw",this._onDraw),this.$watch("mode",async e=>{"none"!==e&&"none"!==this.drawingMode&&this.close(!0),this.draw()},{immediate:!0})}}),at=w(G).extend({amapMeta:{events:["complete"]},props:{visible:F({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:F("setzIndex",Number),opacity:F({setter:"setOpacity",type:Number}),zooms:F({type:Array})},methods:{show:Z("show"),hide:Z("hide")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}}),rt=w(at).extend({name:"AmapImageLayer",amapMeta:{initComponent:async(e,t)=>new e.ImageLayer(t)},props:{bounds:F({type:Array,transform:_,deep:!0,setter(e,t){e.setBounds(_(t))}}),url:F({type:String,setter:"setImageUrl"})},methods:{getElement:Z("getElement")}}),it=w(at).extend({name:"AmapVideoLayer",amapMeta:{initComponent:async(e,t)=>new e.VideoLayer(t)},props:{autoplay:{type:Boolean},loop:{type:Boolean},bounds:F({type:Array,transform:_}),url:F({type:[String,Array],setter:"setVideoUrl"})},methods:{getElement:Z("getElement")}}),st=w(at).extend({name:"AmapCanvasLayer",amapMeta:{slot:!0,async initComponent(e,t){const n=Ze(this,"$slots.default.0.elm");if(!n||"CANVAS"!==n.tagName)throw this.$amapLogger.warn("slot内容必须是canvas"),new Error;return t.canvas=n,new e.CanvasLayer(t)}},props:{bounds:F({type:Array,transform:_})},methods:{reFresh:Z("reFresh")}}),pt=w(at).extend({name:"AmapCustomLayer",amapMeta:{slot:!0,async initComponent(e,t){const n=Ze(this,"$slots.default.0.elm",null),o=new e.CustomLayer(n,t);return this.render&&(o.render=this.render),o}},props:{render:F({type:Function,setter(e,t){e.render=t}})}}),lt=w(G).extend({amapMeta:{events:["complete"]},props:{visible:F({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:F("setzIndex",Number),opacity:F({setter:"setOpacity",type:Number})},methods:{show:Z("show"),hide:Z("hide")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}}),ct=w(lt).extend({name:"AmapDistrictLayerWorld",amapMeta:{prepare:()=>p("AMap.DistrictLayer"),initComponent:async(e,t)=>new e.DistrictLayer.World(t)},props:{styles:F({type:Object,setter:"setStyles"})},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}}),dt=w(lt).extend({name:"AmapDistrictLayerCountry",amapMeta:{prepare:()=>p("AMap.DistrictLayer"),initComponent:async(e,t)=>("soc"in t&&(t.SOC=t.soc,delete t.soc),new e.DistrictLayer.Country(t))},props:{styles:F({type:Object,setter:"setStyles"}),soc:F({type:String,setter:"setSOC"}),depth:{type:Number}},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}}),mt=w(lt).extend({name:"AmapDistrictLayerProvince",amapMeta:{prepare:()=>p("AMap.DistrictLayer"),initComponent:async(e,t)=>("soc"in t&&(t.SOC=t.soc,delete t.soc),new e.DistrictLayer.Province(t))},props:{styles:F({type:Object,setter:"setStyles"}),depth:{type:Number},adcode:F({type:Array,deep:!0,setter:"setDistricts"})},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}}),ut={install(e){e.component("amap",J),e.component("amap-marker",ie),e.component("amap-labels-layer",se),e.component("amap-label-marker",pe),e.component("amap-text",le),e.component("amap-circle",ge),e.component("amap-circle-marker",ve),e.component("amap-polygon",be),e.component("amap-polyline",Ce),e.component("amap-bezier-curve",$e),e.component("amap-rectangle",ke),e.component("amap-ellipse",Be),e.component("amap-info-window",Oe),e.component("amap-tile-layer",Le),e.component("amap-tile-layer-satellite",Pe),e.component("amap-tile-layer-road-net",_e),e.component("amap-tile-layer-traffic",ze),e.component("amap-tile-layer-flexible",je),e.component("amap-map-type",Re),e.component("amap-control-bar",Ie),e.component("amap-over-view",Ne),e.component("amap-scale",qe),e.component("amap-tool-bar",Fe),e.component("amap-marker-clusterer",Ge),e.component("amap-mouse-tool",ot),e.component("amap-image-layer",rt),e.component("amap-video-layer",it),e.component("amap-canvas-layer",st),e.component("amap-custom-layer",pt),e.component("amap-district-layer-world",ct),e.component("amap-district-layer-country",dt),e.component("amap-district-layer-province",mt)},config:t,loadAMap:s,loadPlugins:p,withAmap:l,Amap:J,Marker:ie,LabelsLayer:se,LabelMarker:pe,Text:le,Circle:ge,CircleMarker:ve,Polygon:be,Polyline:Ce,BezierCurve:$e,Rectangle:ke,Ellipse:Be,InfoWindow:Oe,TileLayer:Le,Satellite:Pe,Flexible:je,RoadNet:_e,Traffic:ze,MapType:Re,ControlBar:Ie,OverView:Ne,Scale:qe,ToolBar:Fe,MarkerClusterer:Ge,MouseTool:ot,ImageLayer:rt,VideoLayer:it,CanvasLayer:st,CustomLayer:pt,DistrictLayerWorld:ct,DistrictLayerCountry:dt,DistrictLayerProvince:mt};export default ut;export{J as Amap,$e as BezierCurve,st as CanvasLayer,ge as Circle,ve as CircleMarker,Ie as ControlBar,pt as CustomLayer,dt as DistrictLayerCountry,mt as DistrictLayerProvince,ct as DistrictLayerWorld,Be as Ellipse,je as Flexible,rt as ImageLayer,Oe as InfoWindow,pe as LabelMarker,se as LabelsLayer,Re as MapType,ie as Marker,Ge as MarkerClusterer,ot as MouseTool,Ne as OverView,be as Polygon,Ce as Polyline,ke as Rectangle,_e as RoadNet,Pe as Satellite,qe as Scale,le as Text,Le as TileLayer,Fe as ToolBar,ze as Traffic,it as VideoLayer,t as config,s as loadAMap,p as loadPlugins,l as withAmap}; |
@@ -1,1 +0,1 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e=e||self).AmapVue={},e.Vue)}(this,(function(e,t){"use strict";t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var n={_prefix:"https://webapi.amap.com/maps",_disableMapCache:!1,verbose:!1,version:"1.4.15",key:"",plugins:[]};function o(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}const a=o();let r=!1,i=!1;const s=a.promise;function p(){if(!i){if(i=!0,window.AMap)return a.resolve(window.AMap),s;const e=document.createElement("script"),t=`amap_vue_${Date.now()}_${Math.ceil(1e4*Math.random())}`,o=()=>{r||(r=!0,a.resolve(window.AMap))};window[t]=o;const p=function(e){const t=[];for(const n in e)void 0!==e[n]&&null!==e[n]&&t.push(`${n}=${encodeURIComponent(e[n])}`);return t.join("&")}({v:n.version,key:n.key,callback:t,plugin:n.plugins.join(",")}),l=`${n._prefix}?${p}`;e.src=l,document.body.appendChild(e)}return s}function l(e){return new Promise(t=>{window.AMap.plugin(e,()=>{t()})})}var c=t.extend({inject:["$amapContainer"],computed:{map(){return this.$amapContainer.map}}});function d(e){throw new Error(e)}function u(e,...t){const[n,...o]=t;if(!n)return e;const a=new Set(e);return n.forEach(t=>{a.has(t)||e.push(t)}),u(e,...o)}const m=Object.prototype.hasOwnProperty;function y(e){try{if(e.constructor&&!m.call(e,"constructor")&&!m.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}let t;for(t in e);return void 0===t||m.call(e,t)}function h(e){n.verbose&&console.time(e)}function f(e){n.verbose&&console.timeEnd(e)}function g(e,t,o){n.verbose&&"function"==typeof console[t]&&(e&&e.$options&&e.$options.name&&(o=[`[${e.$options.name}]`,...o]),console[t](...o))}function v(...e){g(this,"warn",e)}function w(...e){g(this,"debug",e)}function b(...e){return t.extend({mixins:e||[]})}function C(e,t){return null!=t&&e instanceof t}function M(e,t,n,o,a){"object"==typeof t&&(n=t.depth,o=t.prototype,a=t.includeNonEnumerable,t=t.circular);let r=[],i=[];return void 0===t&&(t=!0),void 0===n&&(n=1/0),function e(n,s){if(null===n)return null;if(0===s)return n;let p,l;if("object"!=typeof n)return n;if(C(n,Map))p=new Map;else if(C(n,Set))p=new Set;else if(C(n,Promise))p=new Promise((function(t,o){n.then((function(n){t(e(n,s-1))}),(function(t){o(e(t,s-1))}))}));else if(M.__isArray(n))p=[];else if(M.__isRegExp(n))p=new RegExp(n.source,A(n)),n.lastIndex&&(p.lastIndex=n.lastIndex);else if(M.__isDate(n))p=new Date(n.getTime());else if(C(n,Error))p=Object.create(n);else if(void 0===o){if(l=Object.getPrototypeOf(n),C(l,Object))return n;p=Object.create(l)}else p=Object.create(o),l=o;if(t){let e=r.indexOf(n);if(-1!=e)return i[e];r.push(n),i.push(p)}C(n,Map)&&n.forEach((function(t,n){let o=e(n,s-1),a=e(t,s-1);p.set(o,a)})),C(n,Set)&&n.forEach((function(t){let n=e(t,s-1);p.add(n)}));for(let t in n){Object.getOwnPropertyDescriptor(n,t)&&(p[t]=e(n[t],s-1));try{if(void 0===Object.getOwnPropertyDescriptor(n,t).set)continue;p[t]=e(n[t],s-1)}catch(e){if(e instanceof TypeError)continue;if(e instanceof ReferenceError)continue}}if(Object.getOwnPropertySymbols){let t=Object.getOwnPropertySymbols(n);for(let o=0;o<t.length;o++){let r=t[o],i=Object.getOwnPropertyDescriptor(n,r);(!i||i.enumerable||a)&&(p[r]=e(n[r],s-1),Object.defineProperty(p,r,i))}}if(a){let t=Object.getOwnPropertyNames(n);for(let o=0;o<t.length;o++){let a=t[o],r=Object.getOwnPropertyDescriptor(n,a);r&&r.enumerable||(p[a]=e(n[a],s-1),Object.defineProperty(p,a,r))}}return p}(e,n)}function x(e){return Object.prototype.toString.call(e)}function A(e){let t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}function $(e,t){return!(!e&&t)&&(!(e&&!t)&&(e===t||e[0]===t[0]&&e[1]===t[1]))}function E(e,t){return!(!e&&t)&&(!(e&&!t)&&(!e&&!t||(e===t||e.length===t.length&&e.every((e,n)=>$(e,t[n])))))}t.mixin({beforeCreate(){var e;"amapMeta"in this.$options&&(this.$amapLogger=(e=this,{warn:v.bind(e),debug:w.bind(e)}))}}),t.config.optionMergeStrategies.amapMeta=(e,t)=>function e(t,n){const o={...t};for(const a in n){const r=n[a],i=t[a];Array.isArray(r)?o[a]=u(i||[],r):y(r)?o[a]=e(i||{},r):o[a]=r}return o}(e||{},t||{}),M.clonePrototype=function(e){if(null===e)return null;let t=function(){};return t.prototype=e,new t},M.__objToStr=x,M.__isDate=function(e){return"object"==typeof e&&"[object Date]"===x(e)},M.__isArray=function(e){return"object"==typeof e&&"[object Array]"===x(e)},M.__isRegExp=function(e){return"object"==typeof e&&"[object RegExp]"===x(e)},M.__getRegExpFlags=A;function k(e,t,n=1e-7){return Math.abs(e-t)<n}function B(e,t){return!(!e&&t)&&(!(e&&!t)&&(e===t||k(e[0],t[0])&&k(e[1],t[1])))}const O=new WeakMap;function L(e,t){let n=O.get(t);if(!n){n=new Map,O.set(t,n);for(const e in t){const o=t[e];!1!==o.initialize&&n.set(e,o)}}return n.get(e)}function S(e,t,n,o){void 0===t&&(t=e.$options.props),void 0===n&&(n=e.$props);const a={};for(const o in n){const r=n[o];if(void 0===r)continue;const i=L(o,t);i&&(a[o]=i.transform?i.transform.call(e,r):r)}return o?a:M(a)}function P(e){return e.map?e.map:e.component}function j(e){return Array.isArray(e)?[e[0],e[1]]:[e.lng,e.lat]}function _(e){return Array.isArray(e)?e:e.southWest?[[e.southWest.lng,e.southWest.lat],[e.northEast.lng,e.northEast.lat]]:[[e.southwest.lng,e.southwest.lat],[e.northeast.lng,e.northeast.lat]]}function T(e){const t=new window.AMap.LngLat(e[0][0],e[0][1]),n=new window.AMap.LngLat(e[1][0],e[1][1]);return new window.AMap.Bounds(t,n)}function z(e,t,n){const o=e.$amapEvents||(e.$amapEvents={});(o[t]||(o[t]=[])).push(n)}function D(e,t,n){z(e,t,n),P(e.$amapContext).on(t,n)}function R(e){const{events:t=[]}=e.$options.amapMeta,n=P(e.$amapContext);t.forEach(t=>{e.$watch("$listeners."+t,(o,a)=>{a&&n.off(t,a),o&&(z(e,t,o),n.on(t,o))},{immediate:!0})})}function I(e,t,n,o){o||(o=P(e.$amapContext));const{events:a=[]}=n;a.forEach(a=>{const{getter:r}=n;if(!r)return;const i=a=>{const i="function"==typeof r?r.call(e,o,a):o[r](),s=e.$props[t];if("function"==typeof n.equals){if(n.equals(i,s))return}else if(i===s)return;e.$emit("update:"+t,i)};z(e,a,i),o.on(a,i)})}function N(e){const t=P(e.$amapContext),n=e.$amapEvents||{};for(const e in n){n[e].forEach(n=>{t.off(e,n)})}}const q={equals:function(e,t){return e===t},clone:!1};function W(e,t,n,o){const{setter:a}=n;a&&("function"==typeof a?a.call(e,t,o):"string"==typeof a&&(n.clone&&(o=M(o)),t[a](o)))}function F(e,t,n){t||(t=P(e.$amapContext)),n||(n=e.$options.props);for(const o in n){const a=n[o],{setter:r}=a;if(!r)continue;const i={deep:!!a.deep};e.$amapLogger.debug("watch",o,i),e.$watch("$props."+o,(n,o)=>{if(!i.deep||i.deep&&n!==o)if("function"==typeof a.equals){if(a.equals(n,o))return}else if(n===o)return;W(e,t,a,n)},i),a.events&&I(e,o,a,t)}}function V(e,t,n){if("string"==typeof e){const o=e,a={...q,setter:o};return t&&(a.type=t),arguments.length>=3&&(a.default=n),a}return{...q,...e}}function Z(e,t){return function(...n){const o=P(this.$amapContext);return o?"function"!=typeof o[e]?this.$amapLogger.warn(e+" is not a function."):(t&&(n=M(n)),o[e](...n)):this.$amapLogger.warn(`calling ${e} on ${o}`)}}function U(e){return e&&"function"==typeof e.then}function K(e){if(!e)return e;if(U(e))return e;if(e.$amapContext&&e.$amapContext.ready)return e.$amapContext.ready;if(Array.isArray(e))return Promise.all(e.map(K));if(y(e)){const n={},o=Object.keys(e),a=[];function t(e,t){n[t]=void 0,a.push(e.then(e=>{n[t]=e}))}for(let r=0;r<o.length;r++){const i=o[r],s=K(e[i]);s&&U(a)?t(s,i):n[i]=e[i]}return Promise.all(a).then((function(){return n}))}return e}function H(e){return function(t,n){t.setStatus({[e]:n})}}var J,Y=t.extend({name:"Amap",amapMeta:{events:["click","dblclick","rightclick","mapmove","movestart","moveend","hotspotclick","hotspotover","hotspotout","mousemove","mousewheel","mouseover","mouseup","mousedown","zoomchange","zoomstart","zoomend","dragstart","dragging","dragend","resize","touchstart","touchmove","touchend"]},props:{cacheKey:V({type:String,initialize:!1}),sync:V({type:Boolean,default:!1,initialize:!1}),showIndoorMap:V({type:Boolean,default:void 0,setter:H("showIndoorMap")}),resizeEnable:V({type:Boolean,default:void 0,setter:H("resizeEnable")}),dragEnable:V({type:Boolean,default:void 0,setter:H("dragEnable")}),pitchEnable:V({type:Boolean,default:void 0,setter:H("pitchEnable")}),rotateEnable:V({type:Boolean,default:void 0,setter:H("rotateEnable")}),zoomEnable:V({type:Boolean,default:void 0,setter:H("zoomEnable")}),doubleClickZoom:V({type:Boolean,default:void 0,setter:H("doubleClickZoom")}),keyboardEnable:V({type:Boolean,default:void 0,setter:H("keyboardEnable")}),jogEnable:V({type:Boolean,default:void 0,setter:H("jogEnable")}),scrollWheel:V({type:Boolean,default:void 0,setter:H("scrollWheel")}),animateEnable:V({type:Boolean,default:void 0,setter:H("animateEnable")}),isHotspot:V({type:Boolean,default:void 0,setter:H("isHotspot")}),touchEnable:V({type:Boolean,default:void 0,setter:H("touchEnable")}),viewMode:{type:String},showBuildingBlock:{type:Boolean,default:void 0},expandZoomRange:{type:Boolean,default:void 0},zooms:{type:Array},zoom:V({type:Number,equals:k,setter(e,t){const n=e;void 0!==t&&(k(n.getZoom(),t)||n.setZoom(t))},getter:"getZoom",events:["zoomchange","zoomend"]}),center:V({type:Array,deep:!0,equals:$,setter(e,t){const n=e;t&&(B(t,j(n.getCenter()))||n.setCenter([t[0],t[1]]))},getter:e=>j(e.getCenter()),events:["mapmove","moveend"]}),pitch:V({type:Number,equals:k,setter:"setPitch",getter:"getPitch",events:["dragging","dragend","moveend","pitchend"]}),rotation:V({type:Number,equals:k,setter:"setRotation",getter:"getRotation",events:["dragging","dragend","moveend","rotateend"]}),lang:V("setLang",String),mapStyle:V("setMapStyle",String),features:V("setFeatures",Array),skyColor:{type:String}},data:()=>({ready:!1}),computed:{context(){return this.$amapContext},map(){return this.context.map}},methods:{_clear(){const{context:e}=this;e.ready.then(()=>{N(this),this.clearMap(),this.clearInfoWindow()})},_getContainer(e){const{cacheKey:t}=this;if(!n._disableMapCache&&t){const n="amap-vue-container-inner-"+t;let o=document.getElementById(n)||this.$el.querySelector("#"+n);return o||(o=document.createElement("div"),o.className="amap-vue-container-inner",o.setAttribute("id",n),o.setAttribute("style","position:relative; width:100%; height:100%;")),e?(this.$el.insertAdjacentElement("afterbegin",o),o.style.display="block",o.style.pointerEvents="initial"):(o.style.display="none",o.style.pointerEvents="none"),o}return this.$el},clearMap:Z("clearMap"),clearInfoWindow:Z("clearInfoWindow"),setCenter:Z("setCenter"),setCity:Z("setCity"),getBounds(){const e=this.context.map.getBounds();return e.path?e.path.map(e=>[e[0],e[1]]):_(this.context.map.getBounds())},getSize:Z("getSize"),getResolution:Z("getResolution"),setFitView:(J="setFitView",async function(...e){const t=this.$amapContext;await t.ready;const n=P(t);if(!n)return this.$amapLogger.warn(`calling ${J} on ${n}`);if("function"!=typeof n[J])return this.$amapLogger.warn(J+" is not a function.");const o=e.map(K),a=await Promise.all(o);return t.destroyed?void 0:n[J](...a)}),lngLatToContainer(e){const t=this.map.lngLatToContainer(e);return[t.getX(),t.getY()]}},beforeCreate(){p(),this.$amapReady=o();const e={AMap:null,wrapper:null,ready:this.$amapReady.promise,map:null,vm:this,destroyed:!1};this.$amapContext=e},async mounted(){const{context:e}=this,t=await p();if(e.AMap=t,e.destroyed)return;const n=S(this),o=this._getContainer(!0),a=!!o.$amap;if(a)for(let e in n){const t=this.$options.props[e],a=n[e];W(this,o.$amap,t,a)}else o.$amap=new t.Map(o,n);const r=o.$amap;r.$vm=this,e.wrapper=o,e.map=r,F(this),R(this);const i=()=>{this.ready=!0,this.$amapReady.resolve(r),this.$emit("complete",this)};a?(await this.$nextTick(),i()):r.on("complete",i)},destroyed(){const{context:e}=this;if(!n._disableMapCache&&this.cacheKey){const e=this._getContainer(!1);document.body.appendChild(e),this._clear()}else e.map&&e.map.destroy();e.destroyed=!0},provide(){return{$amapContainer:this.context}},render(e){let t=this.$slots.default;return this.sync||this.ready||(t=void 0),e("div",{class:"amap-vue-container",style:"position:relative; width:100%; height:100%;"},t)}}),G=t.extend({computed:{context(){return this.$amapContext},component(){return this.context.component},map(){return this.context.container.map},wrapper(){return this.context.container.vm},AMap(){return this.context.AMap}}}),X=b(G).extend({inject:["$amapContainer"],amapMeta:{slot:!1,initComponent:d,add(e,t){const n=e;t.setMap(n.map)},remove(e,t){t.setMap(null)}},beforeCreate(){this.$amapReady=o(),this.$amapContext={}},created(){Object.assign(this.$amapContext,{AMap:null,ready:this.$amapReady.promise,container:this.$amapContainer,component:null,destroyed:!1})},async mounted(){const{context:e}=this,t=this.$options.amapMeta,{container:n}=e;await n.ready,e.AMap=n.AMap,t.prepare&&await t.prepare();const o=S(this);if(e.destroyed)return;const a=await t.initComponent.call(this,window.AMap,o);a.$vm=this,e.component=a,t.add.call(this,n,a),F(this),R(this),this.$amapReady.resolve(a),this.$emit("amap-ready",this)},beforeDestroy(){const{context:e}=this,{container:t,component:n}=e;if(n){N(this),this.$options.amapMeta.remove.call(this,t,n)}e.destroyed=!0},render(e){return this.$options.amapMeta.slot&&this.$slots.default?e("div",{class:"amap-vue-placeholder",style:"visibility: hidden; pointer-events: none;"},this.$slots.default):null}}),Q=b(X).extend({amapMeta:{events:["click","dblclick","rightclick","mousemove","mouseover","mouseout","mousedown","mouseup","dragstart","dragging","dragend","moving","moveend","movealong","touchstart","touchmove","touchend"]},props:{visible:V({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),cursor:V("setCursor",String),zIndex:V("setzIndex",Number),bubble:V("setBubble",Boolean,void 0),clickable:V("setClickable",Boolean,void 0),draggable:V("setDraggable",Boolean,void 0),extData:V("setExtData",Object)},methods:{show:Z("show"),hide:Z("hide"),getExtData:Z("getExtData")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}});const ee=["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"],te=["miter","round","bevel"],ne=["butt","round","square"],oe=["solid","dashed"];var ae=b(Q).extend({props:{position:V({type:Array,deep:!0,equals:$,setter(e,t){if(!t)return;const n=e;B(t,j(n.getPosition()))||n.setPosition([t[0],t[1]])},getter:e=>j(e.getPosition()),events:["dragging","dragend","moving","moveend"]}),topWhenClick:{type:Boolean,default:void 0},animation:V("setAnimation",String),angle:V({type:Number,equals:k,setter(e,t){void 0!==t&&e.setAngle(t)},getter:e=>e.getAngle(),events:["moving"]}),autoRotation:{type:Boolean,default:void 0},title:V("setTitle",String),anchor:V({type:String,setter:"setAnchor",validator:e=>ee.includes(e)}),offset:V({type:Array,deep:!0,equals:$,setter(e,t){const n=e;var o;t&&(B(t,(o=n.getOffset(),Array.isArray(o)?[o[0],o[1]]:[o.x,o.y]))||n.setOffset(new window.AMap.Pixel(t[0],t[1])))},transform:e=>new window.AMap.Pixel(e[0],e[1])}),raiseOnDrag:{type:Boolean,default:void 0}},methods:{moveAlong:Z("moveAlong",!0),moveTo:Z("moveTo",!0),stopMove:Z("stopMove")},beforeDestroy(){this.context.component&&this.stopMove()}});function re(e){if(!e)return;const t={...e};return t.offset&&(t.offset=new window.AMap.Pixel(t.offset[0],t.offset[1])),t}function ie(e){return"string"==typeof e?e:new window.AMap.Icon(e)}var se=b(ae).extend({name:"AmapMarker",amapMeta:{slot:!0,async initComponent(e,t){const n={...t};return this.$slots.default&&this.$slots.default.length>0&&(n.content=this.$slots.default[0].elm),new e.Marker(n)}},props:{content:V("setContent",String),icon:V({setter(e,t){if(!t)return;const n=e,o=ie(t);n.setIcon(o)},transform:ie}),shadow:V("setShadow"),shape:V("setShape"),label:V({type:Object,setter(e,t){t&&e.setLabel(re(t))},deep:!0,transform:re})}}),pe=b(X).extend({name:"AmapLabelsLayer",amapMeta:{slot:!0,initComponent:async(e,t)=>new e.LabelsLayer(t)},props:{visible:V({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:{type:Number},opacity:{type:Number},collision:{type:Boolean,default:void 0},animation:{type:Boolean,default:void 0}},provide(){return{$amapLabelsLayer:this.context}}}),le=b(X).extend({name:"AmapLabelMarker",inject:["$amapLabelsLayer"],amapMeta:{initComponent:async(e,t)=>new e.LabelMarker(t),async add(e,t){const n=await this.$amapLabelsLayer.ready;this.$amapContext.destroyed||n.add(t)},async remove(e,t){(await this.$amapLabelsLayer.ready).remove(t)}},props:{position:V({type:Array,deep:!0,equals:$,setter(e,t){const n=e;t&&(B(t,j(n.getPosition()))||n.setPosition([t[0],t[1]]))}}),zooms:V({type:Array,deep:!0,equals:$,setter:"setZooms"}),opacity:V("setOpacity",Number),rank:{type:Number},icon:V({type:Object,setter:"setIcon",deep:!0}),text:V({type:Object,setter:"setText",deep:!0})}}),ce=b(ae).extend({name:"AmapText",amapMeta:{initComponent:async(e,t)=>(t.domStyle&&(t.style=t.domStyle,delete t.domStyle),new e.Text(t))},props:{text:V("setText",String),domStyle:V({type:Object,setter(e,t){e.setStyle(t)},deep:!0})}});function de(e){return(t,n)=>{t.setOptions({[e]:n})}}const ue=b(Q).extend({props:{strokeColor:V({type:String,setter:de("strokeColor")}),strokeOpacity:V({type:Number,setter:de("strokeOpacity")}),strokeWeight:V({type:Number,setter:de("strokeWeight")}),strokeStyle:V({type:String,setter:de("strokeStyle"),validator:e=>oe.includes(e)}),strokeDasharray:V({type:Array,deep:!0,equals:function(e,t){return!(!e&&t)&&(!(e&&!t)&&(e===t||e.length===t.length&&e.every((e,n)=>e===t[n])))},setter:de("strokeDasharray")})},methods:{getBounds:Z("getBounds")}}),me=b(ue).extend({props:{fillColor:V({type:String,setter:de("fillColor")}),fillOpacity:V({type:Number,setter:de("fillOpacity")})},methods:{contains:Z("contains")}}),ye=b(ue).extend({props:{lineJoin:V({type:String,setter:de("lineJoin"),validator:e=>te.includes(e)}),lineCap:V({type:String,setter:de("lineCap"),validator:e=>ne.includes(e)}),showDir:V({type:Boolean,default:void 0,setter:de("showDir")}),dirColor:V({type:String,setter:de("dirColor")}),dirImg:V({type:String,setter:de("dirImg")}),isOutline:V({type:Boolean,default:void 0,setter:de("isOutline")}),outlineColor:V({type:String,setter:de("outlineColor")}),borderWeight:V({type:Number,setter:de("borderWeight")})},methods:{getLength:Z("getLength")}});var he=b(me).extend({props:{center:V({type:Array,clone:!0,deep:!0,equals:$,setter(e,t){if(!t)return;const n=e;if(this.$props.draggable||this.$props.editable){if(B(t,j(n.getCenter())))return}n.setCenter(new window.AMap.LngLat(t[0],t[1]))},getter:e=>j(e.getCenter()),events:["dragging","dragend"]}),radius:V({type:Number,setter:"setRadius"})}});const fe=b(G).extend({data:()=>({$amapEditor:null}),props:{editable:V({type:Boolean,default:!1,initialize:!1})},async mounted(){await this.context.ready;const e=this.$options.amapMeta.editable;this.editable&&e.startEditing.call(this)},beforeDestroy(){const e=this.$amapEditor;if(e){this.$options.amapMeta.editable.events.forEach(t=>{e.off(t,this.$onAmapEdit)}),e.close()}},watch:{"$props.editable"(e){const t=this.$options.amapMeta.editable;e?this.context.destroyed||t.startEditing.call(this):t.endEditing.call(this)}}});var ge=b(fe).extend({amapMeta:{editable:{events:[],loadEditor:d,initEditor:d,onEdit:d,async initEditing(){if(this.$amapEditor)return this.$amapEditor;const e=this.$options.amapMeta.editable,{context:t}=this;await t.container.ready,await this.$options.amapMeta.editable.loadEditor();const n=t.container.map,o=t.component,{AMap:a}=this;this.$amapEditor=await e.initEditor.call(this,a,n,o);const r=this.$onAmapEdit=e.onEdit.bind(this);return e.events.forEach(e=>{this.$amapEditor.on(e,r)}),this.$amapEditor},async startEditing(){const e=this.$options.amapMeta.editable;(await e.initEditing.call(this)).open()},endEditing(){this.$amapEditor&&this.$amapEditor.close()}}}}),ve=b(he,ge).extend({name:"AmapCircle",amapMeta:{initComponent:async(e,t)=>new e.Circle(t),editable:{events:["end","move","adjust"],async loadEditor(){await l("AMap.CircleEditor")},async initEditor(e,t,n){return new e.CircleEditor(t,n,this.draggable)},onEdit(e){const{target:t}=e,n=t.getCenter();this.$emit("update:center",[n.lng,n.lat]),this.$emit("update:radius",t.getRadius())}}}}),we=b(he).extend({name:"AmapCircleMarker",amapMeta:{initComponent:async(e,t)=>new e.CircleMarker(t)}}),be=b(ue,ge).extend({amapMeta:{editable:{events:["end","move","adjust"],async loadEditor(){await l("AMap.PolyEditor")},async initEditor(e,t,n){return new e.PolyEditor(t,n,this.draggable)},onEdit(e){const t=e.target.getPath().map(j);this.$emit("update:path",t)}}},props:{path:V({type:Array,setter(e,t){const n=e;if(this.$props.editable||this.$props.editable){if(E(n.getPath().map(j),t))return}n.setPath(t)},getter:e=>e.getPath().map(j),clone:!0,equals:E,events:["dragging","dragend"]})}}),Ce=b(me,be).extend({name:"AmapPolygon",amapMeta:{initComponent:async(e,t)=>new e.Polygon(t)},methods:{getArea:Z("getArea")}}),Me=b(be,ye).extend({name:"AmapPolyline",amapMeta:{initComponent:async(e,t)=>new e.Polyline(t)},props:{geodesic:V({type:Boolean,default:void 0,setter:de("geodesic")})}});const xe="undefined"!=typeof BigInt64Array;function Ae(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const n=e.length;if(n!=t.length)return!1;for(let o=n;0!=o--;)if(!Ae(e[o],t[o]))return!1;return!0}if(e instanceof Map){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;for(const n of e.entries())if(!Ae(n[1],t.get(n[0])))return!1;return!0}if(e instanceof Set){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;return!0}if(e.constructor.BYTES_PER_ELEMENT&&(e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array||xe&&(e instanceof BigInt64Array||e instanceof BigUint64Array))){const n=e.length;if(n!=t.length)return!1;for(let o=n;0!=o--;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),o=n.length;if(o!==Object.keys(t).length)return!1;for(let e=o;0!=e--;)if(!Object.prototype.hasOwnProperty.call(t,n[e]))return!1;for(let a=o;0!=a--;){const o=n[a];if(!Ae(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function $e(e){if(!e)return;return e.map(e=>{const t=[],n=e.controlPoints;return n&&t.push(...n.map(e=>j(e))),t.push(j(e)),t})}var Ee=b(ye,ge).extend({name:"AmapBezierCurve",amapMeta:{initComponent:async(e,t)=>new e.BezierCurve(t),editable:{events:["end","adjust","addnode","removenode"],async loadEditor(){await l("AMap.BezierCurveEditor")},async initEditor(e,t,n){return new e.BezierCurveEditor(t,n,this.draggable)},onEdit(e){const t=e.target.getPath();this.$emit("update:path",$e(t))}}},props:{path:V({type:Array,setter(e,t){const n=e;if(this.$props.editable||this.$props.editable){if(Ae($e(n.getPath()),t))return}n.setPath(t)},getter:e=>$e(e.getPath()),clone:!0,equals:Ae,events:["dragging","dragend"]})}});function ke(e,t){return!(!e||!t)&&(k(e[0][0],t[0][0])&&k(e[0][1],t[0][1])&&k(e[1][0],t[1][0])&&k(e[1][1],t[1][1]))}var Be=b(me,ge).extend({name:"AmapRectangle",amapMeta:{initComponent:async(e,t)=>new e.Rectangle(t),editable:{events:["move","end","adjust"],async loadEditor(){await l("AMap.RectangleEditor")},async initEditor(e,t,n){return new e.RectangleEditor(t,n,this.draggable)},onEdit(e){const t=_(e.target.getBounds());this.$emit("update:bounds",t)}}},props:{bounds:V({type:Array,deep:!0,setter(e,t){if(this.$props.editable||this.$props.draggable){if(ke(_(e.getBounds()),t))return}e.setBounds(T(t))},getter:e=>_(e.getBounds()),transform:T,clone:!0,equals:ke,events:["dragging","dragend"]})},methods:{getArea:Z("getArea")}}),Oe=b(me,ge).extend({name:"AmapEllipse",amapMeta:{initComponent:async(e,t)=>new e.Ellipse(t),editable:{events:["move","end","adjust"],async loadEditor(){await l("AMap.EllipseEditor")},async initEditor(e,t,n){return new e.EllipseEditor(t,n,this.draggable)},onEdit(e){const t=j(e.target.getCenter());B(this.center,t)||this.$emit("update:center",t);const n=e.target.getRadius();B(this.radius,n)||this.$emit("update:radius",n.slice(0))}}},props:{center:V({type:Array,setter(e,t){if(this.$props.editable||this.$props.draggable){if(B(t,j(e.getCenter())))return}e.setCenter(t)},getter:e=>j(e.getCenter()),clone:!0,deep:!0,equals:B,events:["dragging","dragend"]}),radius:V({type:Array,setter(e,t){const n=e;if(this.$props.editable){if(B(t,n.getRadius()))return}n.setRadius(t)},clone:!0,deep:!0,equals:B})},methods:{getBounds(){return _(this.context.component.getBounds())}}}),Le=b(Q).extend({name:"AmapInfoWindow",amapMeta:{slot:!0,initComponent:async(e,t)=>new e.InfoWindow(t),events:["change","open","close"]},props:{isCustom:{type:Boolean,default:void 0},autoMove:{type:Boolean,default:void 0},closeWhenClickMap:{type:Boolean,default:void 0},visible:V({type:Boolean,default:!0,setter(e,t){t?this.open():this.close()}}),position:V({type:Array,deep:!0,setter(e,t){const n=e;if(!t)return;const o=n.getPosition();o&&B(t,j(o))||n.setPosition([t[0],t[1]])},getter:e=>j(e.getPosition()),equals:$}),offset:V({type:Array,transform:e=>new window.AMap.Pixel(e[0],e[1])}),anchor:V({type:String,setter:"setAnchor",validator:e=>ee.includes(e)}),showShadow:{type:Boolean,default:void 0}},methods:{open(){this.context.ready.then(e=>{const t=e,n=this.position;t.open(this.context.container.map,n)})},close(){this.context.ready.then(e=>{e.close()})},show(){this.open()},hide(){this.close()},onOpen(){this.visible||this.$emit("update:visible",!0)},onClose(){this.visible&&this.$emit("update:visible",!1)},_updateContent(){this.visible&&this.$nextTick(()=>{const e=this.$slots.default[0];e&&e.elm&&this.context.ready.then(t=>{t.setContent(e.elm)})})}},async mounted(){const e=await this.context.ready;this.visible&&(this._updateContent(),this.open()),e.on("open",this.onOpen),e.on("close",this.onClose)},watch:{visible:"_updateContent"}}),Se=b(X).extend({amapMeta:{events:["complete"]},props:{visible:V({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:V("setzIndex",Number),opacity:V({setter:"setOpacity",type:Number}),zooms:V({type:Array}),detectRetina:V({type:Boolean,default:void 0})},methods:{show:Z("show"),hide:Z("hide"),reload:Z("reload")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}}),Pe=b(Se).extend({name:"AmapTileLayer",amapMeta:{initComponent:async(e,t)=>new e.TileLayer(t)},props:{tileSize:V({type:Number}),tileUrl:V({type:String,setter:"setTileUrl"}),errorUrl:{type:String},getTileUrl:{type:[String,Function]}}}),je=b(Se).extend({name:"AmapTileLayerSatellite",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.Satellite(t)}}),_e=b(Se).extend({name:"AmapTileLayerFlexible",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.Flexible(t)},props:{createTile:{type:Function},cacheSize:{type:Number}}}),Te=b(Se).extend({name:"AmapTileLayerRoadNet",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.RoadNet(t)}}),ze=b(Se).extend({name:"AmapTileLayerTraffic",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.Traffic(t)}});const De=["LT","RT","LB","RB"];var Re=b(X).extend({amapMeta:{add(e,t){e.map.addControl(t)},remove(e,t){e.map.removeControl(t)}}}),Ie=b(Re).extend({name:"AmapMapType",amapMeta:{prepare:()=>l("AMap.MapType"),initComponent:async(e,t)=>new e.MapType(t)},props:{defaultType:{type:Number},showTraffic:{type:Boolean,default:void 0},showRoad:{type:Boolean,default:void 0}}}),Ne=b(Re).extend({name:"AmapControlBar",amapMeta:{prepare:()=>l("AMap.ControlBar"),initComponent:async(e,t)=>new e.ControlBar(t)},props:{position:{type:Object},showZoomBar:{type:Boolean,default:void 0},showControlButton:{type:Boolean,default:void 0}}}),qe=b(Re).extend({name:"AmapOverView",amapMeta:{prepare:()=>l("AMap.OverView"),initComponent:async(e,t)=>new e.OverView(t)},props:{visible:V({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),isOpen:V({type:Boolean,default:void 0,setter(e,t){const n=e;t?n.open():n.close()}}),tileLayer:V("setTileLayer")},methods:{show:Z("show"),hide:Z("hide"),open:Z("open"),close:Z("close")},async mounted(){await this.context.ready,D(this,"open",()=>{this.$emit("update:is-open",!0)}),D(this,"close",()=>{this.$emit("update:is-open",!1)})}}),We=b(Re).extend({name:"AmapScale",amapMeta:{prepare:()=>l("AMap.Scale"),initComponent:async(e,t)=>new e.Scale(t)},props:{position:V({type:String,validator:e=>De.includes(e)}),visible:V({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),offset:V({type:Array,transform:e=>new window.AMap.Pixel(e[0],e[1])})},methods:{show:Z("show"),hide:Z("hide"),setPosition:Z("position"),setOffset(e){this.context.component.setOffset(new window.AMap.Pixel(e[0],e[1]))}}});function Fe(e){return function(t,n){if(void 0===n)return;t[`${n?"show":"hide"}${e}`]()}}var Ve=b(Re).extend({name:"AmapToolBar",amapMeta:{prepare:()=>l("AMap.ToolBar"),initComponent:async(e,t)=>new e.ToolBar(t),events:["location","zoomchanged"]},props:{visible:V({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),position:{type:String,validator:e=>De.includes(e)},ruler:V({type:Boolean,default:void 0,setter:Fe("Ruler")}),direction:V({type:Boolean,default:void 0,setter:Fe("Direction")}),locate:V({type:Boolean,default:void 0,setter:Fe("Location")}),noIpLocale:{type:Boolean,default:void 0},liteStyle:{type:Boolean,default:void 0},autoPosition:{type:Boolean,default:void 0}},methods:{show:Z("show"),hide:Z("hide"),doLocation:Z("doLocation"),getLocation(){const e=this.context.component.getLocation();if(e)return j(e)}}});function Ze(e,t,n){if(!e)return n;var o,a;if(Array.isArray(t)&&(o=t.slice(0)),"string"==typeof t&&(o=t.split(".")),"symbol"==typeof t&&(o=[t]),!Array.isArray(o))throw new Error("props arg must be an array, a string or a symbol");for(;o.length;){if(a=o.shift(),!e)return n;if(void 0===(e=e[a]))return n}return e}const Ue=se.sealedOptions,Ke=t.extend({props:Ue.props});let He=void 0;function Je(e,t){He||(He=document.createElement("div"));const n=e;return n._props=t,n._vnode=null,n.$mount(He),n._vnode.elm}function Ye(e,t,n){const o=e[t];Array.isArray(o)&&(e[t]=new n(o[0],o[1]))}function Ge(e){return e&&0!==e.length?e.map(e=>{const t={...e};return Ye(t,"size",window.AMap.Size),Ye(t,"offset",window.AMap.Pixel),Ye(t,"imageOffset",window.AMap.Pixel),t}):e}var Xe=b(X).extend({name:"AmapMarkerCluster",amapMeta:{prepare:()=>l("AMap.MarkerClusterer"),async initComponent(e,t){return this.$scopedSlots.cluster&&(t.renderClusterMarker=this._renderCluster),new e.MarkerClusterer(this.map,[],t)},events:["click"]},data:()=>({_mcc:null}),props:{data:V({type:Array,required:!0,initialize:!1}),keyProp:V({type:[String,Function],default:"key",initialize:!1}),positionProp:V({type:[String,Function],default:"position",initialize:!1}),gridSize:V("setGridSize",Number),minClusterSize:V("setMinClusterSize",Number),maxZoom:V("setMaxZoom",Number),averageCenter:V({type:Boolean,default:void 0,setter:"setAverageCenter"}),styles:V({type:Array,setter(e,t){e.setStyles(Ge(t))},transform:Ge}),zoomOnClick:V({type:Boolean,default:void 0}),markerOptions:V({type:Function,initialize:!1}),clusterOptions:V({type:Function,initialize:!1})},mounted(){const e=function(e,t,n){let o,a,r,i,s;function p(){var l=Date.now()-i;l<t&&l>=0?o=setTimeout(p,t-l):(o=null,n||(s=e.apply(r,a),r=a=null))}null==t&&(t=100);var l=function(...l){r=this,a=l,i=Date.now();var c=n&&!o;return o||(o=setTimeout(p,t)),c&&(s=e.apply(r,a),r=a=null),s};return l.clear=function(){o&&(clearTimeout(o),o=null)},l.flush=function(){o&&(s=e.apply(r,a),r=a=null,clearTimeout(o),o=null)},l}(this._onDataChange,100),n=this.$scopedSlots.marker,o=this.$scopedSlots.cluster;this.context.ready.then(()=>{this._onDataChange()}),this._mcc={markers:new Map,clusters:new Map,MarkerRenderer:t.extend({name:"AmapMarkerClusterMarkerRenderer",props:{point:{type:Object}},render(){if(!n)return null;return Ze(n(this.point),"0",null)}}),ClusterRenderer:t.extend({name:"AmapMarkerClusterClusterRenderer",props:{context:{type:Object}},render(){if(!o)return null;return Ze(o(this.context),"0",null)}}),dummy:new Ke},this._mcc.marker=new this._mcc.MarkerRenderer,this._mcc.cluster=new this._mcc.ClusterRenderer,this.$watch("data",{handler:e})},beforeDestroy(){this._mcc.markers.clear()},methods:{_getKey(e,t){const{keyProp:n}=this;return n&&("$index"!==n||"$index"in e)?"function"==typeof n?n(e):e[n]:t},_getPosition(e){const{positionProp:t}=this;return"function"==typeof t?t(e):e[t]},async _onDataChange(){const{data:e}=this;if(await this.context.ready,this.context.destroyed)return;h("Render Markers");const t=e.map((e,t)=>this._getMarker(e,t));f("Render Markers"),h("Set Markers"),this.component.setMarkers(t),f("Set Markers")},_renderMarkerContent(e){if(this.$scopedSlots.marker)return Je(this._mcc.marker,{point:e})},_getMarker(e,t){const n=this._getKey(e,t),o=this._mcc.markers;if(o.has(n))return o.get(n);const a={};this.positionProp&&(a.position=this._getPosition(e)),"function"==typeof this.markerOptions&&Object.assign(a,this.markerOptions(e));const r=S(this,Ue.props,a,!0),i=this._renderMarkerContent(e);i&&(r.content=i);const s=new window.AMap.Marker(r);return o.set(n,s),s},_renderCluster(e){const t=Je(this._mcc.cluster,{context:e});e.marker.setContent(t);const n={};"function"==typeof this.clusterOptions&&Object.assign(n,this.clusterOptions(e));const o=Object.keys(n);if(o.length>0){const{dummy:t}=this._mcc;for(let a=0;a<o.length;++a){const r=o[a],i=n[r],s=Ue.props[r];void 0!==s&&W(t,e.marker,s,i)}}}},render:e=>null});const Qe=se.sealedOptions,et=Me.sealedOptions,tt=Ce.sealedOptions,nt=Be.sealedOptions,ot=ve.sealedOptions;var at=b(X).extend({amapMeta:{prepare:()=>l("AMap.MouseTool"),async initComponent(e){return new e.MouseTool(this.map)},add(){},remove(){}},props:{mode:V({type:String,default:"none"}),clearWhenClose:{type:Boolean,default:!0},options:{type:Object}},data:()=>({drawingMode:void 0}),methods:{close(e){this.component.close(e)},draw(){if(this.mode===this.drawingMode)return;const{mode:e}=this,t=this.component;switch(e){case"none":this.close(this.clearWhenClose);break;case"marker":t.marker(S(this,Qe.props,this.options||{}));break;case"polyline":t.polyline(S(this,et.props,this.options||{}));break;case"polygon":t.polygon(S(this,tt.props,this.options||{}));break;case"rectangle":t.rectangle(S(this,nt.props,this.options||{}));break;case"circle":t.circle(S(this,ot.props,this.options||{}));break;case"rule":t.rule(S(this,tt.props,this.options||{}));break;case"measureArea":t.measureArea(S(this,tt.props,this.options||{}));break;case"rectZoomIn":t.rectZoomIn(S(this,tt.props,this.options||{}));break;case"rectZoomOut":t.rectZoomOut(S(this,tt.props,this.options||{}))}this.drawingMode=e},_onDraw(e){if(this.mode!==this.drawingMode)return this.close(!0),void this.draw();const t=e.obj,n=this.drawingMode;let o=t;switch(n){case"marker":o=j(t.getPosition());break;case"polyline":case"polygon":o=t.getPath().map(e=>j(e));break;case"rectangle":o=_(t.getBounds());break;case"circle":o={center:j(t.getCenter()),radius:t.getRadius()};break;case"rule":o={path:t.getPath().map(e=>j(e)),length:t.getLength()};break;case"measureArea":o={path:t.getPath().map(e=>j(e)),area:t.getArea()}}this.$emit("draw",n,o),this.$emit("update:mode","none")}},async mounted(){if(await this.context.ready,this.context.destroyed)return;this.component.on("draw",this._onDraw),this.$watch("mode",async e=>{"none"!==e&&"none"!==this.drawingMode&&this.close(!0),this.draw()},{immediate:!0})}}),rt=b(X).extend({amapMeta:{events:["complete"]},props:{visible:V({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:V("setzIndex",Number),opacity:V({setter:"setOpacity",type:Number}),zooms:V({type:Array})},methods:{show:Z("show"),hide:Z("hide")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}}),it=b(rt).extend({name:"AmapImageLayer",amapMeta:{initComponent:async(e,t)=>new e.ImageLayer(t)},props:{bounds:V({type:Array,transform:T,deep:!0,setter(e,t){e.setBounds(T(t))}}),url:V({type:String,setter:"setImageUrl"})},methods:{getElement:Z("getElement")}}),st=b(rt).extend({name:"AmapVideoLayer",amapMeta:{initComponent:async(e,t)=>new e.VideoLayer(t)},props:{autoplay:{type:Boolean},loop:{type:Boolean},bounds:V({type:Array,transform:T}),url:V({type:[String,Array],setter:"setVideoUrl"})},methods:{getElement:Z("getElement")}}),pt=b(rt).extend({name:"AmapCanvasLayer",amapMeta:{slot:!0,async initComponent(e,t){const n=Ze(this,"$slots.default.0.elm");if(!n||"CANVAS"!==n.tagName)throw this.$amapLogger.warn("slot内容必须是canvas"),new Error;return t.canvas=n,new e.CanvasLayer(t)}},props:{bounds:V({type:Array,transform:T})},methods:{reFresh:Z("reFresh")}}),lt=b(rt).extend({name:"AmapCustomLayer",amapMeta:{slot:!0,async initComponent(e,t){const n=Ze(this,"$slots.default.0.elm",null),o=new e.CustomLayer(n,t);return this.render&&(o.render=this.render),o}},props:{render:V({type:Function,setter(e,t){e.render=t}})}}),ct=b(X).extend({amapMeta:{events:["complete"]},props:{visible:V({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:V("setzIndex",Number),opacity:V({setter:"setOpacity",type:Number})},methods:{show:Z("show"),hide:Z("hide")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}}),dt=b(ct).extend({name:"AmapDistrictLayerWorld",amapMeta:{prepare:()=>l("AMap.DistrictLayer"),initComponent:async(e,t)=>new e.DistrictLayer.World(t)},props:{styles:V({type:Object,setter:"setStyles"})},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}}),ut=b(ct).extend({name:"AmapDistrictLayerCountry",amapMeta:{prepare:()=>l("AMap.DistrictLayer"),initComponent:async(e,t)=>("soc"in t&&(t.SOC=t.soc,delete t.soc),new e.DistrictLayer.Country(t))},props:{styles:V({type:Object,setter:"setStyles"}),soc:V({type:String,setter:"setSOC"}),depth:{type:Number}},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}}),mt=b(ct).extend({name:"AmapDistrictLayerProvince",amapMeta:{prepare:()=>l("AMap.DistrictLayer"),initComponent:async(e,t)=>("soc"in t&&(t.SOC=t.soc,delete t.soc),new e.DistrictLayer.Province(t))},props:{styles:V({type:Object,setter:"setStyles"}),depth:{type:Number},adcode:V({type:Array})},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}}),yt={install(e){e.component("amap",Y),e.component("amap-marker",se),e.component("amap-labels-layer",pe),e.component("amap-label-marker",le),e.component("amap-text",ce),e.component("amap-circle",ve),e.component("amap-circle-marker",we),e.component("amap-polygon",Ce),e.component("amap-polyline",Me),e.component("amap-bezier-curve",Ee),e.component("amap-rectangle",Be),e.component("amap-ellipse",Oe),e.component("amap-info-window",Le),e.component("amap-tile-layer",Pe),e.component("amap-tile-layer-satellite",je),e.component("amap-tile-layer-road-net",Te),e.component("amap-tile-layer-traffic",ze),e.component("amap-tile-layer-flexible",_e),e.component("amap-map-type",Ie),e.component("amap-control-bar",Ne),e.component("amap-over-view",qe),e.component("amap-scale",We),e.component("amap-tool-bar",Ve),e.component("amap-marker-clusterer",Xe),e.component("amap-mouse-tool",at),e.component("amap-image-layer",it),e.component("amap-video-layer",st),e.component("amap-canvas-layer",pt),e.component("amap-custom-layer",lt),e.component("amap-district-layer-world",dt),e.component("amap-district-layer-country",ut),e.component("amap-district-layer-province",mt)},config:n,loadAMap:p,loadPlugins:l,withAmap:c,Amap:Y,Marker:se,LabelsLayer:pe,LabelMarker:le,Text:ce,Circle:ve,CircleMarker:we,Polygon:Ce,Polyline:Me,BezierCurve:Ee,Rectangle:Be,Ellipse:Oe,InfoWindow:Le,TileLayer:Pe,Satellite:je,Flexible:_e,RoadNet:Te,Traffic:ze,MapType:Ie,ControlBar:Ne,OverView:qe,Scale:We,ToolBar:Ve,MarkerClusterer:Xe,MouseTool:at,ImageLayer:it,VideoLayer:st,CanvasLayer:pt,CustomLayer:lt,DistrictLayerWorld:dt,DistrictLayerCountry:ut,DistrictLayerProvince:mt};e.Amap=Y,e.BezierCurve=Ee,e.CanvasLayer=pt,e.Circle=ve,e.CircleMarker=we,e.ControlBar=Ne,e.CustomLayer=lt,e.DistrictLayerCountry=ut,e.DistrictLayerProvince=mt,e.DistrictLayerWorld=dt,e.Ellipse=Oe,e.Flexible=_e,e.ImageLayer=it,e.InfoWindow=Le,e.LabelMarker=le,e.LabelsLayer=pe,e.MapType=Ie,e.Marker=se,e.MarkerClusterer=Xe,e.MouseTool=at,e.OverView=qe,e.Polygon=Ce,e.Polyline=Me,e.Rectangle=Be,e.RoadNet=Te,e.Satellite=je,e.Scale=We,e.Text=ce,e.TileLayer=Pe,e.ToolBar=Ve,e.Traffic=ze,e.VideoLayer=st,e.config=n,e.default=yt,e.loadAMap=p,e.loadPlugins=l,e.withAmap=c,Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e=e||self).AmapVue={},e.Vue)}(this,(function(e,t){"use strict";t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var n={_prefix:"https://webapi.amap.com/maps",_disableMapCache:!1,verbose:!1,version:"1.4.15",key:"",plugins:[]};function o(){const e={};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e}const a=o();let r=!1,i=!1;const s=a.promise;function p(){if(!i){if(i=!0,window.AMap)return a.resolve(window.AMap),s;const e=document.createElement("script"),t=`amap_vue_${Date.now()}_${Math.ceil(1e4*Math.random())}`,o=()=>{r||(r=!0,a.resolve(window.AMap))};window[t]=o;const p=function(e){const t=[];for(const n in e)void 0!==e[n]&&null!==e[n]&&t.push(`${n}=${encodeURIComponent(e[n])}`);return t.join("&")}({v:n.version,key:n.key,callback:t,plugin:n.plugins.join(",")}),l=`${n._prefix}?${p}`;e.src=l,document.body.appendChild(e)}return s}function l(e){return new Promise(t=>{window.AMap.plugin(e,()=>{t()})})}var c=t.extend({inject:["$amapContainer"],computed:{map(){return this.$amapContainer.map}}});function d(e){throw new Error(e)}function u(e,...t){const[n,...o]=t;if(!n)return e;const a=new Set(e);return n.forEach(t=>{a.has(t)||e.push(t)}),u(e,...o)}const m=Object.prototype.hasOwnProperty;function y(e){try{if(e.constructor&&!m.call(e,"constructor")&&!m.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(e){return!1}let t;for(t in e);return void 0===t||m.call(e,t)}function h(e){n.verbose&&console.time(e)}function f(e){n.verbose&&console.timeEnd(e)}function g(e,t,o){n.verbose&&"function"==typeof console[t]&&(e&&e.$options&&e.$options.name&&(o=[`[${e.$options.name}]`,...o]),console[t](...o))}function v(...e){g(this,"warn",e)}function w(...e){g(this,"debug",e)}function b(...e){return t.extend({mixins:e||[]})}function C(e,t){return null!=t&&e instanceof t}function M(e,t,n,o,a){"object"==typeof t&&(n=t.depth,o=t.prototype,a=t.includeNonEnumerable,t=t.circular);let r=[],i=[];return void 0===t&&(t=!0),void 0===n&&(n=1/0),function e(n,s){if(null===n)return null;if(0===s)return n;let p,l;if("object"!=typeof n)return n;if(C(n,Map))p=new Map;else if(C(n,Set))p=new Set;else if(C(n,Promise))p=new Promise((function(t,o){n.then((function(n){t(e(n,s-1))}),(function(t){o(e(t,s-1))}))}));else if(M.__isArray(n))p=[];else if(M.__isRegExp(n))p=new RegExp(n.source,A(n)),n.lastIndex&&(p.lastIndex=n.lastIndex);else if(M.__isDate(n))p=new Date(n.getTime());else if(C(n,Error))p=Object.create(n);else if(void 0===o){if(l=Object.getPrototypeOf(n),C(l,Object))return n;p=Object.create(l)}else p=Object.create(o),l=o;if(t){let e=r.indexOf(n);if(-1!=e)return i[e];r.push(n),i.push(p)}C(n,Map)&&n.forEach((function(t,n){let o=e(n,s-1),a=e(t,s-1);p.set(o,a)})),C(n,Set)&&n.forEach((function(t){let n=e(t,s-1);p.add(n)}));for(let t in n){Object.getOwnPropertyDescriptor(n,t)&&(p[t]=e(n[t],s-1));try{if(void 0===Object.getOwnPropertyDescriptor(n,t).set)continue;p[t]=e(n[t],s-1)}catch(e){if(e instanceof TypeError)continue;if(e instanceof ReferenceError)continue}}if(Object.getOwnPropertySymbols){let t=Object.getOwnPropertySymbols(n);for(let o=0;o<t.length;o++){let r=t[o],i=Object.getOwnPropertyDescriptor(n,r);(!i||i.enumerable||a)&&(p[r]=e(n[r],s-1),Object.defineProperty(p,r,i))}}if(a){let t=Object.getOwnPropertyNames(n);for(let o=0;o<t.length;o++){let a=t[o],r=Object.getOwnPropertyDescriptor(n,a);r&&r.enumerable||(p[a]=e(n[a],s-1),Object.defineProperty(p,a,r))}}return p}(e,n)}function x(e){return Object.prototype.toString.call(e)}function A(e){let t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),t}function $(e,t){return!(!e&&t)&&(!(e&&!t)&&(e===t||e[0]===t[0]&&e[1]===t[1]))}function E(e,t){return!(!e&&t)&&(!(e&&!t)&&(!e&&!t||(e===t||e.length===t.length&&e.every((e,n)=>$(e,t[n])))))}t.mixin({beforeCreate(){var e;"amapMeta"in this.$options&&(this.$amapLogger=(e=this,{warn:v.bind(e),debug:w.bind(e)}))}}),t.config.optionMergeStrategies.amapMeta=(e,t)=>function e(t,n){const o={...t};for(const a in n){const r=n[a],i=t[a];Array.isArray(r)?o[a]=u(i||[],r):y(r)?o[a]=e(i||{},r):o[a]=r}return o}(e||{},t||{}),M.clonePrototype=function(e){if(null===e)return null;let t=function(){};return t.prototype=e,new t},M.__objToStr=x,M.__isDate=function(e){return"object"==typeof e&&"[object Date]"===x(e)},M.__isArray=function(e){return"object"==typeof e&&"[object Array]"===x(e)},M.__isRegExp=function(e){return"object"==typeof e&&"[object RegExp]"===x(e)},M.__getRegExpFlags=A;function k(e,t,n=1e-7){return Math.abs(e-t)<n}function B(e,t){return!(!e&&t)&&(!(e&&!t)&&(e===t||k(e[0],t[0])&&k(e[1],t[1])))}const O=new WeakMap;function L(e,t){let n=O.get(t);if(!n){n=new Map,O.set(t,n);for(const e in t){const o=t[e];!1!==o.initialize&&n.set(e,o)}}return n.get(e)}function S(e,t,n,o){void 0===t&&(t=e.$options.props),void 0===n&&(n=e.$props);const a={};for(const o in n){const r=n[o];if(void 0===r)continue;const i=L(o,t);i&&(a[o]=i.transform?i.transform.call(e,r):r)}return o?a:M(a)}function P(e){return e.map?e.map:e.component}function j(e){return Array.isArray(e)?[e[0],e[1]]:[e.lng,e.lat]}function _(e){return Array.isArray(e)?e:e.southWest?[[e.southWest.lng,e.southWest.lat],[e.northEast.lng,e.northEast.lat]]:[[e.southwest.lng,e.southwest.lat],[e.northeast.lng,e.northeast.lat]]}function T(e){const t=new window.AMap.LngLat(e[0][0],e[0][1]),n=new window.AMap.LngLat(e[1][0],e[1][1]);return new window.AMap.Bounds(t,n)}function z(e,t,n){const o=e.$amapEvents||(e.$amapEvents={});(o[t]||(o[t]=[])).push(n)}function D(e,t,n){z(e,t,n),P(e.$amapContext).on(t,n)}function R(e){const{events:t=[]}=e.$options.amapMeta,n=P(e.$amapContext);t.forEach(t=>{e.$watch("$listeners."+t,(o,a)=>{a&&n.off(t,a),o&&(z(e,t,o),n.on(t,o))},{immediate:!0})})}function I(e,t,n,o){o||(o=P(e.$amapContext));const{events:a=[]}=n;a.forEach(a=>{const{getter:r}=n;if(!r)return;const i=a=>{const i="function"==typeof r?r.call(e,o,a):o[r](),s=e.$props[t];if("function"==typeof n.equals){if(n.equals(i,s))return}else if(i===s)return;e.$emit("update:"+t,i)};z(e,a,i),o.on(a,i)})}function N(e){const t=P(e.$amapContext),n=e.$amapEvents||{};for(const e in n){n[e].forEach(n=>{t.off(e,n)})}}const q={equals:function(e,t){return e===t},clone:!1};function W(e,t,n,o){const{setter:a}=n;a&&("function"==typeof a?a.call(e,t,o):"string"==typeof a&&(n.clone&&(o=M(o)),t[a](o)))}function F(e,t,n){t||(t=P(e.$amapContext)),n||(n=e.$options.props);for(const o in n){const a=n[o],{setter:r}=a;if(!r)continue;const i={deep:!!a.deep};e.$amapLogger.debug("watch",o,i),e.$watch("$props."+o,(n,o)=>{if(!i.deep||i.deep&&n!==o)if("function"==typeof a.equals){if(a.equals(n,o))return}else if(n===o)return;W(e,t,a,n)},i),a.events&&I(e,o,a,t)}}function V(e,t,n){if("string"==typeof e){const o=e,a={...q,setter:o};return t&&(a.type=t),arguments.length>=3&&(a.default=n),a}return{...q,...e}}function Z(e,t){return function(...n){const o=P(this.$amapContext);return o?"function"!=typeof o[e]?this.$amapLogger.warn(e+" is not a function."):(t&&(n=M(n)),o[e](...n)):this.$amapLogger.warn(`calling ${e} on ${o}`)}}function U(e){return e&&"function"==typeof e.then}function K(e){if(!e)return e;if(U(e))return e;if(e.$amapContext&&e.$amapContext.ready)return e.$amapContext.ready;if(Array.isArray(e))return Promise.all(e.map(K));if(y(e)){const n={},o=Object.keys(e),a=[];function t(e,t){n[t]=void 0,a.push(e.then(e=>{n[t]=e}))}for(let r=0;r<o.length;r++){const i=o[r],s=K(e[i]);s&&U(a)?t(s,i):n[i]=e[i]}return Promise.all(a).then((function(){return n}))}return e}function H(e){return function(t,n){t.setStatus({[e]:n})}}var J,Y=t.extend({name:"Amap",amapMeta:{events:["click","dblclick","rightclick","mapmove","movestart","moveend","hotspotclick","hotspotover","hotspotout","mousemove","mousewheel","mouseover","mouseup","mousedown","zoomchange","zoomstart","zoomend","dragstart","dragging","dragend","resize","touchstart","touchmove","touchend"]},props:{cacheKey:V({type:String,initialize:!1}),sync:V({type:Boolean,default:!1,initialize:!1}),showIndoorMap:V({type:Boolean,default:void 0,setter:H("showIndoorMap")}),resizeEnable:V({type:Boolean,default:void 0,setter:H("resizeEnable")}),dragEnable:V({type:Boolean,default:void 0,setter:H("dragEnable")}),pitchEnable:V({type:Boolean,default:void 0,setter:H("pitchEnable")}),rotateEnable:V({type:Boolean,default:void 0,setter:H("rotateEnable")}),zoomEnable:V({type:Boolean,default:void 0,setter:H("zoomEnable")}),doubleClickZoom:V({type:Boolean,default:void 0,setter:H("doubleClickZoom")}),keyboardEnable:V({type:Boolean,default:void 0,setter:H("keyboardEnable")}),jogEnable:V({type:Boolean,default:void 0,setter:H("jogEnable")}),scrollWheel:V({type:Boolean,default:void 0,setter:H("scrollWheel")}),animateEnable:V({type:Boolean,default:void 0,setter:H("animateEnable")}),isHotspot:V({type:Boolean,default:void 0,setter:H("isHotspot")}),touchEnable:V({type:Boolean,default:void 0,setter:H("touchEnable")}),viewMode:{type:String},showBuildingBlock:{type:Boolean,default:void 0},expandZoomRange:{type:Boolean,default:void 0},zooms:{type:Array},zoom:V({type:Number,equals:k,setter(e,t){const n=e;void 0!==t&&(k(n.getZoom(),t)||n.setZoom(t))},getter:"getZoom",events:["zoomchange","zoomend"]}),center:V({type:Array,deep:!0,equals:$,setter(e,t){const n=e;t&&(B(t,j(n.getCenter()))||n.setCenter([t[0],t[1]]))},getter:e=>j(e.getCenter()),events:["mapmove","moveend"]}),pitch:V({type:Number,equals:k,setter:"setPitch",getter:"getPitch",events:["dragging","dragend","moveend","pitchend"]}),rotation:V({type:Number,equals:k,setter:"setRotation",getter:"getRotation",events:["dragging","dragend","moveend","rotateend"]}),lang:V("setLang",String),mapStyle:V("setMapStyle",String),features:V("setFeatures",Array),skyColor:{type:String}},data:()=>({ready:!1}),computed:{context(){return this.$amapContext},map(){return this.context.map}},methods:{_clear(){const{context:e}=this;e.ready.then(()=>{N(this),this.clearMap(),this.clearInfoWindow()})},_getContainer(e){const{cacheKey:t}=this;if(!n._disableMapCache&&t){const n="amap-vue-container-inner-"+t;let o=document.getElementById(n)||this.$el.querySelector("#"+n);return o||(o=document.createElement("div"),o.className="amap-vue-container-inner",o.setAttribute("id",n),o.setAttribute("style","position:relative; width:100%; height:100%;")),e?(this.$el.insertAdjacentElement("afterbegin",o),o.style.display="block",o.style.pointerEvents="initial"):(o.style.display="none",o.style.pointerEvents="none"),o}return this.$el},clearMap:Z("clearMap"),clearInfoWindow:Z("clearInfoWindow"),setCenter:Z("setCenter"),setCity:Z("setCity"),getBounds(){const e=this.context.map.getBounds();return e.path?e.path.map(e=>[e[0],e[1]]):_(this.context.map.getBounds())},getSize:Z("getSize"),getResolution:Z("getResolution"),setFitView:(J="setFitView",async function(...e){const t=this.$amapContext;await t.ready;const n=P(t);if(!n)return this.$amapLogger.warn(`calling ${J} on ${n}`);if("function"!=typeof n[J])return this.$amapLogger.warn(J+" is not a function.");const o=e.map(K),a=await Promise.all(o);return t.destroyed?void 0:n[J](...a)}),lngLatToContainer(e){const t=this.map.lngLatToContainer(e);return[t.getX(),t.getY()]}},beforeCreate(){p(),this.$amapReady=o();const e={AMap:null,wrapper:null,ready:this.$amapReady.promise,map:null,vm:this,destroyed:!1};this.$amapContext=e},async mounted(){const{context:e}=this,t=await p();if(e.AMap=t,e.destroyed)return;const n=S(this),o=this._getContainer(!0),a=!!o.$amap;if(a)for(let e in n){const t=this.$options.props[e],a=n[e];W(this,o.$amap,t,a)}else o.$amap=new t.Map(o,n);const r=o.$amap;r.$vm=this,e.wrapper=o,e.map=r,F(this),R(this);const i=()=>{this.ready=!0,this.$amapReady.resolve(r),this.$emit("complete",this)};a?(await this.$nextTick(),i()):r.on("complete",i)},destroyed(){const{context:e}=this;if(!n._disableMapCache&&this.cacheKey){const e=this._getContainer(!1);document.body.appendChild(e),this._clear()}else e.map&&e.map.destroy();e.destroyed=!0},provide(){return{$amapContainer:this.context}},render(e){let t=this.$slots.default;return this.sync||this.ready||(t=void 0),e("div",{class:"amap-vue-container",style:"position:relative; width:100%; height:100%;"},t)}}),G=t.extend({computed:{context(){return this.$amapContext},component(){return this.context.component},map(){return this.context.container.map},wrapper(){return this.context.container.vm},AMap(){return this.context.AMap}}}),X=b(G).extend({inject:["$amapContainer"],amapMeta:{slot:!1,initComponent:d,add(e,t){const n=e;t.setMap(n.map)},remove(e,t){t.setMap(null)}},beforeCreate(){this.$amapReady=o(),this.$amapContext={}},created(){Object.assign(this.$amapContext,{AMap:null,ready:this.$amapReady.promise,container:this.$amapContainer,component:null,destroyed:!1})},async mounted(){const{context:e}=this,t=this.$options.amapMeta,{container:n}=e;await n.ready,e.AMap=n.AMap,t.prepare&&await t.prepare();const o=S(this);if(e.destroyed)return;const a=await t.initComponent.call(this,window.AMap,o);a.$vm=this,e.component=a,t.add.call(this,n,a),F(this),R(this),this.$amapReady.resolve(a),this.$emit("amap-ready",this)},beforeDestroy(){const{context:e}=this,{container:t,component:n}=e;if(n){N(this),this.$options.amapMeta.remove.call(this,t,n)}e.destroyed=!0},render(e){return this.$options.amapMeta.slot&&this.$slots.default?e("div",{class:"amap-vue-placeholder",style:"visibility: hidden; pointer-events: none;"},this.$slots.default):null}}),Q=b(X).extend({amapMeta:{events:["click","dblclick","rightclick","mousemove","mouseover","mouseout","mousedown","mouseup","dragstart","dragging","dragend","moving","moveend","movealong","touchstart","touchmove","touchend"]},props:{visible:V({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),cursor:V("setCursor",String),zIndex:V("setzIndex",Number),bubble:V("setBubble",Boolean,void 0),clickable:V("setClickable",Boolean,void 0),draggable:V("setDraggable",Boolean,void 0),extData:V("setExtData",Object)},methods:{show:Z("show"),hide:Z("hide"),getExtData:Z("getExtData")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}});const ee=["top-left","top-center","top-right","middle-left","center","middle-right","bottom-left","bottom-center","bottom-right"],te=["miter","round","bevel"],ne=["butt","round","square"],oe=["solid","dashed"];var ae=b(Q).extend({props:{position:V({type:Array,deep:!0,equals:$,setter(e,t){if(!t)return;const n=e;B(t,j(n.getPosition()))||n.setPosition([t[0],t[1]])},getter:e=>j(e.getPosition()),events:["dragging","dragend","moving","moveend"]}),topWhenClick:{type:Boolean,default:void 0},animation:V("setAnimation",String),angle:V({type:Number,equals:k,setter(e,t){void 0!==t&&e.setAngle(t)},getter:e=>e.getAngle(),events:["moving"]}),autoRotation:{type:Boolean,default:void 0},title:V("setTitle",String),anchor:V({type:String,setter:"setAnchor",validator:e=>ee.includes(e)}),offset:V({type:Array,deep:!0,equals:$,setter(e,t){const n=e;var o;t&&(B(t,(o=n.getOffset(),Array.isArray(o)?[o[0],o[1]]:[o.x,o.y]))||n.setOffset(new window.AMap.Pixel(t[0],t[1])))},transform:e=>new window.AMap.Pixel(e[0],e[1])}),raiseOnDrag:{type:Boolean,default:void 0}},methods:{moveAlong:Z("moveAlong",!0),moveTo:Z("moveTo",!0),stopMove:Z("stopMove")},beforeDestroy(){this.context.component&&this.stopMove()}});function re(e){if(!e)return;const t={...e};return t.offset&&(t.offset=new window.AMap.Pixel(t.offset[0],t.offset[1])),t}function ie(e){return"string"==typeof e?e:new window.AMap.Icon(e)}var se=b(ae).extend({name:"AmapMarker",amapMeta:{slot:!0,async initComponent(e,t){const n={...t};return this.$slots.default&&this.$slots.default.length>0&&(n.content=this.$slots.default[0].elm),new e.Marker(n)}},props:{content:V("setContent",String),icon:V({setter(e,t){if(!t)return;const n=e,o=ie(t);n.setIcon(o)},transform:ie}),shadow:V("setShadow"),shape:V("setShape"),label:V({type:Object,setter(e,t){t&&e.setLabel(re(t))},deep:!0,transform:re})}}),pe=b(X).extend({name:"AmapLabelsLayer",amapMeta:{slot:!0,initComponent:async(e,t)=>new e.LabelsLayer(t)},props:{visible:V({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:{type:Number},opacity:{type:Number},collision:{type:Boolean,default:void 0},animation:{type:Boolean,default:void 0}},provide(){return{$amapLabelsLayer:this.context}}}),le=b(X).extend({name:"AmapLabelMarker",inject:["$amapLabelsLayer"],amapMeta:{initComponent:async(e,t)=>new e.LabelMarker(t),async add(e,t){const n=await this.$amapLabelsLayer.ready;this.$amapContext.destroyed||n.add(t)},async remove(e,t){(await this.$amapLabelsLayer.ready).remove(t)},events:["click","mouseover","mousemove","mouseput","mousedown","mouseup","touchstart","touchend"]},props:{position:V({type:Array,deep:!0,equals:$,setter(e,t){const n=e;t&&(B(t,j(n.getPosition()))||n.setPosition([t[0],t[1]]))}}),zooms:V({type:Array,deep:!0,equals:$,setter:"setZooms"}),opacity:V("setOpacity",Number),rank:{type:Number},icon:V({type:Object,setter:"setIcon",deep:!0}),text:V({type:Object,setter:"setText",deep:!0})}}),ce=b(ae).extend({name:"AmapText",amapMeta:{initComponent:async(e,t)=>(t.domStyle&&(t.style=t.domStyle,delete t.domStyle),new e.Text(t))},props:{text:V("setText",String),domStyle:V({type:Object,setter(e,t){e.setStyle(t)},deep:!0})}});function de(e){return(t,n)=>{t.setOptions({[e]:n})}}const ue=b(Q).extend({props:{strokeColor:V({type:String,setter:de("strokeColor")}),strokeOpacity:V({type:Number,setter:de("strokeOpacity")}),strokeWeight:V({type:Number,setter:de("strokeWeight")}),strokeStyle:V({type:String,setter:de("strokeStyle"),validator:e=>oe.includes(e)}),strokeDasharray:V({type:Array,deep:!0,equals:function(e,t){return!(!e&&t)&&(!(e&&!t)&&(e===t||e.length===t.length&&e.every((e,n)=>e===t[n])))},setter:de("strokeDasharray")})},methods:{getBounds:Z("getBounds")}}),me=b(ue).extend({props:{fillColor:V({type:String,setter:de("fillColor")}),fillOpacity:V({type:Number,setter:de("fillOpacity")})},methods:{contains:Z("contains")}}),ye=b(ue).extend({props:{lineJoin:V({type:String,setter:de("lineJoin"),validator:e=>te.includes(e)}),lineCap:V({type:String,setter:de("lineCap"),validator:e=>ne.includes(e)}),showDir:V({type:Boolean,default:void 0,setter:de("showDir")}),dirColor:V({type:String,setter:de("dirColor")}),dirImg:V({type:String,setter:de("dirImg")}),isOutline:V({type:Boolean,default:void 0,setter:de("isOutline")}),outlineColor:V({type:String,setter:de("outlineColor")}),borderWeight:V({type:Number,setter:de("borderWeight")})},methods:{getLength:Z("getLength")}});var he=b(me).extend({props:{center:V({type:Array,clone:!0,deep:!0,equals:$,setter(e,t){if(!t)return;const n=e;if(this.$props.draggable||this.$props.editable){if(B(t,j(n.getCenter())))return}n.setCenter(new window.AMap.LngLat(t[0],t[1]))},getter:e=>j(e.getCenter()),events:["dragging","dragend"]}),radius:V({type:Number,setter:"setRadius"})}});const fe=b(G).extend({data:()=>({$amapEditor:null}),props:{editable:V({type:Boolean,default:!1,initialize:!1})},async mounted(){await this.context.ready;const e=this.$options.amapMeta.editable;this.editable&&e.startEditing.call(this)},beforeDestroy(){const e=this.$amapEditor;if(e){this.$options.amapMeta.editable.events.forEach(t=>{e.off(t,this.$onAmapEdit)}),e.close()}},watch:{"$props.editable"(e){const t=this.$options.amapMeta.editable;e?this.context.destroyed||t.startEditing.call(this):t.endEditing.call(this)}}});var ge=b(fe).extend({amapMeta:{editable:{events:[],loadEditor:d,initEditor:d,onEdit:d,async initEditing(){if(this.$amapEditor)return this.$amapEditor;const e=this.$options.amapMeta.editable,{context:t}=this;await t.container.ready,await this.$options.amapMeta.editable.loadEditor();const n=t.container.map,o=t.component,{AMap:a}=this;this.$amapEditor=await e.initEditor.call(this,a,n,o);const r=this.$onAmapEdit=e.onEdit.bind(this);return e.events.forEach(e=>{this.$amapEditor.on(e,r)}),this.$amapEditor},async startEditing(){const e=this.$options.amapMeta.editable;(await e.initEditing.call(this)).open()},endEditing(){this.$amapEditor&&this.$amapEditor.close()}}}}),ve=b(he,ge).extend({name:"AmapCircle",amapMeta:{initComponent:async(e,t)=>new e.Circle(t),editable:{events:["end","move","adjust"],async loadEditor(){await l("AMap.CircleEditor")},async initEditor(e,t,n){return new e.CircleEditor(t,n,this.draggable)},onEdit(e){const{target:t}=e,n=t.getCenter();this.$emit("update:center",[n.lng,n.lat]),this.$emit("update:radius",t.getRadius())}}}}),we=b(he).extend({name:"AmapCircleMarker",amapMeta:{initComponent:async(e,t)=>new e.CircleMarker(t)}}),be=b(ue,ge).extend({amapMeta:{editable:{events:["end","move","adjust"],async loadEditor(){await l("AMap.PolyEditor")},async initEditor(e,t,n){return new e.PolyEditor(t,n,this.draggable)},onEdit(e){const t=e.target.getPath().map(j);this.$emit("update:path",t)}}},props:{path:V({type:Array,setter(e,t){const n=e;if(this.$props.editable||this.$props.editable){if(E(n.getPath().map(j),t))return}n.setPath(t)},getter:e=>e.getPath().map(j),clone:!0,equals:E,events:["dragging","dragend"]})}}),Ce=b(me,be).extend({name:"AmapPolygon",amapMeta:{initComponent:async(e,t)=>new e.Polygon(t)},methods:{getArea:Z("getArea")}}),Me=b(be,ye).extend({name:"AmapPolyline",amapMeta:{initComponent:async(e,t)=>new e.Polyline(t)},props:{geodesic:V({type:Boolean,default:void 0,setter:de("geodesic")})}});const xe="undefined"!=typeof BigInt64Array;function Ae(e,t){if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;if(Array.isArray(e)){const n=e.length;if(n!=t.length)return!1;for(let o=n;0!=o--;)if(!Ae(e[o],t[o]))return!1;return!0}if(e instanceof Map){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;for(const n of e.entries())if(!Ae(n[1],t.get(n[0])))return!1;return!0}if(e instanceof Set){if(e.size!==t.size)return!1;for(const n of e.entries())if(!t.has(n[0]))return!1;return!0}if(e.constructor.BYTES_PER_ELEMENT&&(e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array||xe&&(e instanceof BigInt64Array||e instanceof BigUint64Array))){const n=e.length;if(n!=t.length)return!1;for(let o=n;0!=o--;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e),o=n.length;if(o!==Object.keys(t).length)return!1;for(let e=o;0!=e--;)if(!Object.prototype.hasOwnProperty.call(t,n[e]))return!1;for(let a=o;0!=a--;){const o=n[a];if(!Ae(e[o],t[o]))return!1}return!0}return e!=e&&t!=t}function $e(e){if(!e)return;return e.map(e=>{const t=[],n=e.controlPoints;return n&&t.push(...n.map(e=>j(e))),t.push(j(e)),t})}var Ee=b(ye,ge).extend({name:"AmapBezierCurve",amapMeta:{initComponent:async(e,t)=>new e.BezierCurve(t),editable:{events:["end","adjust","addnode","removenode"],async loadEditor(){await l("AMap.BezierCurveEditor")},async initEditor(e,t,n){return new e.BezierCurveEditor(t,n,this.draggable)},onEdit(e){const t=e.target.getPath();this.$emit("update:path",$e(t))}}},props:{path:V({type:Array,setter(e,t){const n=e;if(this.$props.editable||this.$props.editable){if(Ae($e(n.getPath()),t))return}n.setPath(t)},getter:e=>$e(e.getPath()),clone:!0,equals:Ae,events:["dragging","dragend"]})}});function ke(e,t){return!(!e||!t)&&(k(e[0][0],t[0][0])&&k(e[0][1],t[0][1])&&k(e[1][0],t[1][0])&&k(e[1][1],t[1][1]))}var Be=b(me,ge).extend({name:"AmapRectangle",amapMeta:{initComponent:async(e,t)=>new e.Rectangle(t),editable:{events:["move","end","adjust"],async loadEditor(){await l("AMap.RectangleEditor")},async initEditor(e,t,n){return new e.RectangleEditor(t,n,this.draggable)},onEdit(e){const t=_(e.target.getBounds());this.$emit("update:bounds",t)}}},props:{bounds:V({type:Array,deep:!0,setter(e,t){if(this.$props.editable||this.$props.draggable){if(ke(_(e.getBounds()),t))return}e.setBounds(T(t))},getter:e=>_(e.getBounds()),transform:T,clone:!0,equals:ke,events:["dragging","dragend"]})},methods:{getArea:Z("getArea")}}),Oe=b(me,ge).extend({name:"AmapEllipse",amapMeta:{initComponent:async(e,t)=>new e.Ellipse(t),editable:{events:["move","end","adjust"],async loadEditor(){await l("AMap.EllipseEditor")},async initEditor(e,t,n){return new e.EllipseEditor(t,n,this.draggable)},onEdit(e){const t=j(e.target.getCenter());B(this.center,t)||this.$emit("update:center",t);const n=e.target.getRadius();B(this.radius,n)||this.$emit("update:radius",n.slice(0))}}},props:{center:V({type:Array,setter(e,t){if(this.$props.editable||this.$props.draggable){if(B(t,j(e.getCenter())))return}e.setCenter(t)},getter:e=>j(e.getCenter()),clone:!0,deep:!0,equals:B,events:["dragging","dragend"]}),radius:V({type:Array,setter(e,t){const n=e;if(this.$props.editable){if(B(t,n.getRadius()))return}n.setRadius(t)},clone:!0,deep:!0,equals:B})},methods:{getBounds(){return _(this.context.component.getBounds())}}}),Le=b(Q).extend({name:"AmapInfoWindow",amapMeta:{slot:!0,initComponent:async(e,t)=>new e.InfoWindow(t),events:["change","open","close"]},props:{isCustom:{type:Boolean,default:void 0},autoMove:{type:Boolean,default:void 0},closeWhenClickMap:{type:Boolean,default:void 0},visible:V({type:Boolean,default:!0,setter(e,t){t?this.open():this.close()}}),position:V({type:Array,deep:!0,setter(e,t){const n=e;if(!t)return;const o=n.getPosition();o&&B(t,j(o))||n.setPosition([t[0],t[1]])},getter:e=>j(e.getPosition()),equals:$}),offset:V({type:Array,transform:e=>new window.AMap.Pixel(e[0],e[1])}),anchor:V({type:String,setter:"setAnchor",validator:e=>ee.includes(e)}),showShadow:{type:Boolean,default:void 0}},methods:{open(){this.context.ready.then(e=>{const t=e,n=this.position;t.open(this.context.container.map,n)})},close(){this.context.ready.then(e=>{e.close()})},show(){this.open()},hide(){this.close()},onOpen(){this.visible||this.$emit("update:visible",!0)},onClose(){this.visible&&this.$emit("update:visible",!1)},_updateContent(){this.visible&&this.$nextTick(()=>{const e=this.$slots.default[0];e&&e.elm&&this.context.ready.then(t=>{t.setContent(e.elm)})})}},async mounted(){const e=await this.context.ready;this.visible&&(this._updateContent(),this.open()),e.on("open",this.onOpen),e.on("close",this.onClose)},watch:{visible:"_updateContent"}}),Se=b(X).extend({amapMeta:{events:["complete"]},props:{visible:V({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:V("setzIndex",Number),opacity:V({setter:"setOpacity",type:Number}),zooms:V({type:Array}),detectRetina:V({type:Boolean,default:void 0})},methods:{show:Z("show"),hide:Z("hide"),reload:Z("reload")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}}),Pe=b(Se).extend({name:"AmapTileLayer",amapMeta:{initComponent:async(e,t)=>new e.TileLayer(t)},props:{tileSize:V({type:Number}),tileUrl:V({type:String,setter:"setTileUrl"}),errorUrl:{type:String},getTileUrl:{type:[String,Function]}}}),je=b(Se).extend({name:"AmapTileLayerSatellite",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.Satellite(t)}}),_e=b(Se).extend({name:"AmapTileLayerFlexible",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.Flexible(t)},props:{createTile:{type:Function},cacheSize:{type:Number}}}),Te=b(Se).extend({name:"AmapTileLayerRoadNet",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.RoadNet(t)}}),ze=b(Se).extend({name:"AmapTileLayerTraffic",amapMeta:{initComponent:async(e,t)=>new e.TileLayer.Traffic(t)}});const De=["LT","RT","LB","RB"];var Re=b(X).extend({amapMeta:{add(e,t){e.map.addControl(t)},remove(e,t){e.map.removeControl(t)}}}),Ie=b(Re).extend({name:"AmapMapType",amapMeta:{prepare:()=>l("AMap.MapType"),initComponent:async(e,t)=>new e.MapType(t)},props:{defaultType:{type:Number},showTraffic:{type:Boolean,default:void 0},showRoad:{type:Boolean,default:void 0}}}),Ne=b(Re).extend({name:"AmapControlBar",amapMeta:{prepare:()=>l("AMap.ControlBar"),initComponent:async(e,t)=>new e.ControlBar(t)},props:{position:{type:Object},showZoomBar:{type:Boolean,default:void 0},showControlButton:{type:Boolean,default:void 0}}}),qe=b(Re).extend({name:"AmapOverView",amapMeta:{prepare:()=>l("AMap.OverView"),initComponent:async(e,t)=>new e.OverView(t)},props:{visible:V({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),isOpen:V({type:Boolean,default:void 0,setter(e,t){const n=e;t?n.open():n.close()}}),tileLayer:V("setTileLayer")},methods:{show:Z("show"),hide:Z("hide"),open:Z("open"),close:Z("close")},async mounted(){await this.context.ready,D(this,"open",()=>{this.$emit("update:is-open",!0)}),D(this,"close",()=>{this.$emit("update:is-open",!1)})}}),We=b(Re).extend({name:"AmapScale",amapMeta:{prepare:()=>l("AMap.Scale"),initComponent:async(e,t)=>new e.Scale(t)},props:{position:V({type:String,validator:e=>De.includes(e)}),visible:V({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),offset:V({type:Array,transform:e=>new window.AMap.Pixel(e[0],e[1])})},methods:{show:Z("show"),hide:Z("hide"),setPosition:Z("position"),setOffset(e){this.context.component.setOffset(new window.AMap.Pixel(e[0],e[1]))}}});function Fe(e){return function(t,n){if(void 0===n)return;t[`${n?"show":"hide"}${e}`]()}}var Ve=b(Re).extend({name:"AmapToolBar",amapMeta:{prepare:()=>l("AMap.ToolBar"),initComponent:async(e,t)=>new e.ToolBar(t),events:["location","zoomchanged"]},props:{visible:V({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),position:{type:String,validator:e=>De.includes(e)},ruler:V({type:Boolean,default:void 0,setter:Fe("Ruler")}),direction:V({type:Boolean,default:void 0,setter:Fe("Direction")}),locate:V({type:Boolean,default:void 0,setter:Fe("Location")}),noIpLocale:{type:Boolean,default:void 0},liteStyle:{type:Boolean,default:void 0},autoPosition:{type:Boolean,default:void 0}},methods:{show:Z("show"),hide:Z("hide"),doLocation:Z("doLocation"),getLocation(){const e=this.context.component.getLocation();if(e)return j(e)}}});function Ze(e,t,n){if(!e)return n;var o,a;if(Array.isArray(t)&&(o=t.slice(0)),"string"==typeof t&&(o=t.split(".")),"symbol"==typeof t&&(o=[t]),!Array.isArray(o))throw new Error("props arg must be an array, a string or a symbol");for(;o.length;){if(a=o.shift(),!e)return n;if(void 0===(e=e[a]))return n}return e}const Ue=se.sealedOptions,Ke=t.extend({props:Ue.props});let He=void 0;function Je(e,t){He||(He=document.createElement("div"));const n=e;return n._props=t,n._vnode=null,n.$mount(He),n._vnode.elm}function Ye(e,t,n){const o=e[t];Array.isArray(o)&&(e[t]=new n(o[0],o[1]))}function Ge(e){return e&&0!==e.length?e.map(e=>{const t={...e};return Ye(t,"size",window.AMap.Size),Ye(t,"offset",window.AMap.Pixel),Ye(t,"imageOffset",window.AMap.Pixel),t}):e}var Xe=b(X).extend({name:"AmapMarkerCluster",amapMeta:{prepare:()=>l("AMap.MarkerClusterer"),async initComponent(e,t){return this.$scopedSlots.cluster&&(t.renderClusterMarker=this._renderCluster),new e.MarkerClusterer(this.map,[],t)},events:["click"]},data:()=>({_mcc:null}),props:{data:V({type:Array,required:!0,initialize:!1}),keyProp:V({type:[String,Function],default:"key",initialize:!1}),positionProp:V({type:[String,Function],default:"position",initialize:!1}),gridSize:V("setGridSize",Number),minClusterSize:V("setMinClusterSize",Number),maxZoom:V("setMaxZoom",Number),averageCenter:V({type:Boolean,default:void 0,setter:"setAverageCenter"}),styles:V({type:Array,setter(e,t){e.setStyles(Ge(t))},transform:Ge}),zoomOnClick:V({type:Boolean,default:void 0}),markerOptions:V({type:Function,initialize:!1}),clusterOptions:V({type:Function,initialize:!1})},mounted(){const e=function(e,t,n){let o,a,r,i,s;function p(){var l=Date.now()-i;l<t&&l>=0?o=setTimeout(p,t-l):(o=null,n||(s=e.apply(r,a),r=a=null))}null==t&&(t=100);var l=function(...l){r=this,a=l,i=Date.now();var c=n&&!o;return o||(o=setTimeout(p,t)),c&&(s=e.apply(r,a),r=a=null),s};return l.clear=function(){o&&(clearTimeout(o),o=null)},l.flush=function(){o&&(s=e.apply(r,a),r=a=null,clearTimeout(o),o=null)},l}(this._onDataChange,100),n=this.$scopedSlots.marker,o=this.$scopedSlots.cluster;this.context.ready.then(()=>{this._onDataChange()}),this._mcc={markers:new Map,clusters:new Map,MarkerRenderer:t.extend({name:"AmapMarkerClusterMarkerRenderer",props:{point:{type:Object}},render(){if(!n)return null;return Ze(n(this.point),"0",null)}}),ClusterRenderer:t.extend({name:"AmapMarkerClusterClusterRenderer",props:{context:{type:Object}},render(){if(!o)return null;return Ze(o(this.context),"0",null)}}),dummy:new Ke},this._mcc.marker=new this._mcc.MarkerRenderer,this._mcc.cluster=new this._mcc.ClusterRenderer,this.$watch("data",{handler:e})},beforeDestroy(){this._mcc.markers.clear()},methods:{_getKey(e,t){const{keyProp:n}=this;return n&&("$index"!==n||"$index"in e)?"function"==typeof n?n(e):e[n]:t},_getPosition(e){const{positionProp:t}=this;return"function"==typeof t?t(e):e[t]},async _onDataChange(){const{data:e}=this;if(await this.context.ready,this.context.destroyed)return;h("Render Markers");const t=e.map((e,t)=>this._getMarker(e,t));f("Render Markers"),h("Set Markers"),this.component.setMarkers(t),f("Set Markers")},_renderMarkerContent(e){if(this.$scopedSlots.marker)return Je(this._mcc.marker,{point:e})},_getMarker(e,t){const n=this._getKey(e,t),o=this._mcc.markers;if(o.has(n))return o.get(n);const a={};this.positionProp&&(a.position=this._getPosition(e)),"function"==typeof this.markerOptions&&Object.assign(a,this.markerOptions(e));const r=S(this,Ue.props,a,!0),i=this._renderMarkerContent(e);i&&(r.content=i);const s=new window.AMap.Marker(r);return o.set(n,s),s},_renderCluster(e){const t=Je(this._mcc.cluster,{context:e});e.marker.setContent(t);const n={};"function"==typeof this.clusterOptions&&Object.assign(n,this.clusterOptions(e));const o=Object.keys(n);if(o.length>0){const{dummy:t}=this._mcc;for(let a=0;a<o.length;++a){const r=o[a],i=n[r],s=Ue.props[r];void 0!==s&&W(t,e.marker,s,i)}}}},render:e=>null});const Qe=se.sealedOptions,et=Me.sealedOptions,tt=Ce.sealedOptions,nt=Be.sealedOptions,ot=ve.sealedOptions;var at=b(X).extend({amapMeta:{prepare:()=>l("AMap.MouseTool"),async initComponent(e){return new e.MouseTool(this.map)},add(){},remove(){}},props:{mode:V({type:String,default:"none"}),clearWhenClose:{type:Boolean,default:!0},options:{type:Object}},data:()=>({drawingMode:void 0}),methods:{close(e){this.component.close(e)},draw(){if(this.mode===this.drawingMode)return;const{mode:e}=this,t=this.component;switch(e){case"none":this.close(this.clearWhenClose);break;case"marker":t.marker(S(this,Qe.props,this.options||{}));break;case"polyline":t.polyline(S(this,et.props,this.options||{}));break;case"polygon":t.polygon(S(this,tt.props,this.options||{}));break;case"rectangle":t.rectangle(S(this,nt.props,this.options||{}));break;case"circle":t.circle(S(this,ot.props,this.options||{}));break;case"rule":t.rule(S(this,tt.props,this.options||{}));break;case"measureArea":t.measureArea(S(this,tt.props,this.options||{}));break;case"rectZoomIn":t.rectZoomIn(S(this,tt.props,this.options||{}));break;case"rectZoomOut":t.rectZoomOut(S(this,tt.props,this.options||{}))}this.drawingMode=e},_onDraw(e){if(this.mode!==this.drawingMode)return this.close(!0),void this.draw();const t=e.obj,n=this.drawingMode;let o=t;switch(n){case"marker":o=j(t.getPosition());break;case"polyline":case"polygon":o=t.getPath().map(e=>j(e));break;case"rectangle":o=_(t.getBounds());break;case"circle":o={center:j(t.getCenter()),radius:t.getRadius()};break;case"rule":o={path:t.getPath().map(e=>j(e)),length:t.getLength()};break;case"measureArea":o={path:t.getPath().map(e=>j(e)),area:t.getArea()}}this.$emit("draw",n,o),this.$emit("update:mode","none")}},async mounted(){if(await this.context.ready,this.context.destroyed)return;this.component.on("draw",this._onDraw),this.$watch("mode",async e=>{"none"!==e&&"none"!==this.drawingMode&&this.close(!0),this.draw()},{immediate:!0})}}),rt=b(X).extend({amapMeta:{events:["complete"]},props:{visible:V({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:V("setzIndex",Number),opacity:V({setter:"setOpacity",type:Number}),zooms:V({type:Array})},methods:{show:Z("show"),hide:Z("hide")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}}),it=b(rt).extend({name:"AmapImageLayer",amapMeta:{initComponent:async(e,t)=>new e.ImageLayer(t)},props:{bounds:V({type:Array,transform:T,deep:!0,setter(e,t){e.setBounds(T(t))}}),url:V({type:String,setter:"setImageUrl"})},methods:{getElement:Z("getElement")}}),st=b(rt).extend({name:"AmapVideoLayer",amapMeta:{initComponent:async(e,t)=>new e.VideoLayer(t)},props:{autoplay:{type:Boolean},loop:{type:Boolean},bounds:V({type:Array,transform:T}),url:V({type:[String,Array],setter:"setVideoUrl"})},methods:{getElement:Z("getElement")}}),pt=b(rt).extend({name:"AmapCanvasLayer",amapMeta:{slot:!0,async initComponent(e,t){const n=Ze(this,"$slots.default.0.elm");if(!n||"CANVAS"!==n.tagName)throw this.$amapLogger.warn("slot内容必须是canvas"),new Error;return t.canvas=n,new e.CanvasLayer(t)}},props:{bounds:V({type:Array,transform:T})},methods:{reFresh:Z("reFresh")}}),lt=b(rt).extend({name:"AmapCustomLayer",amapMeta:{slot:!0,async initComponent(e,t){const n=Ze(this,"$slots.default.0.elm",null),o=new e.CustomLayer(n,t);return this.render&&(o.render=this.render),o}},props:{render:V({type:Function,setter(e,t){e.render=t}})}}),ct=b(X).extend({amapMeta:{events:["complete"]},props:{visible:V({type:Boolean,default:!0,setter(e,t){const n=e;t?n.show():n.hide()}}),zIndex:V("setzIndex",Number),opacity:V({setter:"setOpacity",type:Number})},methods:{show:Z("show"),hide:Z("hide")},async mounted(){await this.context.ready,this.context.destroyed||this.visible||this.hide()}}),dt=b(ct).extend({name:"AmapDistrictLayerWorld",amapMeta:{prepare:()=>l("AMap.DistrictLayer"),initComponent:async(e,t)=>new e.DistrictLayer.World(t)},props:{styles:V({type:Object,setter:"setStyles"})},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}}),ut=b(ct).extend({name:"AmapDistrictLayerCountry",amapMeta:{prepare:()=>l("AMap.DistrictLayer"),initComponent:async(e,t)=>("soc"in t&&(t.SOC=t.soc,delete t.soc),new e.DistrictLayer.Country(t))},props:{styles:V({type:Object,setter:"setStyles"}),soc:V({type:String,setter:"setSOC"}),depth:{type:Number}},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}}),mt=b(ct).extend({name:"AmapDistrictLayerProvince",amapMeta:{prepare:()=>l("AMap.DistrictLayer"),initComponent:async(e,t)=>("soc"in t&&(t.SOC=t.soc,delete t.soc),new e.DistrictLayer.Province(t))},props:{styles:V({type:Object,setter:"setStyles"}),depth:{type:Number},adcode:V({type:Array,deep:!0,setter:"setDistricts"})},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}}),yt={install(e){e.component("amap",Y),e.component("amap-marker",se),e.component("amap-labels-layer",pe),e.component("amap-label-marker",le),e.component("amap-text",ce),e.component("amap-circle",ve),e.component("amap-circle-marker",we),e.component("amap-polygon",Ce),e.component("amap-polyline",Me),e.component("amap-bezier-curve",Ee),e.component("amap-rectangle",Be),e.component("amap-ellipse",Oe),e.component("amap-info-window",Le),e.component("amap-tile-layer",Pe),e.component("amap-tile-layer-satellite",je),e.component("amap-tile-layer-road-net",Te),e.component("amap-tile-layer-traffic",ze),e.component("amap-tile-layer-flexible",_e),e.component("amap-map-type",Ie),e.component("amap-control-bar",Ne),e.component("amap-over-view",qe),e.component("amap-scale",We),e.component("amap-tool-bar",Ve),e.component("amap-marker-clusterer",Xe),e.component("amap-mouse-tool",at),e.component("amap-image-layer",it),e.component("amap-video-layer",st),e.component("amap-canvas-layer",pt),e.component("amap-custom-layer",lt),e.component("amap-district-layer-world",dt),e.component("amap-district-layer-country",ut),e.component("amap-district-layer-province",mt)},config:n,loadAMap:p,loadPlugins:l,withAmap:c,Amap:Y,Marker:se,LabelsLayer:pe,LabelMarker:le,Text:ce,Circle:ve,CircleMarker:we,Polygon:Ce,Polyline:Me,BezierCurve:Ee,Rectangle:Be,Ellipse:Oe,InfoWindow:Le,TileLayer:Pe,Satellite:je,Flexible:_e,RoadNet:Te,Traffic:ze,MapType:Ie,ControlBar:Ne,OverView:qe,Scale:We,ToolBar:Ve,MarkerClusterer:Xe,MouseTool:at,ImageLayer:it,VideoLayer:st,CanvasLayer:pt,CustomLayer:lt,DistrictLayerWorld:dt,DistrictLayerCountry:ut,DistrictLayerProvince:mt};e.Amap=Y,e.BezierCurve=Ee,e.CanvasLayer=pt,e.Circle=ve,e.CircleMarker=we,e.ControlBar=Ne,e.CustomLayer=lt,e.DistrictLayerCountry=ut,e.DistrictLayerProvince=mt,e.DistrictLayerWorld=dt,e.Ellipse=Oe,e.Flexible=_e,e.ImageLayer=it,e.InfoWindow=Le,e.LabelMarker=le,e.LabelsLayer=pe,e.MapType=Ie,e.Marker=se,e.MarkerClusterer=Xe,e.MouseTool=at,e.OverView=qe,e.Polygon=Ce,e.Polyline=Me,e.Rectangle=Be,e.RoadNet=Te,e.Satellite=je,e.Scale=We,e.Text=ce,e.TileLayer=Pe,e.ToolBar=Ve,e.Traffic=ze,e.VideoLayer=st,e.config=n,e.default=yt,e.loadAMap=p,e.loadPlugins=l,e.withAmap=c,Object.defineProperty(e,"__esModule",{value:!0})})); |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../loadPlugins.js"),t=require("../mixins/mixins.js"),r=require("../mixins/props.js"),i=require("./base.js"),s=t.default(i.default).extend({name:"AmapDistrictLayerProvince",amapMeta:{prepare:()=>e.default("AMap.DistrictLayer"),initComponent:async(e,t)=>("soc"in t&&(t.SOC=t.soc,delete t.soc),new e.DistrictLayer.Province(t))},props:{styles:r.defineProp({type:Object,setter:"setStyles"}),depth:{type:Number},adcode:r.defineProp({type:Array})},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}});exports.default=s; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../loadPlugins.js"),t=require("../mixins/mixins.js"),r=require("../mixins/props.js"),s=require("./base.js"),i=t.default(s.default).extend({name:"AmapDistrictLayerProvince",amapMeta:{prepare:()=>e.default("AMap.DistrictLayer"),initComponent:async(e,t)=>("soc"in t&&(t.SOC=t.soc,delete t.soc),new e.DistrictLayer.Province(t))},props:{styles:r.defineProp({type:Object,setter:"setStyles"}),depth:{type:Number},adcode:r.defineProp({type:Array,deep:!0,setter:"setDistricts"})},methods:{getDistrictByContainerPos(e){return Array.isArray(e)&&(e=new AMap.Pixel(e[0],e[1])),this.component.getDistrictByContainerPos(e)}}});exports.default=i; |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../mixins/mixins.js"),t=require("../../utils/amap-helpers.js"),a=require("../mixins/props.js"),r=require("../mixins/base.js"),s=e.default(r.default).extend({name:"AmapLabelMarker",inject:["$amapLabelsLayer"],amapMeta:{initComponent:async(e,t)=>new e.LabelMarker(t),async add(e,t){const a=await this.$amapLabelsLayer.ready;this.$amapContext.destroyed||a.add(t)},async remove(e,t){(await this.$amapLabelsLayer.ready).remove(t)}},props:{position:a.defineProp({type:Array,deep:!0,equals:t.theSamePair,setter(e,a){const r=e;if(!a)return;const s=t.lngLat2Array(r.getPosition());t.nearPair(a,s)||r.setPosition([a[0],a[1]])}}),zooms:a.defineProp({type:Array,deep:!0,equals:t.theSamePair,setter:"setZooms"}),opacity:a.defineProp("setOpacity",Number),rank:{type:Number},icon:a.defineProp({type:Object,setter:"setIcon",deep:!0}),text:a.defineProp({type:Object,setter:"setText",deep:!0})}});exports.default=s; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../mixins/mixins.js"),t=require("../../utils/amap-helpers.js"),a=require("../mixins/props.js"),r=require("../mixins/base.js"),s=e.default(r.default).extend({name:"AmapLabelMarker",inject:["$amapLabelsLayer"],amapMeta:{initComponent:async(e,t)=>new e.LabelMarker(t),async add(e,t){const a=await this.$amapLabelsLayer.ready;this.$amapContext.destroyed||a.add(t)},async remove(e,t){(await this.$amapLabelsLayer.ready).remove(t)},events:["click","mouseover","mousemove","mouseput","mousedown","mouseup","touchstart","touchend"]},props:{position:a.defineProp({type:Array,deep:!0,equals:t.theSamePair,setter(e,a){const r=e;if(!a)return;const s=t.lngLat2Array(r.getPosition());t.nearPair(a,s)||r.setPosition([a[0],a[1]])}}),zooms:a.defineProp({type:Array,deep:!0,equals:t.theSamePair,setter:"setZooms"}),opacity:a.defineProp("setOpacity",Number),rank:{type:Number},icon:a.defineProp({type:Object,setter:"setIcon",deep:!0}),text:a.defineProp({type:Object,setter:"setText",deep:!0})}});exports.default=s; |
{ | ||
"name": "@amap/amap-vue", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "build": "npm run build:gen-esm-manifest && npm run build:dist && npm run build:esm", |
640051
13719