New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

axis-react-amap

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axis-react-amap - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

2

dist/react-amap.min.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.ReactAMAP=t(require("react"),require("react-dom")):e.ReactAMAP=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=8)}([function(t,n){t.exports=e},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},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(0),f=r(c),p=n(11),d=r(p);t.default=u},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}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){return!!e&&"function"==typeof e};t.default=r},function(e,n){e.exports=t},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(0),s=r(l),c=n(2),f=r(c),p=n(1),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)},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(3),i=n(0),a=r(i),u=n(5),l=n(4),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())}},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(9),i=r(o),a=n(12),u=r(a),l=n(13),s=r(l),c=n(14),f=r(c),p=n(15),d=r(p),h=n(16),v=r(h),y=n(17),m=r(y),b=n(18),_=r(b),g=n(19),w=r(g),k=n(6),C=r(k),M=n(20),E=r(M);t.Map=i.default,t.Markers=s.default,t.Circle=f.default,t.CircleEditor=w.default,t.Polygon=d.default,t.Polyline=v.default,t.PolyEditor=C.default,t.InfoWindow=m.default,t.GroundImage=_.default,t.Marker=u.default,t.MouseTool=E.default,t.default={Map:i.default,Markers:s.default,Circle:f.default,CircleEditor:w.default,Polygon:d.default,Polyline:v.default,PolyEditor:C.default,InfoWindow:m.default,GroundImage:_.default,Marker:u.default,MouseTool:E.default}},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(0),f=r(c),p=n(10),d=r(p),h=n(4),v=r(h),y=n(1),m=r(y),b=n(3),_=n(2),g=r(_),w=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:{}},A=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)}},console.log(n.props),n.converterMap={center:b.toLnglat,mapStyle:function(e){return 0===e.indexOf("amap://styles")?e:"amap://styles/"+e}},void 0!==n.props.iFrameWindow&&(n.pluginMap={},new d.default({key:e.amapkey,useAMapUI:e.useAMapUI,version:e.version,protocol:e.protocol,iFrameDom:e.iFrameDom,iFrameWindow:e.iFrameWindow}).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.props.iFrameWindow,t=this.buildCreateOptions();this.map=new e.AMap.Map(this.mapWrapper,t),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&&m.default.warning("以下这些属性可以单独提供进行配置,也可以统一作为‘status’属性配置;但是请不要同时使用这两种方式。\n("+O.join(", ")+")"),P.forEach(function(r){r in t&&n.detectPropChanged(r,e,t)&&m.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?m.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 n.props.iFrameWindow.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 t.props.iFrameWindow.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}(w);t.default=(0,g.default)(A)},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,s=t.iFrameDom,c=t.iFrameWindow;r(this,e),this.config=o({},a,{useAMapUI:i,protocol:l,iFrameDom:s,iFrameWindow:c}),"undefined"!=typeof window&&(n?this.config.key=n:"amapkey"in this.config.iFrameWindow&&(this.config.key=this.config.iFrameWindow.amapkey)),u&&(this.config.v=u),this.protocol=l||this.config.iFrameWindow.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=this.config.iFrameDom,n=this.config.iFrameWindow;console.log(t),console.log(n),console.log(n.document);var r=n.document.createElement("script");return r.type="text/javascript",r.async=!0,r.defer=!0,r.src=e,r}},{key:"getAmapuiPromise",value:function(){if(this.config.iFrameWindow.AMapUI)return Promise.resolve();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 this.config.iFrameWindow.document.body.appendChild(e),t}},{key:"getMainPromise",value:function(){var e=this;if(this.config.iFrameWindow.AMap)return Promise.resolve();var t=this.buildScriptTag(this.getScriptSrc(this.config)),n=new Promise(function(t){e.config.iFrameWindow[e.config.callback]=function(){t(),delete e.config.iFrameWindow[e.config.callback]}});return this.config.iFrameWindow.document.body.appendChild(t),n}},{key:"load",value:function(){var e=this;if("undefined"==typeof window)return null;var t=this.config.useAMapUI;return u=u||this.getMainPromise(),t&&(l=l||this.getAmapuiPromise()),new Promise(function(n){u.then(function(){t&&l?l.then(function(){e.config.iFrameWindow.initAMapUI&&!s&&(e.config.iFrameWindow.initAMapUI(),"function"==typeof t&&t(),s=!0),n()}):n()})})}}]),e}();t.default=c},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},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(0),c=r(s),f=n(5),p=n(1),d=r(p),h=n(2),v=r(h),y=n(7),m=n(3),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.marker&&r.marker.show():r.marker&&r.marker.hide()},zIndex:function(e){r.marker&&r.marker.setzIndex(e)}},n.converterMap={position:m.toLnglat,offset:m.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,y.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 y.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,y.renderMarkerComponent)(e.render,this.marker);else if("children"in e){var t=e.children,n=void 0===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)(b)},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(0),s=r(l),c=n(5),f=n(4),p=r(f),d=n(1),h=r(d),v=n(7);if("undefined"!=typeof window){var y=document.head||document.getElementsByTagName("head")[0],m=document.createElement("style");m.type="text/css",m.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}",y.appendChild(m)}var b=s.default.Component,_=25.6,g=46*.8-2,w=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(-_/2,-g),n.hoverOffset=new window.AMap.Pixel(-w/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}(b);t.default=E},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(0),s=r(l),c=n(2),f=r(c),p=n(1),d=r(p),h=n(3),v=["center","radius","draggable","extData","visible","style"],y=v.concat(["zIndex","bubble"]),m=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 y.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)(m)},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(0),s=r(l),c=n(2),f=r(c),p=n(1),d=r(p),h=n(6),v=r(h),y=n(3),m=["path","draggable","extData","style","visible"],b=m.concat(["zIndex","bubble"]),_=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 b.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,y.toLnglat)(e)});if("getLng"in n)return e;if("longitude"in n||"lng"in n)return e.map(function(e){return(0,y.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)(_)},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(0),s=r(l),c=n(2),f=r(c),p=n(1),d=r(p),h=n(6),v=r(h),y=n(3),m=s.default.Component,b=["path","extData","draggable","visible","style"],_=b.concat(["zIndex","bubble","showDir"]),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.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 _.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,y.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}(m);t.default=(0,f.default)(g)},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(0),s=r(l),c=n(5),f=n(2),p=r(f),d=n(1),h=r(d),v=n(3),y=s.default.Component,m=["content","position","size","visible","offset"],b=m.concat(["isCustom","autoMove","closeWhenClickMap","showShadow"]),_=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),b.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}(y);t.default=(0,p.default)(_)},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(0),s=r(l),c=n(2),f=r(c),p=n(1),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)},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(0),s=r(l),c=n(1),f=r(c),p=n(4),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},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(0),s=r(l),c=n(2),f=r(c),p=n(1),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)}])});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],t):"object"==typeof exports?exports.ReactAMAP=t(require("react"),require("react-dom")):e.ReactAMAP=t(e.React,e.ReactDOM)}(this,function(e,t){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=8)}([function(t,n){t.exports=e},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="undefined"!=typeof window,o="undefined"!=typeof window?window:void 0,i=(t.setWindow=function(e){o=e},t.getWindow=function(){return o}),a=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(i().AMap.LngLat)(t,n):null},u=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(i().AMap.Pixel)(t,n):null},l=t.toSize=function(e){return e?"getWidth"in e?e:r?new(i().AMap.Size)(e.width,e.height):null:e};t.default={toLnglat:a,toPixel:u,toSize:l}},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},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(0),f=r(c),p=n(11),d=r(p);t.default=u},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){return!!e&&"function"==typeof e};t.default=r},function(e,n){e.exports=t},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(0),s=r(l),c=n(3),f=r(c),p=n(2),d=r(p),h=n(1),v=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if(void 0!==(0,h.getWindow)())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((0,h.getWindow)().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)(v)},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(1),i=n(0),a=r(i),u=n(5),l=n(4),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())}},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(9),i=r(o),a=n(12),u=r(a),l=n(13),s=r(l),c=n(14),f=r(c),p=n(15),d=r(p),h=n(16),v=r(h),m=n(17),y=r(m),g=n(18),b=r(g),_=n(19),k=r(_),w=n(6),C=r(w),M=n(20),E=r(M);t.Map=i.default,t.Markers=s.default,t.Circle=f.default,t.CircleEditor=k.default,t.Polygon=d.default,t.Polyline=v.default,t.PolyEditor=C.default,t.InfoWindow=y.default,t.GroundImage=b.default,t.Marker=u.default,t.MouseTool=E.default,t.default={Map:i.default,Markers:s.default,Circle:f.default,CircleEditor:k.default,Polygon:d.default,Polyline:v.default,PolyEditor:C.default,InfoWindow:y.default,GroundImage:b.default,Marker:u.default,MouseTool:E.default}},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(0),f=r(c),p=n(10),d=r(p),h=n(4),v=r(h),m=n(2),y=r(m),g=n(1),b=n(3),_=r(b),k=f.default.Component,w=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:{}},W=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)}},console.log(n.props),n.converterMap={center:g.toLnglat,mapStyle:function(e){return 0===e.indexOf("amap://styles")?e:"amap://styles/"+e}},void 0!==n.props.iFrameWindow&&(n.pluginMap={},new d.default({key:e.amapkey,useAMapUI:e.useAMapUI,version:e.version,protocol:e.protocol,iFrameDom:e.iFrameDom,iFrameWindow:e.iFrameWindow}).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 w.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.props.iFrameWindow,t=this.buildCreateOptions();this.map=new e.AMap.Map(this.mapWrapper,t),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 n.props.iFrameWindow.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 t.props.iFrameWindow.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}(k);t.default=(0,_.default)(W)},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=n(1),u={v:"1.4.0",hostAndPath:"webapi.amap.com/maps",key:"f97efc35164149d0c0f299e7a8adb3d2",callback:"__amap_init_callback",useAMapUI:!1},l=null,s=null,c=!1,f=function(){function e(t){var n=t.key,i=t.useAMapUI,l=t.version,s=t.protocol,c=t.iFrameDom,f=t.iFrameWindow;r(this,e),this.config=o({},u,{useAMapUI:i,protocol:s,iFrameDom:c,iFrameWindow:f}),void 0!==(0,a.getWindow)()&&(n?this.config.key=n:"amapkey"in this.config.iFrameWindow&&(this.config.key=this.config.iFrameWindow.amapkey)),l&&(this.config.v=l),this.protocol=s||this.config.iFrameWindow.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=this.config.iFrameDom,n=this.config.iFrameWindow;console.log(t),console.log(n),console.log(n.document);var r=n.document.createElement("script");return r.type="text/javascript",r.async=!0,r.defer=!0,r.src=e,r}},{key:"getAmapuiPromise",value:function(){if(this.config.iFrameWindow.AMapUI)return Promise.resolve();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 this.config.iFrameWindow.document.body.appendChild(e),t}},{key:"getMainPromise",value:function(){var e=this;if(this.config.iFrameWindow.AMap)return Promise.resolve();var t=this.buildScriptTag(this.getScriptSrc(this.config)),n=new Promise(function(t){e.config.iFrameWindow[e.config.callback]=function(){t(),delete e.config.iFrameWindow[e.config.callback]}});return this.config.iFrameWindow.document.body.appendChild(t),n}},{key:"load",value:function(){var e=this;if(void 0===(0,a.getWindow)())return null;var t=this.config.useAMapUI;return l=l||this.getMainPromise(),t&&(s=s||this.getAmapuiPromise()),new Promise(function(n){l.then(function(){t&&s?s.then(function(){e.config.iFrameWindow.initAMapUI&&!c&&(e.config.iFrameWindow.initAMapUI(),"function"==typeof t&&t(),c=!0),n()}):n()})})}}]),e}();t.default=f},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},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(0),c=r(s),f=n(5),p=n(2),d=r(p),h=n(3),v=r(h),m=n(7),y=n(1),g=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if(void 0!==(0,y.getWindow)())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((0,y.getWindow)().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=void 0===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)(g)},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(0),s=r(l),c=n(5),f=n(4),p=r(f),d=n(2),h=r(d),v=n(7),m=n(1);if(void 0!==(0,m.getWindow)()){var y=document.head||document.getElementsByTagName("head")[0],g=document.createElement("style");g.type="text/css",g.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}",y.appendChild(g)}var b=s.default.Component,_=25.6,k=46*.8-2,w=46*.8,C=66*.8-2,M={useCluster:!1,markersCache:[],markerIDCache:[]},E=["gridSize","minClusterSize","maxZoom","averageCenter","styles","zoomOnClick","renderCluserMarker"],O=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return void 0!==(0,m.getWindow)()&&(e.__map__?(n.map=e.__map__,n.element=n.map.getContainer(),n.markersCache=M.markersCache,n.useCluster=null,n.markerIDCache=M.markerIDCache,n.resetOffset=new((0,m.getWindow)().AMap.Pixel)(-_/2,-k),n.hoverOffset=new((0,m.getWindow)().AMap.Pixel)(-w/2,-C),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((0,m.getWindow)().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=M.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};E.forEach(function(r){t[r]=r in e?e[r]:n[r]}),this.mapCluster=new((0,m.getWindow)().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((0,m.getWindow)().AMap.InfoWindow)({isCustom:!0,autoMove:!0,closeWhenClickMap:!0,content:"<span>loading...</span>",showShadow:!1,offset:new((0,m.getWindow)().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}(b);t.default=O},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(0),s=r(l),c=n(3),f=r(c),p=n(2),d=r(p),h=n(1),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(void 0!==(0,h.getWindow)())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((0,h.getWindow)().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)},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(0),s=r(l),c=n(3),f=r(c),p=n(2),d=r(p),h=n(6),v=r(h),m=n(1),y=["path","draggable","extData","style","visible"],g=y.concat(["zIndex","bubble"]),b=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if(void 0!==(0,m.getWindow)())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((0,m.getWindow)().AMap.Polygon)(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){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)(b)},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(0),s=r(l),c=n(3),f=r(c),p=n(2),d=r(p),h=n(6),v=r(h),m=n(1),y=s.default.Component,g=["path","extData","draggable","visible","style"],b=g.concat(["zIndex","bubble","showDir"]),_=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if(void 0!==(0,m.getWindow)())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((0,m.getWindow)().AMap.Polyline)(t),this.setState({loaded:!0}),this.props.onInstanceCreated&&this.props.onInstanceCreated()}},{key:"buildCreateOptions",value:function(e){var t=this,n={};return b.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)(_)},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(0),s=r(l),c=n(5),f=n(3),p=r(f),d=n(2),h=r(d),v=n(1),m=s.default.Component,y=["content","position","size","visible","offset"],g=y.concat(["isCustom","autoMove","closeWhenClickMap","showShadow"]),b=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if(void 0!==(0,v.getWindow)())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((0,v.getWindow)().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),g.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)(b)},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(0),s=r(l),c=n(3),f=r(c),p=n(2),d=r(p),h=n(1),v={clickable:!1,opacity:1,visible:!0},m=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));if(void 0!==(0,h.getWindow)())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:v.clickable,r="opacity"in e?e.opacity:v.opacity,this.image=new((0,h.getWindow)().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((0,h.getWindow)().AMap.Bounds)(new((0,h.getWindow)().AMap.LngLat)(e.sw.longitude,e.sw.latitude),new((0,h.getWindow)().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)(m)},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(0),s=r(l),c=n(2),f=r(c),p=n(4),d=r(p),h=n(1),v=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return void 0!==(0,h.getWindow)()&&(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((0,h.getWindow)().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=v},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(0),s=r(l),c=n(3),f=r(c),p=n(2),d=r(p),h=n(1),v=function(e){function t(e){o(this,t);var n=i(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return void 0!==(0,h.getWindow)()&&(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((0,h.getWindow)().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)(v)}])});

@@ -53,3 +53,3 @@ 'use strict';

if (typeof window !== 'undefined') {
if (typeof (0, _common.getWindow)() !== 'undefined') {
if (!props.__map__) {

@@ -97,3 +97,3 @@ _log2.default.warning('MAP_INSTANCE_REQUIRED');

options.map = this.map;
this.mapCircle = new window.AMap.Circle(options);
this.mapCircle = new ((0, _common.getWindow)().AMap.Circle)(options);
return Promise.resolve(this.mapCircle);

@@ -100,0 +100,0 @@ }

@@ -21,2 +21,4 @@ 'use strict';

var _common = require('../utils/common');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -38,3 +40,3 @@

if (typeof window !== 'undefined') {
if (typeof (0, _common.getWindow)() !== 'undefined') {
if (!(props.__map__ && props.__circle__)) {

@@ -117,3 +119,3 @@ _log2.default.warning('CIRCLE_INSTANCE_REQUIRED');

value: function createEditorInstance(props) {
this.circleEditor = new window.AMap.CircleEditor(this.map, this.circle);
this.circleEditor = new ((0, _common.getWindow)().AMap.CircleEditor)(this.map, this.circle);
var events = this.exposeEditorInstance(props);

@@ -120,0 +122,0 @@ events && this.bindEditorEvents(events);

@@ -21,2 +21,4 @@ 'use strict';

var _common = require('../utils/common');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -50,3 +52,3 @@

if (typeof window !== 'undefined') {
if (typeof (0, _common.getWindow)() !== 'undefined') {
if (!props.__map__) {

@@ -121,3 +123,3 @@ _log2.default.warning('MAP_INSTANCE_REQUIRED');

}
this.image = new window.AMap.GroundImage(src, bounds, {
this.image = new ((0, _common.getWindow)().AMap.GroundImage)(src, bounds, {
map: this.map,

@@ -138,3 +140,3 @@ clickable: clickable,

}
var bounds = new window.AMap.Bounds(new window.AMap.LngLat(rawBounds.sw.longitude, rawBounds.sw.latitude), new window.AMap.LngLat(rawBounds.ne.longitude, rawBounds.ne.latitude));
var bounds = new ((0, _common.getWindow)().AMap.Bounds)(new ((0, _common.getWindow)().AMap.LngLat)(rawBounds.sw.longitude, rawBounds.sw.latitude), new ((0, _common.getWindow)().AMap.LngLat)(rawBounds.ne.longitude, rawBounds.ne.latitude));
return bounds;

@@ -141,0 +143,0 @@ }

@@ -59,3 +59,3 @@ 'use strict';

if (typeof window !== 'undefined') {
if (typeof (0, _common.getWindow)() !== 'undefined') {
if (!props.__map__) {

@@ -107,3 +107,3 @@ _log2.default.warning('MAP_INSTANCE_REQUIRED');

var options = this.buildCreateOptions(props);
this.infoWindow = new window.AMap.InfoWindow(options);
this.infoWindow = new ((0, _common.getWindow)().AMap.InfoWindow)(options);
this.props.onInstanceCreated && this.props.onInstanceCreated();

@@ -110,0 +110,0 @@ }

@@ -45,3 +45,3 @@ 'use strict';

if (typeof window !== 'undefined') {
if (typeof (0, _common.getWindow)() !== 'undefined') {
if (!props.__map__) {

@@ -93,3 +93,3 @@ _log2.default.warning('MAP_INSTANCE_REQUIRED');

var options = this.buildCreateOptions(props);
this.marker = new window.AMap.Marker(options);
this.marker = new ((0, _common.getWindow)().AMap.Marker)(options);

@@ -96,0 +96,0 @@ this.marker.render = function (marker) {

@@ -25,2 +25,4 @@ 'use strict';

var _common = require('../utils/common');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -34,3 +36,3 @@

if (typeof window !== 'undefined') {
if (typeof (0, _common.getWindow)() !== 'undefined') {
var styleText = '.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}';

@@ -81,3 +83,3 @@ var headEl = document.head || document.getElementsByTagName('head')[0];

if (typeof window !== 'undefined') {
if (typeof (0, _common.getWindow)() !== 'undefined') {
if (!props.__map__) {

@@ -91,4 +93,4 @@ _log2.default.warning('MAP_INSTANCE_REQUIRED');

_this.markerIDCache = defaultOpts.markerIDCache;
_this.resetOffset = new window.AMap.Pixel(-SIZE_WIDTH / 2, -SIZE_HEIGHT);
_this.hoverOffset = new window.AMap.Pixel(-SIZE_HOVER_WIDTH / 2, -SIZE_HOVER_HEIGHT);
_this.resetOffset = new ((0, _common.getWindow)().AMap.Pixel)(-SIZE_WIDTH / 2, -SIZE_HEIGHT);
_this.hoverOffset = new ((0, _common.getWindow)().AMap.Pixel)(-SIZE_HOVER_WIDTH / 2, -SIZE_HOVER_HEIGHT);
_this.createMarkers(props);

@@ -138,3 +140,3 @@ }

var marker = new window.AMap.Marker(options);
var marker = new ((0, _common.getWindow)().AMap.Marker)(options);
marker.on('click', function (e) {

@@ -285,7 +287,2 @@ _this2.onMarkerClick(e);

var options = {};
// const style = {
// url: clusterIcon,
// size: new window.AMap.Size(56, 56),
// offset: new window.AMap.Pixel(-28, -28)
// };
var defalutOptions = {

@@ -308,3 +305,3 @@ minClusterSize: 2,

this.mapCluster = new window.AMap.MarkerClusterer(this.map, [], options);
this.mapCluster = new ((0, _common.getWindow)().AMap.MarkerClusterer)(this.map, [], options);
var events = {};

@@ -397,3 +394,3 @@ if ('events' in config) {

value: function initClusterMarkerWindow() {
this.markersWindow = new window.AMap.InfoWindow({
this.markersWindow = new ((0, _common.getWindow)().AMap.InfoWindow)({
isCustom: true,

@@ -404,3 +401,3 @@ autoMove: true,

showShadow: false,
offset: new window.AMap.Pixel(0, -20)
offset: new ((0, _common.getWindow)().AMap.Pixel)(0, -20)
});

@@ -407,0 +404,0 @@ this.markersDOM = document.createElement('div');

@@ -21,2 +21,4 @@ 'use strict';

var _common = require('../utils/common');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -38,3 +40,3 @@

if (typeof window !== 'undefined') {
if (typeof (0, _common.getWindow)() !== 'undefined') {
if (!props.__map__) {

@@ -64,3 +66,3 @@ _log2.default.warning('MAP_INSTANCE_REQUIRED');

_this2.map.plugin(['AMap.MouseTool'], function () {
_this2.tool = new window.AMap.MouseTool(_this2.map);
_this2.tool = new ((0, _common.getWindow)().AMap.MouseTool)(_this2.map);
resolve();

@@ -67,0 +69,0 @@ });

@@ -21,2 +21,4 @@ 'use strict';

var _common = require('../utils/common');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -38,3 +40,3 @@

if (typeof window !== 'undefined') {
if (typeof (0, _common.getWindow)() !== 'undefined') {
if (!(props.__map__ && props.__poly__)) {

@@ -99,3 +101,3 @@ _log2.default.warning('MAP_INSTANCE_REQUIRED');

_this2.map.plugin(['AMap.PolyEditor'], function () {
_this2.polyEditor = new window.AMap.PolyEditor(_this2.map, _this2.poly);
_this2.polyEditor = new ((0, _common.getWindow)().AMap.PolyEditor)(_this2.map, _this2.poly);
resolve(_this2.polyEditor);

@@ -102,0 +104,0 @@ });

@@ -58,3 +58,3 @@ 'use strict';

if (typeof window !== 'undefined') {
if (typeof (0, _common.getWindow)() !== 'undefined') {
if (!props.__map__) {

@@ -99,3 +99,3 @@ _log2.default.warning('MAP_INSTANCE_REQUIRED');

options.map = this.map;
this.polygon = new window.AMap.Polygon(options);
this.polygon = new ((0, _common.getWindow)().AMap.Polygon)(options);
this.setState({

@@ -102,0 +102,0 @@ loaded: true

@@ -52,3 +52,3 @@ 'use strict';

if (typeof window !== 'undefined') {
if (typeof (0, _common.getWindow)() !== 'undefined') {
if (!props.__map__) {

@@ -93,3 +93,3 @@ _log2.default.warning('MAP_INSTANCE_REQUIRED');

options.map = this.map;
this.polyline = new window.AMap.Polyline(options);
this.polyline = new ((0, _common.getWindow)().AMap.Polyline)(options);
this.setState({

@@ -96,0 +96,0 @@ loaded: true

@@ -11,2 +11,4 @@ 'use strict';

var _common = require('../utils/common');
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

@@ -38,3 +40,3 @@

this.config = _extends({}, DEFAULT_CONFIG, { useAMapUI: useAMapUI, protocol: protocol, iFrameDom: iFrameDom, iFrameWindow: iFrameWindow });
if (typeof window !== 'undefined') {
if (typeof (0, _common.getWindow)() !== 'undefined') {
if (key) {

@@ -113,3 +115,3 @@ this.config.key = key;

if (typeof window === 'undefined') {
if (typeof (0, _common.getWindow)() === 'undefined') {
return null;

@@ -116,0 +118,0 @@ }

@@ -8,2 +8,12 @@ 'use strict';

var globalWin = typeof window !== 'undefined' ? window : undefined;
var setWindow = exports.setWindow = function setWindow(win) {
globalWin = win;
};
var getWindow = exports.getWindow = function getWindow() {
return globalWin;
};
/*

@@ -34,3 +44,3 @@ * [lng, lat]

}
return hasWindow ? new window.AMap.LngLat(lng, lat) : null;
return hasWindow ? new (getWindow().AMap.LngLat)(lng, lat) : null;
};

@@ -54,3 +64,3 @@

}
return hasWindow ? new window.AMap.Pixel(x, y) : null;
return hasWindow ? new (getWindow().AMap.Pixel)(x, y) : null;
};

@@ -65,3 +75,3 @@

}
return hasWindow ? new window.AMap.Size(size.width, size.height) : null;
return hasWindow ? new (getWindow().AMap.Size)(size.width, size.height) : null;
};

@@ -68,0 +78,0 @@

{
"name": "axis-react-amap",
"version": "0.0.1",
"version": "0.0.2",
"description": "AMap Component Based On React",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc