7.chunk.js
55.5 KB
webpackJsonpecCom([7],{1002:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={MARKER_ID_CONFLICT:"Marker 的 id 属性重复",MARKER_ID_REQUIRED:"每一个 Marker 必需有一个 id 属性",MAP_INSTANCE_REQUIRED:"没有地图实例;组件必须作为 Map 的子组件使用",CIRCLE_INSTANCE_REQUIRED:"",CIRCLE_CENTER_REQUIRED:"Circle 组件必需设置 center 属性",CIRCLE_RADIUS_REQUIRED:"Circle 组件必需设置 radius 属性",SRC_REQUIRED:"GroundImage 组件必需设置 src 属性",BOUNDS_REQUIRED:"GroundImage 组件必需设置 bounds 属性",WINDOW_POSITION_REQUIRED:"InfoWindow 组件必需设置 position 属性",INVALID_AMAP_PLUGIN:"plugins 属性不正确;目前支持的插件有'Scale', 'ToolBar', 'MapType', 'OverView'"},o=function(e){return e in r?r[e]:e},i={error:function(e){throw new Error(o(e))},warning:function(e){console.warn(o(e))},optimize:function(e){console.log("%c"+o(e),"color:#d4d483;border-left: 2px solid #d4d483;padding-left: 4px;")}};t.default=i},1003:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function a(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function u(e){return function(t){function n(e){o(this,n);var t=i(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));return t.instanceCreated=!1,t.myMapComponent=null,t.registeredEvents=[],t.onInstanceCreated=t.onInstanceCreated.bind(t),t}return a(n,t),s(n,[{key:"onInstanceCreated",value:function(){if(this.instanceCreated=!0,"events"in this.props){var e=this.myMapComponent.instance;this.props.events.created&&this.props.events.created(e)}this.reactivePropChange(this.props,!1)}},{key:"createEventsProxy",value:function(e){var t=this,n=this.myMapComponent.instance,r=Object.keys(e.events||{});r.length&&r.forEach(function(e){-1===t.registeredEvents.indexOf(e)&&(t.registeredEvents.push(e),n.on(e,function(e){return function(){if(t.props.events&&e in t.props.events){for(var n=arguments.length,r=Array(n),o=0;o<n;o++)r[o]=arguments[o];t.props.events[e].apply(null,r)}}}(e)))})}},{key:"componentWillReceiveProps",value:function(e){this.reactivePropChange(e,!0)}},{key:"reactivePropChange",value:function(e){var t=this,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(!this.instanceCreated)return!1;var r=this.myMapComponent,o=r.setterMap,i=void 0===o?{}:o,a=r.converterMap,u=void 0===a?{}:a,l=r.instance,s=void 0===l?{}:l,c=Object.keys(e);c.length&&c.forEach(function(r){if("events"===r)return t.createEventsProxy(e);var o=!0;if(n&&(o=t.detectPropChange(r,e,t.props)),!o)return!1;var a=e[r];if(r in u&&(a=u[r](e[r])),r in i)i[r](a);else{var l="set"+(0,d.default)(r);l in s&&s[l](a)}})}},{key:"detectPropChange",value:function(e,t,n){return t[e]!==n[e]}},{key:"render",value:function(){var t=this;return f.default.createElement(e,l({onInstanceCreated:this.onInstanceCreated,ref:function(e){t.myMapComponent=e}},this.props))}},{key:"componentWillUnmount",value:function(){var e=this.myMapComponent.instance;e&&("destroy"in e&&setTimeout(function(){e.destroy()},10),"hide"in e&&e.hide(),"__map__"in this.props&&"setMap"in e&&e.setMap(null))}}]),n}(f.default.Component)}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(2),f=r(c),p=n(1218),d=r(p);t.default=u},1004:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="undefined"!==typeof window,o=t.toLnglat=function(e){if(!e)return e;if("getLng"in e&&"getLat"in e)return e;var t=0,n=0;return"[object Array]"==={}.toString.call(e)?(t=e[0],n=e[1]):"lng"in e&&"lat"in e?(t=e.lng,n=e.lat):"longitude"in e&&"latitude"in e&&(t=e.longitude,n=e.latitude),r?new window.AMap.LngLat(t,n):null},i=t.toPixel=function(e){if(!e)return e;if("getX"in e&&"getY"in e)return e;var t=0,n=0;return"[object Array]"==={}.toString.call(e)?(t=e[0],n=e[1]):"x"in e&&"y"in e&&(t=e.x,n=e.y),r?new window.AMap.Pixel(t,n):null},a=t.toSize=function(e){return e?"getWidth"in e?e:r?new window.AMap.Size(e.width,e.height):null:e};t.default={toLnglat:o,toPixel:i,toSize:a}},1012:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){return!!e&&"function"===typeof e};t.default=r},1031:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function a(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(2),s=r(l),c=n(1003),f=r(c),p=n(1002),d=r(p),h=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if("undefined"!==typeof window)if(e.__map__&&e.__poly__){var r=n;n.setterMap={active:function(e){r.toggleActive(e)}},n.map=e.__map__,n.poly=e.__poly__,n.editorActive=!1,n.createEditorInstance().then(function(){n.props.onInstanceCreated&&n.props.onInstanceCreated()})}else d.default.warning("MAP_INSTANCE_REQUIRED");return n}return a(t,e),u(t,[{key:"toggleActive",value:function(e){e?this.editorActive||this.activeEditor():this.editorActive&&this.inactiveEditor()}},{key:"activeEditor",value:function(){this.polyEditor&&(this.editorActive=!0,this.polyEditor.open())}},{key:"inactiveEditor",value:function(){this.editorActive=!1,this.polyEditor&&this.polyEditor.close()}},{key:"createEditorInstance",value:function(){var e=this;return this.polyEditor?Promise.resolve(this.polyEditor):new Promise(function(t){e.map.plugin(["AMap.PolyEditor"],function(){e.polyEditor=new window.AMap.PolyEditor(e.map,e.poly),t(e.polyEditor)})})}},{key:"render",value:function(){return null}},{key:"instance",get:function(){return this.polyEditor}}]),t}(s.default.Component);t.default=(0,f.default)(h)},1054:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.renderMarkerComponent=t.getPropValue=t.MarkerAllProps=t.MarkerConfigurableProps=void 0;var o=n(1004),i=n(2),a=r(i),u=n(51),l=n(1012),s=r(l),c=t.MarkerConfigurableProps=["position","offset","icon","content","draggable","visible","zIndex","angle","animation","shadow","title","clickable","extData","label"],f=t.MarkerAllProps=c.concat(["topWhenClick","bubble","raiseOnDrag","cursor","autoRotation","shape"]);t.getPropValue=function(e,t){return-1===f.indexOf(e)?null:"position"===e?(0,o.toLnglat)(t):"offset"===e?(0,o.toPixel)(t):t},t.renderMarkerComponent=function(e,t){var n=e;if((0,s.default)(e)){n=e(t.getExtData())}n&&(0,u.render)(a.default.createElement("div",null,n),t.getContent())}},1215:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.MouseTool=t.Marker=t.GroundImage=t.InfoWindow=t.PolyEditor=t.Polyline=t.Polygon=t.CircleEditor=t.Circle=t.Markers=t.Map=void 0;var o=n(1216),i=r(o),a=n(1219),u=r(a),l=n(1220),s=r(l),c=n(1221),f=r(c),p=n(1222),d=r(p),h=n(1223),v=r(h),m=n(1224),y=r(m),w=n(1225),g=r(w),b=n(1226),_=r(b),k=n(1031),C=r(k),M=n(1227),E=r(M);t.Map=i.default,t.Markers=s.default,t.Circle=f.default,t.CircleEditor=_.default,t.Polygon=d.default,t.Polyline=v.default,t.PolyEditor=C.default,t.InfoWindow=y.default,t.GroundImage=g.default,t.Marker=u.default,t.MouseTool=E.default,t.default={Map:i.default,Markers:s.default,Circle:f.default,CircleEditor:_.default,Polygon:d.default,Polyline:v.default,PolyEditor:C.default,InfoWindow:y.default,GroundImage:g.default,Marker:u.default,MouseTool:E.default}},1216:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function u(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),c=n(2),f=r(c),p=n(1217),d=r(p),h=n(1012),v=r(h),m=n(1002),y=r(m),w=n(1004),g=n(1003),b=r(g),_=f.default.Component,k=f.default.Children,C={width:"100%",height:"100%"},M={width:"100%",height:"100%",position:"relative"},E=["layers","zoom","center","labelzIndex","mapStyle","features","cursor","pitch"],O=["animateEnable","doubleClickZoom","dragEnable","isHotspot","jogEnable","keyboardEnable","resizeEnable","rotateEnable","scrollWheel","touchZoom","zoomEnable"],P=["view","zooms","showIndoorMap","indoorMap","expandZoomRange","showBuildingBlock","viewMode","pitchEnable","buildingAnimation","skyColor"],I=E.concat(O,P),j={MapType:{showRoad:!1,showTraffic:!1,defaultType:0},ToolBar:{position:"RB",noIpLocate:!0,locate:!0,liteStyle:!0,autoPosition:!1},OverView:{},ControlBar:{}},S=function(e){function t(e){i(this,t);var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));n.state={mapLoaded:!1};var r=n;return n.setterMap={zoom:function(e){r.map.setZoom(e)},cursor:function(e){r.map.setDefaultCursor(e)},labelzIndex:function(e){r.map.setlabelzIndex(e)}},n.converterMap={center:w.toLnglat},"undefined"!==typeof window&&(n.pluginMap={},new d.default({key:e.amapkey,useAMapUI:e.useAMapUI,version:e.version,protocol:e.protocol}).load().then(function(){n.createInstance(),n.state.mapLoaded||n.setState({mapLoaded:!0})})),n}return u(t,e),s(t,[{key:"componentWillReceiveProps",value:function(e){this.state.mapLoaded&&this.updateMapProps(this.props,e)}},{key:"renderChildren",value:function(){var e=this;return k.map(this.props.children,function(t){if(t){var n=t.type;return n.preventAmap||"string"===typeof n?t:f.default.cloneElement(t,{__map__:e.map})}return t})}},{key:"createInstance",value:function(){if(!this.map){var e=this.buildCreateOptions();this.map=new window.AMap.Map(this.mapWrapper,e),this.setPlugins(this.props),this.props.onInstanceCreated&&this.props.onInstanceCreated()}}},{key:"buildCreateOptions",value:function(){var e=this,t=this.props,n={};return I.forEach(function(r){r in t&&(n[r]=e.getSetterValue(r,t))}),n}},{key:"updateMapProps",value:function(e,t){var n=this,r={},o=!1,i=!1;O.forEach(function(a){a in t&&(i=!0,n.detectPropChanged(a,e,t)&&(o=!0,r[a]=t[a]))}),o&&this.map.setStatus(r),i&&"status"in t&&y.default.warning("以下这些属性可以单独提供进行配置,也可以统一作为‘status’属性配置;但是请不要同时使用这两种方式。\n("+O.join(", ")+")"),P.forEach(function(r){r in t&&n.detectPropChanged(r,e,t)&&y.default.warning("'"+r+"' 是一个静态属性,地图实例创建成功后无法修改")}),this.setPlugins(t)}},{key:"getSetterValue",value:function(e,t){return e in this.converterMap?this.converterMap[e](t[e]):t[e]}},{key:"detectPropChanged",value:function(e,t,n){return t[e]!==n[e]}},{key:"setPlugins",value:function(e){var t=this,n=["Scale","ToolBar","MapType","OverView","ControlBar"];if("plugins"in e){var r=e.plugins;r&&r.length&&r.forEach(function(e){var r=void 0,o=void 0,i=void 0;"string"===typeof e?(r=e,o=null,i=!0):(r=e.name,o=e.options||{},i=!("visible"in o&&"boolean"===typeof o.visible)||o.visible,delete o.visible);var a=n.indexOf(r);-1===a?y.default.warning("没有 ‘"+r+"’ 这个插件,请检查是否拼写错误"):i&&(n.splice(a,1),t.installPlugin(r,o))})}this.removeOrDisablePlugins(n)}},{key:"removeOrDisablePlugins",value:function(e){var t=this;e&&e.length&&e.forEach(function(e){e in t.pluginMap&&("ControlBar"===e?(t.map.removeControl(t.pluginMap[e]),delete t.pluginMap[e]):t.pluginMap[e].hide())})}},{key:"installPlugin",value:function(e,t){switch(t=t||{},e){case"Scale":case"ToolBar":case"OverView":case"MapType":this.setMapPlugin(e,t);break;case"ControlBar":this.setControlBar(t)}}},{key:"setMapPlugin",value:function(e,t){var n=this;if(this.pluginMap[e])this.pluginMap[e].show();else{var r=t.onCreated,i=o(t,["onCreated"]),a=l({},j[e],i);this.map.plugin(["AMap."+e],function(){n.pluginMap[e]=new window.AMap[e](a),n.map.addControl(n.pluginMap[e]),(0,v.default)(r)&&r(n.pluginMap[e])})}}},{key:"setControlBar",value:function(e){var t=this;if(this.pluginMap.ControlBar);else{var n=e.onCreated,r=o(e,["onCreated"]),i=l({},j.ControlBar,r);this.map.plugin(["AMap.ControlBar"],function(){t.pluginMap.ControlBar=new window.AMap.ControlBar(i),t.map.addControl(t.pluginMap.ControlBar),(0,v.default)(n)&&n(t.pluginMap.ControlBar)})}}},{key:"render",value:function(){var e=this;return f.default.createElement("div",{style:M},f.default.createElement("div",{ref:function(t){e.mapWrapper=t},style:C},this.state.mapLoaded?null:this.props.loading||null),f.default.createElement("div",null,this.state.mapLoaded?this.renderChildren():null))}},{key:"instance",get:function(){return this.map}}]),t}(_);t.default=(0,b.default)(S)},1217:function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a={v:"1.4.0",hostAndPath:"webapi.amap.com/maps",key:"f97efc35164149d0c0f299e7a8adb3d2",callback:"__amap_init_callback",useAMapUI:!1},u=null,l=null,s=!1,c=function(){function e(t){var n=t.key,i=t.useAMapUI,u=t.version,l=t.protocol;r(this,e),this.config=o({},a,{useAMapUI:i,protocol:l}),"undefined"!==typeof window&&(n?this.config.key=n:"amapkey"in window&&(this.config.key=window.amapkey)),u&&(this.config.v=u),this.protocol=l||window.location.protocol,-1===this.protocol.indexOf(":")&&(this.protocol+=":")}return i(e,[{key:"getScriptSrc",value:function(e){return this.protocol+"//"+e.hostAndPath+"?v="+e.v+"&key="+e.key+"&callback="+e.callback}},{key:"buildScriptTag",value:function(e){var t=document.createElement("script");return t.type="text/javascript",t.async=!0,t.defer=!0,t.src=e,t}},{key:"getAmapuiPromise",value:function(){var e=this.buildScriptTag(this.protocol+"//webapi.amap.com/ui/1.0/main-async.js"),t=new Promise(function(t){e.onload=function(){t()}});return document.body.appendChild(e),t}},{key:"getMainPromise",value:function(){var e=this,t=this.buildScriptTag(this.getScriptSrc(this.config)),n=new Promise(function(t){window[e.config.callback]=function(){t(),delete window[e.config.callback]}});return document.body.appendChild(t),n}},{key:"load",value:function(){if("undefined"===typeof window)return null;var e=this.config.useAMapUI;return u=u||this.getMainPromise(),e&&(l=l||this.getAmapuiPromise()),new Promise(function(t){u.then(function(){e&&l?l.then(function(){window.initAMapUI&&!s&&(window.initAMapUI(),"function"===typeof e&&e(),s=!0),t()}):t()})})}}]),e}();t.default=c},1218:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){return e[0].toUpperCase()+e.slice(1,e.length)};t.default=r},1219:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function a(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),s=n(2),c=r(s),f=n(51),p=n(1002),d=r(p),h=n(1003),v=r(h),m=n(1054),y=n(1004),w=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if("undefined"!==typeof window)if(e.__map__){var r=n;n.setterMap={visible:function(e){e?r.marker&&r.marker.show():r.marker&&r.marker.hide()},zIndex:function(e){r.marker&&r.marker.setzIndex(e)}},n.converterMap={position:y.toLnglat,offset:y.toPixel},n.map=e.__map__,n.element=n.map.getContainer(),setTimeout(function(){n.createMarker(e)},13)}else d.default.warning("MAP_INSTANCE_REQUIRED");return n}return a(t,e),l(t,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"componentWillReceiveProps",value:function(e){this.map&&this.refreshMarkerLayout(e)}},{key:"createMarker",value:function(e){var t=this.buildCreateOptions(e);this.marker=new window.AMap.Marker(t),this.marker.render=function(e){return function(t){(0,m.renderMarkerComponent)(t,e)}}(this.marker),this.props.onInstanceCreated&&this.props.onInstanceCreated(),this.setMarkerLayout(e),this.setChildComponent(e)}},{key:"buildCreateOptions",value:function(e){var t=this,n={};return m.MarkerAllProps.forEach(function(r){r in e&&(n[r]=t.getSetterParam(r,e[r]))}),n.map=this.map,n}},{key:"setMarkerLayout",value:function(e){("render"in e||"children"in e&&e.children)&&(this.createContentWrapper(),"className"in e&&e.className&&(this.contentWrapper.className=e.className))}},{key:"createContentWrapper",value:function(){this.contentWrapper=document.createElement("div"),this.marker.setContent(this.contentWrapper)}},{key:"setChildComponent",value:function(e){if(this.contentWrapper)if("className"in e&&e.className&&(this.contentWrapper.className=e.className),"render"in e)(0,m.renderMarkerComponent)(e.render,this.marker);else if("children"in e){var t=e.children,n="undefined"===typeof t?"undefined":u(t);"undefined"!==n&&this.contentWrapper&&(0,f.render)(c.default.createElement("div",null,t),this.contentWrapper)}}},{key:"refreshMarkerLayout",value:function(e){this.setChildComponent(e)}},{key:"getSetterParam",value:function(e,t){return e in this.converterMap?this.converterMap[e](t):t}},{key:"render",value:function(){return null}},{key:"instance",get:function(){return this.marker}}]),t}(c.default.Component);t.default=(0,v.default)(w)},1220:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function a(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(2),s=r(l),c=n(51),f=n(1012),p=r(f),d=n(1002),h=r(d),v=n(1054);if("undefined"!==typeof window){var m=document.head||document.getElementsByTagName("head")[0],y=document.createElement("style");y.type="text/css",y.textContent=".amap_markers_pop_window{\n padding: 10px;\n border: 1px solid #ddd;\n border-radius: 8px;\n background: #fff;\n position: relative;\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n}\n.amap_markers_pop_window::before{\n content: ' ';\n display: block;\n position: absolute;\n bottom: -12px;\n left: 50%;\n margin-left: -7px;\n width: 0;\n height: 0;\n border-top: 12px solid #ddd;\n border-left: 7px solid transparent;\n border-right: 7px solid transparent;\n}\n.amap_markers_pop_window::after{\n content: ' ';\n display: block;\n position: absolute;\n bottom: -11px;\n left: 50%;\n margin-left: -6px;\n width: 0;\n height: 0;\n border-top: 11px solid #fff;\n border-left: 6px solid transparent;\n border-right: 6px solid transparent;\n}\n.amap_markers_pop_window_item{\n cursor:pointer;\n width: 40px;\n height: 50px;\n display: flex;\n align-items: flex-end;\n justify-content: center;\n}\n.amap_markers_pop_window_item span{\n pointer-events: none;\n}\n.amap_markers_window_overflow_warning{\n text-align: center;\n width: 100%;\n margin: 5px 0;\n color: #666;\n}",m.appendChild(y)}var w=s.default.Component,g=25.6,b=46*.8-2,_=46*.8,k=66*.8-2,C={useCluster:!1,markersCache:[],markerIDCache:[]},M=["gridSize","minClusterSize","maxZoom","averageCenter","styles","zoomOnClick","renderCluserMarker"],E=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return"undefined"!==typeof window&&(e.__map__?(n.map=e.__map__,n.element=n.map.getContainer(),n.markersCache=C.markersCache,n.useCluster=null,n.markerIDCache=C.markerIDCache,n.resetOffset=new window.AMap.Pixel(-g/2,-b),n.hoverOffset=new window.AMap.Pixel(-_/2,-k),n.createMarkers(e)):h.default.warning("MAP_INSTANCE_REQUIRED")),n}return a(t,e),u(t,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"createMarkers",value:function(e){var t=this,n=e.markers||[],r=[],o={};n.length&&n.forEach(function(n,i){var a=t.buildCreateOptions(e,n,i);a.map=t.map;var u=null;if((0,p.default)(e.render)){var l=e.render(n);if(!1!==l){var s=document.createElement("div");s.setAttribute("__react_amap__","1"),u=s,o[i]=l}}if(!u){u=document.createElement("div");var c=document.createElement("img");c.src="//webapi.amap.com/theme/v1.3/markers/n/mark_bs.png",u.appendChild(c)}a.content=u;var f=new window.AMap.Marker(a);f.on("click",function(e){t.onMarkerClick(e)}),f.on("mouseover",function(e){t.onMarkerHover(e)}),f.on("mouseout",function(e){t.onMarkerHoverOut(e)}),f.render=function(e){return function(t){return(0,v.renderMarkerComponent)(t,e)}}(f),t.bindMarkerEvents(f),r.push(f)}),this.markersCache=r,this.markerReactChildDOM=o,this.exposeMarkerInstance(),this.checkClusterSettings(e)}},{key:"checkClusterSettings",value:function(e){var t=this;if(e.useCluster)this.loadClusterPlugin(e.useCluster).then(function(e){e.setMarkers(t.markersCache)});else if(this.mapCluster){var n=this.mapCluster.getMarkers();this.mapCluster.clearMarkers(),n.forEach(function(e){e.setMap(t.map)})}}},{key:"componentDidMount",value:function(){this.map&&this.setMarkerChild()}},{key:"setMarkerChild",value:function(){var e=this;Object.keys(this.markerReactChildDOM).forEach(function(t){var n=e.markersCache[t].getContent(),r=e.markerReactChildDOM[t];e.renderMarkerChild(n,r)})}},{key:"renderMarkerChild",value:function(e,t){(0,c.render)(s.default.createElement("div",null,t),e)}},{key:"buildCreateOptions",value:function(e,t,n){var r={},o=["extData"];return v.MarkerAllProps.forEach(function(i){if(i in t&&-1===o.indexOf(i))r[i]=(0,v.getPropValue)(i,t[i]);else if(i in e)if((0,p.default)(e[i])){var a=e[i].call(null,t,n);r[i]=(0,v.getPropValue)(i,a)}else r[i]=(0,v.getPropValue)(i,e[i])}),r.extData=t,r}},{key:"componentWillReceiveProps",value:function(e){this.map&&this.refreshMarkersLayout(e)}},{key:"refreshMarkersLayout",value:function(e){var t=e.markers!==this.props.markers,n=!!this.props.useCluster!==!!e.useCluster;t&&(this.markersCache.length&&this.markersCache.forEach(function(e){e&&(e.setMap(null),e=null)}),this.markersCache=C.markersCache,this.createMarkers(e),this.setMarkerChild()),(t||n)&&this.markersWindow&&this.markersWindow.close(),n&&this.checkClusterSettings(e)}},{key:"loadClusterPlugin",value:function(e){var t=this;if(this.mapCluster)return Promise.resolve(this.mapCluster);var n="boolean"===typeof e?{}:e;return new Promise(function(e){t.map.plugin(["AMap.MarkerClusterer"],function(){e(t.createClusterPlugin(n))})})}},{key:"createClusterPlugin",value:function(e){var t={},n={minClusterSize:2,zoomOnClick:!1,maxZoom:18,gridSize:60,averageCenter:!0};M.forEach(function(r){t[r]=r in e?e[r]:n[r]}),this.mapCluster=new window.AMap.MarkerClusterer(this.map,[],t);var r={};return"events"in e&&"created"in(r=e.events)&&r.created(this.mapCluster),this.initClusterMarkerWindow(),this.bindClusterEvent(r),this.mapCluster}},{key:"onMarkerClick",value:function(e){var t=e.target;this.triggerMarkerClick(e,t)}},{key:"onMarkerHover",value:function(e){e.target.setTop(!0),this.setMarkerHovered(e,e.target)}},{key:"onMarkerHoverOut",value:function(e){e.target.setTop(!1),this.setMarkerHoverOut(e,e.target)}},{key:"onWindowMarkerClick",value:function(e){var t=e.markerRef;this.triggerMarkerClick(null,t)}},{key:"onWindowMarkerHover",value:function(e){var t=e.markerRef;this.setMarkerHovered(null,t)}},{key:"onWindowMarkerHoverOut",value:function(e){var t=e.markerRef;this.setMarkerHoverOut(null,t)}},{key:"setMarkerHovered",value:function(e,t){this.triggerMarkerHover(e,t)}},{key:"setMarkerHoverOut",value:function(e,t){this.triggerMarkerHoverOut(e,t)}},{key:"triggerMarkerClick",value:function(e,t){var n=this.props.events||{};(0,p.default)(n.click)&&n.click(e,t)}},{key:"triggerMarkerHover",value:function(e,t){var n=this.props.events||{};(0,p.default)(n.mouseover)&&n.mouseover(e,t)}},{key:"triggerMarkerHoverOut",value:function(e,t){var n=this.props.events||{};(0,p.default)(n.mouseout)&&n.mouseout(e,t)}},{key:"initClusterMarkerWindow",value:function(){this.markersWindow=new window.AMap.InfoWindow({isCustom:!0,autoMove:!0,closeWhenClickMap:!0,content:"<span>loading...</span>",showShadow:!1,offset:new window.AMap.Pixel(0,-20)}),this.markersDOM=document.createElement("div"),this.markersDOM.className="amap_markers_pop_window",this.markersWindow.setContent(this.markersDOM)}},{key:"bindClusterEvent",value:function(e){var t=this;this.mapCluster.on("click",function(n){if(t.props.useCluster&&t.props.useCluster.zoomOnClick);else{var r=!0;(0,p.default)(e.click)&&(r=e.click(n)),!1!==r&&t.showMarkersInfoWindow(n)}})}},{key:"showMarkersInfoWindow",value:function(e){var t=this,n=e.lnglat,r=e.markers;if(this.markersDOM.innerHTML="",r&&r.length){var o=r.length;if(o>42&&(r=r.slice(0,42)),r.forEach(function(e){var n=e.getContent(),r=document.createElement("div");r.className="window_marker_item",r.appendChild(n),r.markerRef=e,r.addEventListener("click",t.onWindowMarkerClick.bind(t,r),!0),r.addEventListener("mouseover",t.onWindowMarkerHover.bind(t,r),!0),r.addEventListener("mouseout",t.onWindowMarkerHoverOut.bind(t,r),!0),t.markersDOM.appendChild(r)}),o>42){var i=document.createElement("div");i.className="amap_markers_window_overflow_warning",i.innerText="更多坐标请放大地图查看",this.markersDOM.appendChild(i)}}this.markersWindow.open(this.map,n)}},{key:"exposeMarkerInstance",value:function(){if("events"in this.props){var e=this.props.events||{};(0,p.default)(e.created)&&e.created(this.markersCache)}}},{key:"bindMarkerEvents",value:function(e){var t=this.props.events||{},n=Object.keys(t),r=["click","mouseover","mouseout","created"];n.length&&n.forEach(function(n){-1===r.indexOf(n)&&e.on(n,t[n])})}},{key:"render",value:function(){return null}}]),t}(w);t.default=E},1221:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function a(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(2),s=r(l),c=n(1003),f=r(c),p=n(1002),d=r(p),h=n(1004),v=["center","radius","draggable","extData","visible","style"],m=v.concat(["zIndex","bubble"]),y=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if("undefined"!==typeof window)if(e.__map__){var r=n;n.setterMap={visible:function(e){r.mapCircle&&(e?r.mapCircle.show():r.mapCircle.hide())},style:function(e){r.mapCircle&&r.mapCircle.setOptions(e)}},n.converterMap={center:h.toLnglat},n.state={loaded:!1},n.map=e.__map__,n.element=n.map.getContainer(),n.createInstance(e).then(function(){n.setState({loaded:!0}),n.props.onInstanceCreated&&n.props.onInstanceCreated()})}else d.default.warning("MAP_INSTANCE_REQUIRED");return n}return a(t,e),u(t,[{key:"createInstance",value:function(e){var t=this.buildCreateOptions(e);return t.map=this.map,this.mapCircle=new window.AMap.Circle(t),Promise.resolve(this.mapCircle)}},{key:"buildCreateOptions",value:function(e){var t=this,n={};return m.forEach(function(r){if(r in e)if("style"===r&&void 0!==e.style){var o=Object.keys(e.style);o.forEach(function(t){n[t]=e.style[t]})}else n[r]=t.getSetterValue(r,e)}),n}},{key:"getSetterValue",value:function(e,t){return e in this.converterMap?this.converterMap[e](t[e]):t[e]}},{key:"renderEditor",value:function(e){return e?1!==s.default.Children.count(e)?null:s.default.cloneElement(s.default.Children.only(e),{__circle__:this.mapCircle,__map__:this.map,__ele__:this.element}):null}},{key:"render",value:function(){return this.state.loaded?this.renderEditor(this.props.children):null}},{key:"instance",get:function(){return this.mapCircle}}]),t}(s.default.Component);t.default=(0,f.default)(y)},1222:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function a(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(2),s=r(l),c=n(1003),f=r(c),p=n(1002),d=r(p),h=n(1031),v=r(h),m=n(1004),y=["path","draggable","extData","style","visible"],w=y.concat(["zIndex","bubble"]),g=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if("undefined"!==typeof window)if(e.__map__){var r=n;n.setterMap={visible:function(e){e?r.polygon&&r.polygon.show():r.polygon&&r.polygon.hide()},style:function(e){r.polygon.setOptions(e)}},n.converterMap={path:function(e){return r.buildPathValue(e)}},n.state={loaded:!1},n.map=e.__map__,n.element=n.map.getContainer(),setTimeout(function(){n.initMapPolygon(e)},13)}else d.default.warning("MAP_INSTANCE_REQUIRED");return n}return a(t,e),u(t,[{key:"initMapPolygon",value:function(e){var t=this.buildCreateOptions(e);t.map=this.map,this.polygon=new window.AMap.Polygon(t),this.setState({loaded:!0}),this.props.onInstanceCreated&&this.props.onInstanceCreated()}},{key:"buildCreateOptions",value:function(e){var t=this,n={};return w.forEach(function(r){if(r in e)if("style"===r&&e.style){var o=Object.keys(e.style);o.forEach(function(t){n[t]=e.style[t]})}else"visible"!==r&&(n[r]=t.getSetterValue(r,e[r]))}),n}},{key:"detectPropChanged",value:function(e,t){return this.props[e]!==t[e]}},{key:"getSetterValue",value:function(e,t){return e in this.converterMap?this.converterMap[e](t):t}},{key:"buildPathValue",value:function(e){var t=this;if(e.length){var n=e[0];if("number"===typeof n[0])return e.map(function(e){return(0,m.toLnglat)(e)});if("getLng"in n)return e;if("longitude"in n||"lng"in n)return e.map(function(e){return(0,m.toLnglat)(e)});if("length"in n&&n.length)return e.map(function(e){return t.buildPathValue(e)})}return[]}},{key:"renderEditor",value:function(e){if(!e)return null;if(1!==s.default.Children.count(e))return null;var t=s.default.Children.only(e);return t.type===v.default?s.default.cloneElement(t,{__poly__:this.polygon,__map__:this.map}):null}},{key:"render",value:function(){return this.state.loaded?this.renderEditor(this.props.children):null}},{key:"instance",get:function(){return this.polygon}}]),t}(l.Component);t.default=(0,f.default)(g)},1223:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function a(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(2),s=r(l),c=n(1003),f=r(c),p=n(1002),d=r(p),h=n(1031),v=r(h),m=n(1004),y=s.default.Component,w=["path","extData","draggable","visible","style"],g=w.concat(["zIndex","bubble","showDir"]),b=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if("undefined"!==typeof window)if(e.__map__){var r=n;n.setterMap={visible:function(e){e?r.polyline&&r.polyline.show():r.polyline&&r.polyline.hide()},style:function(e){r.polyline.setOptions(e)}},n.converterMap={path:function(e){return r.buildPathValue(e)}},n.state={loaded:!1},n.map=e.__map__,n.element=n.map.getContainer(),setTimeout(function(){n.createMapPolyline(e)},13)}else d.default.warning("MAP_INSTANCE_REQUIRED");return n}return a(t,e),u(t,[{key:"createMapPolyline",value:function(e){var t=this.buildCreateOptions(e);t.map=this.map,this.polyline=new window.AMap.Polyline(t),this.setState({loaded:!0}),this.props.onInstanceCreated&&this.props.onInstanceCreated()}},{key:"buildCreateOptions",value:function(e){var t=this,n={};return g.forEach(function(r){if(r in e)if("style"===r&&e.style){var o=Object.keys(e.style);o.forEach(function(t){n[t]=e.style[t]})}else"visible"!==r&&(n[r]=t.getSetterValue(r,e[r]))}),n}},{key:"detectPropChanged",value:function(e,t){return this.props[e]!==t[e]}},{key:"getSetterValue",value:function(e,t){return e in this.converterMap?this.converterMap[e](t):t}},{key:"buildPathValue",value:function(e){return e.length?"getLng"in e[0]?e:e.map(function(e){return(0,m.toLnglat)(e)}):e}},{key:"renderEditor",value:function(e){if(!e)return null;if(1!==s.default.Children.count(e))return null;var t=s.default.Children.only(e);return t.type===v.default?s.default.cloneElement(t,{__poly__:this.polyline,__map__:this.map}):null}},{key:"render",value:function(){return this.state.loaded?this.renderEditor(this.props.children):null}},{key:"instance",get:function(){return this.polyline}}]),t}(y);t.default=(0,f.default)(b)},1224:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function a(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(2),s=r(l),c=n(51),f=n(1003),p=r(f),d=n(1002),h=r(d),v=n(1004),m=s.default.Component,y=["content","position","size","visible","offset"],w=y.concat(["isCustom","autoMove","closeWhenClickMap","showShadow"]),g=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if("undefined"!==typeof window)if(e.__map__){var r=n;n.setterMap={visible:function(e){e?(r.showWindow(),r.setClassName(r.props),r.setChild(r.props)):r.closeWindow()}},n.converterMap={size:v.toSize,offset:v.toPixel,position:v.toLnglat},n.map=e.__map__,n.isCustom=!0,setTimeout(function(){n.createInfoWindow(e)},13)}else h.default.warning("MAP_INSTANCE_REQUIRED");return n}return a(t,e),u(t,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"componentWillReceiveProps",value:function(e){this.map&&this.refreshWindowLayout(e)}},{key:"createInfoWindow",value:function(e){var t=this.buildCreateOptions(e);this.infoWindow=new window.AMap.InfoWindow(t),this.props.onInstanceCreated&&this.props.onInstanceCreated()}},{key:"refreshWindowLayout",value:function(e){this.setChild(e),this.setClassName(e)}},{key:"checkPropChanged",value:function(e,t){return this.props[e]!==t[e]}},{key:"showWindow",value:function(){this.infoWindow.open(this.map,this.infoWindow.getPosition())}},{key:"closeWindow",value:function(){this.infoWindow.close()}},{key:"buildCreateOptions",value:function(e){var t=this,n={};return n.isCustom="isCustom"in e&&!!e.isCustom,"content"in e?n.content=e.content:(this.infoDOM=document.createElement("div"),n.content=this.infoDOM),w.forEach(function(r){r in e&&-1===["visible","isCustom","content"].indexOf(r)&&(n[r]=t.getSetterValue(r,e[r]))}),n}},{key:"getSetterValue",value:function(e,t){return e in this.converterMap?this.converterMap[e](t):t}},{key:"setChild",value:function(e){var t=e.children;this.infoDOM&&t?(0,c.render)(s.default.createElement("div",null,t),this.infoDOM):e.children&&console.warn("因为你设置 isCustom 为 true,InfoWindow 的 Children 被忽略")}},{key:"setClassName",value:function(e){if(this.infoDOM){var t="";"className"in e&&e.className?t+=e.className:!0===e.isCustom&&(t+="amap_markers_pop_window"),this.infoDOM.className=t}}},{key:"render",value:function(){return null}},{key:"instance",get:function(){return this.infoWindow}}]),t}(m);t.default=(0,p.default)(g)},1225:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function a(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(2),s=r(l),c=n(1003),f=r(c),p=n(1002),d=r(p),h={clickable:!1,opacity:1,visible:!0},v=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if("undefined"!==typeof window)if(e.__map__){var r=n;n.setterMap={visible:function(e){e?r.image&&r.image.show():r.image&&r.image.hide()},src:function(e){r.image.setImageUrl(e)}},n.converterMap={bounds:function(e){return r.buildBounds(e)}},n.map=e.__map__,n.element=n.map.getContainer(),setTimeout(function(){n.createGroundImage(e)},13)}else d.default.warning("MAP_INSTANCE_REQUIRED");return n}return a(t,e),u(t,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"checkPropsChanged",value:function(e,t){return this.props[t]!==e[t]}},{key:"createGroundImage",value:function(e){var t=void 0,n=void 0,r=void 0,o=void 0;"src"in e?t=e.src:d.default.warning("SRC_REQUIRED",!0),"bounds"in e?n=this.buildBounds(e.bounds):d.default.warning("BOUNDS_REQUIRED",!0),o="clickable"in e?e.clickable:h.clickable,r="opacity"in e?e.opacity:h.opacity,this.image=new window.AMap.GroundImage(t,n,{map:this.map,clickable:o,opacity:r}),this.props.onInstanceCreated&&this.props.onInstanceCreated()}},{key:"buildBounds",value:function(e){return e?"getSouthWest"in e?e:new window.AMap.Bounds(new window.AMap.LngLat(e.sw.longitude,e.sw.latitude),new window.AMap.LngLat(e.ne.longitude,e.ne.latitude)):e}},{key:"render",value:function(){return null}},{key:"instance",get:function(){return this.image}}]),t}(s.default.Component);t.default=(0,f.default)(v)},1226:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function a(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(2),s=r(l),c=n(1002),f=r(c),p=n(1012),d=r(p),h=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return"undefined"!==typeof window&&(e.__map__&&e.__circle__?(n.map=e.__map__,n.element=n.map.getContainer(),n.circle=e.__circle__,n.editorActive=!1,n.onPropsUpdate(e)):f.default.warning("CIRCLE_INSTANCE_REQUIRED")),n}return a(t,e),u(t,[{key:"componentWillReceiveProps",value:function(e){this.map&&this.onPropsUpdate(e)}},{key:"onPropsUpdate",value:function(e){"active"in e&&!1===e.active?this.toggleActive(!1,e):this.toggleActive(!0,e)}},{key:"toggleActive",value:function(e,t){e?this.editorActive||this.activeEditor(t):this.editorActive&&this.inactiveEditor()}},{key:"activeEditor",value:function(e){var t=this;this.loadCircleEditor(e).then(function(e){t.editorActive=!0,e.open()})}},{key:"inactiveEditor",value:function(){this.editorActive=!1,this.circleEditor&&this.circleEditor.close()}},{key:"loadCircleEditor",value:function(e){var t=this;return this.circleEditor?Promise.resolve(this.circleEditor):new Promise(function(n){t.map.plugin(["AMap.CircleEditor"],function(){n(t.createEditorInstance(e))})})}},{key:"createEditorInstance",value:function(e){this.circleEditor=new window.AMap.CircleEditor(this.map,this.circle);var t=this.exposeEditorInstance(e);return t&&this.bindEditorEvents(t),this.circleEditor}},{key:"exposeEditorInstance",value:function(e){if("events"in e){var t=e.events||{};return(0,d.default)(t.created)&&t.created(this.circleEditor),delete t.created,t}return!1}},{key:"bindEditorEvents",value:function(e){var t=this,n=Object.keys(e);n.length&&n.forEach(function(n){t.circleEditor.on(n,e[n])})}},{key:"render",value:function(){return null}}]),t}(s.default.Component);t.default=h},1227:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!==typeof t&&"function"!==typeof t?e:t}function a(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),l=n(2),s=r(l),c=n(1003),f=r(c),p=n(1002),d=r(p),h=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return"undefined"!==typeof window&&(e.__map__?(n.map=e.__map__,n.loadToolInstance().then(function(){n.props.onInstanceCreated&&n.props.onInstanceCreated()})):d.default.warning("MAP_INSTANCE_REQUIRED")),n}return a(t,e),u(t,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"loadToolInstance",value:function(){var e=this;return new Promise(function(t){e.map.plugin(["AMap.MouseTool"],function(){e.tool=new window.AMap.MouseTool(e.map),t()})})}},{key:"render",value:function(){return null}},{key:"instance",get:function(){return this.tool}}]),t}(s.default.Component);t.default=(0,f.default)(h)},957:function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(33),i=r(o),a=n(0),u=r(a),l=n(6),s=r(l),c=n(1),f=r(c),p=n(3),d=r(p),h=n(4),v=r(h),m=n(5),y=r(m),w=n(2),g=r(w),b=n(141),_=r(b),k=n(9),C=r(k),M=n(1215),E=n(7),O=n(10),P=r(O),I=C.default.getLabel,j={searchList:[],searchValue:"",center:[],citycode:"",info:{},showInfoWin:!1},S=function(e){function t(e){(0,f.default)(this,t);var n=(0,v.default)(this,(t.__proto__||(0,s.default)(t)).call(this,e));return n.updateState=function(e){return n.setState((0,u.default)({},e))},n.regeo=function(e,t,r){_.default.ajax({url:"https://restapi.amap.com/v3/geocode/regeo",dataType:"jsonp",data:{key:"deee9801361e46e9340bd492ae45b90d",location:e,radius:"1000",extensions:"all",roadlevel:"0"},success:function(e){var o=n.props.showInfoWindow,i=e.status,a=e.regeocode,l=void 0===a?{}:a;if("1"===i&&l){var s=l.formatted_address,c=void 0===s?"":s,f=l.addressComponent,p=void 0===f?{}:f,d=p.province,h=void 0===d?"":d,v=p.district,m=void 0===v?"":v,y=p.township,w=void 0===y?"":y,g=p.streetNumber,b=void 0===g?{}:g,_=p.citycode,k=void 0===_?"":_,C=b.street,M=void 0===C?"":C,E=b.number,O=void 0===E?"":E,P={citycode:k};if(o){var I={name:t&&""!==t?t:c,address:h+m+w+M+O};P=(0,u.default)({},P,{info:I,showInfoWin:!0}),"function"===typeof r&&r({citycode:k,info:I})}n.setState((0,u.default)({},P))}else n.showError(),o&&n.setState({info:{},showInfoWin:!1})},error:function(e){n.showError(e),showInfoWindow&&n.setState({info:{},showInfoWin:!1})}})},n.getSearchList=function(e){_.default.ajax({url:"https://restapi.amap.com/v3/place/text",dataType:"jsonp",data:{key:"deee9801361e46e9340bd492ae45b90d",keywords:e,city:n.state.citycode,children:1,offset:20,page:1,extensions:"all"},success:function(e){n.setState({searchList:e.pois||[]})},error:function(e){return n.showError(e)}})},n.showError=function(e){return E.message.error(e||I("507484","当前经纬度解析失败,你可以手动输入查找"))},n.created=function(e){n.map=e;var t=n.props,r=t.showGeolocation,o=t.geolocationConfig;if(r){var i=n.state.center;n.map.plugin(["AMap.Geolocation"],function(){n.geolocation=new window.AMap.Geolocation(o),n.map.addControl(n.geolocation),0===i.length&&n.geolocation.getCurrentPosition(),window.AMap.event.addListener(n.geolocation,"complete",function(e){var t=e.position,r=void 0===t?[]:t,o=e.formattedAddress,i=void 0===o?"":o,a=e.addressComponent,l=void 0===a?{}:a,s=l.province,c=void 0===s?"":s,f=l.district,p=void 0===f?"":f,d=l.township,h=void 0===d?"":d,v=l.street,m=void 0===v?"":v,y=l.streetNumber,w=void 0===y?"":y,g=l.citycode,b=void 0===g?"":g,_={center:[r.lng,r.lat],citycode:b};n.props.showInfoWindow&&(_=(0,u.default)({},_,{info:{name:i,address:c+p+h+m+w},showInfoWin:!0})),n.setState((0,u.default)({},_))})})}},n.onMapClick=function(e){var t=n.props,r=t.clickToChangePosition,o=t.onMapClick;if(r){var i=e.lnglat||{},a=[i.lng,i.lat];n.setState({center:a}),n.regeo(a[0]+","+a[1],"",function(e){var t=(0,u.default)({location:a},e);"function"===typeof o&&o(t)})}},n.onSearchChange=function(e){var t=n.props.onSearchChange,r=e.target.value||"";n.setState({searchValue:r,searchList:[]}),"function"===typeof t&&t(r);var o=setTimeout(function(){n.getSearchList(r),clearTimeout(o)},1e3)},n.doSelect=function(e){var t=n.props.showInfoWindow,r=n.state.citycode,o=e.cityname,i=void 0===o?"":o,a=e.adname,l=void 0===a?"":a,s=e.business_area,c=void 0===s?"":s,f=e.address,p=void 0===f?"":f;e.citycode!==r&&n.setState({citycode:e.citycode});var d={center:e.location.split(","),searchValue:"",searchList:""};t&&(d=(0,u.default)({},d,{info:(0,u.default)({},e,{address:i+l+c+p}),showInfoWin:!0})),n.setState((0,u.default)({},d));var h=n.props.onSelect;"function"===typeof h&&h(e)},n.getHashId=function(e){return e+"_"+Math.random().toString(16).slice(2,6)},n.getMarks=function(){return n.props.mulPosition.map(function(e){var t="<div class='wea-map-marker'><img src='http://webapi.amap.com/theme/v1.3/markers/n/mark_b.png' align='absmiddle'><span class='wea-map-marker-span'>"+(e.title||"")+"</span></div>";return g.default.createElement(M.Marker,(0,u.default)({content:t},e,{key:n.getHashId("markers")}))})},n.getCurrentInfo=function(){var e=n.state;return{position:e.center,info:e.info,citycode:e.citycode}},n.renderMarker=function(){var e=n.props,t=e.title,r=e.markerConfig,o=n.state,i=o.center,a=o.showInfoWin;if(0===i.length)return null;if(t){var l="<div class='wea-map-marker'><img src='http://webapi.amap.com/theme/v1.3/markers/n/mark_b.png' align='absmiddle'><span class='wea-map-marker-span'>"+t+"</span></div>";return g.default.createElement(M.Marker,(0,u.default)({content:l},n.props,r))}return g.default.createElement(M.Marker,(0,u.default)({position:i,events:{click:function(){n.setState({showInfoWin:!a})}}},r))},n.state=(0,u.default)({},j,{center:e.center||e.position||[],citycode:e.citycode||"",info:e.info||{},showInfoWin:e.showInfoWin||!1}),n.map=null,n.geolocation=null,n}return(0,y.default)(t,e),(0,d.default)(t,[{key:"componentDidMount",value:function(){var e=this.state,t=e.center,n=e.citycode,r=e.info,o=this.props,i=o.showSearchBar,a=o.showInfoWin;!i&&!a||!t||0===t.length||""!==n||r&&r.address&&""!==r.address||this.regeo(t[0]+","+t[1],r&&r.name)}},{key:"componentWillReceiveProps",value:function(e){var t=e.center||e.position,n=e.info||{},r=this.state.center;t&&(0,i.default)(t)!==(0,i.default)(r)&&(0===t.length?this.geolocation.getCurrentPosition():(this.setState({center:t}),n.name&&""!==n.name&&n.address&&""!==n.address?this.setState({info:n}):this.regeo(t[0]+","+t[1],n.name)))}},{key:"componentWillUnmount",value:function(){this.setState((0,u.default)({},j)),this.map=null,this.geolocation=null}},{key:"render",value:function(){var e=this,t=this.props,n=t.mulPosition,r=void 0===n?[]:n,o=t.showInfoWindow,i=t.showSearchBar,a=t.className,l=void 0===a?"":a,s=t.style,c=this.state,f=c.center,p=c.searchList,d=c.searchValue,h=c.info,v=c.showInfoWin,m=(0,u.default)({amapkey:"53a92850ca00d7f77aef3297effd8d59",resizeEnable:!0,events:{created:this.created,click:this.onMapClick}},this.props);0!==f.length&&(m=(0,u.default)({},m,{center:f}));var y=r&&r.length>0?this.getMarks():null;return g.default.createElement("div",{ref:"map",className:"wea-map "+l,style:s},g.default.createElement(M.Map,m,this.props.children||y||this.renderMarker(),o&&h.name&&h.address&&f.length>0&&g.default.createElement(M.InfoWindow,(0,u.default)({position:{longitude:f[0],latitude:f[1]},offset:[0,-36],visible:v,content:'\n <div class="wea-map-infoWindow">\n <div class="infoWindow-name">'+h.name+'</div>\n <div class="infoWindow-address">\n '+I(83578,"地址")+":"+h.address+"</div>\n </div>",events:{close:function(){return e.setState({showInfoWin:!1})}}},this.props.infoWindowConfig))),i&&g.default.createElement("div",{className:"wea-map-editable wea-map-searchBar"},g.default.createElement("div",{className:"wea-map-searchBar-title"},I("389196","请输入地址"),":"),g.default.createElement(E.Input,{value:d,onFocus:function(){return v&&e.setState({showInfoWin:!1})},onChange:this.onSearchChange})),i&&p.length>0&&g.default.createElement("div",{className:"wea-map-editable wea-map-searchList"},p.map(function(t){return g.default.createElement("div",{className:"wea-map-searchList-item",key:t.id,onClick:function(){return e.doSelect(t)}},g.default.createElement("div",{className:"item-icon"},g.default.createElement("span",{className:"icon-coms02-Positioning"})),g.default.createElement("div",{className:"item-content"},g.default.createElement("div",{className:"item-content-name"},t.name),g.default.createElement("div",{className:"item-content-address"},t.address)))})))}}]),t}(g.default.Component);S.propTypes={position:g.default.PropTypes.any,mulPosition:g.default.PropTypes.Array,title:g.default.PropTypes.string,zoom:g.default.PropTypes.number},S.defaultProps={zoom:14,geolocationConfig:{enableHighAccuracy:!0,timeout:1e4,zoomToAccuracy:!0,buttonPosition:"RB"},showGeolocation:!1,clickToChangePosition:!1};var A=(0,P.default)(S,"WeaMap");t.default=A}});
//# sourceMappingURL=7.chunk.js.map?v=d8895eb8