!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("angular"));else if("function"==typeof define&&define.amd)define(["angular"],t);else{var n=t("object"==typeof exports?require("angular"):e.angular);for(var r in n)("object"==typeof exports?exports:e)[r]=n[r]}}("undefined"!=typeof self?self:this,function(e){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=2)}([function(e,t,n){"use strict";function r(e,t){if(o(e))throw new Error(t)}function o(e){return null===e||void 0===e}function i(e){return"[object String]"===Object.prototype.toString.call(e)}function a(e){return"[object Number]"===Object.prototype.toString.call(e)}function c(e){return"[object Array]"===Object.prototype.toString.call(e)}t.e=r,t.b=o,t.d=i,t.c=a,t.a=c},function(e,t,n){"use strict";function r(e,t){var n="passed "+t+" is not correct";if(Object(l.a)(e)){if(2!==e.length)throw new Error(n);return new AMap.LngLat(e[0],e[1])}if(!Object(l.c)(e.lng)&&!Object(l.c)(e.lat))throw new Error(n);return new AMap.LngLat(e.lng,e.lat)}function o(e,t){var n="passed "+t+" is not correct",o=JSON.parse(JSON.stringify(e));if(Object(l.b)(o.center))throw new Error(n+", center property is missed");return o.center=r(e.center,t+".center"),new AMap.View2D(o)}function i(e,t){var n="passed "+t+" is not correct";if(!Object(l.c)(e.x))throw new Error(n+", x property is not a number");if(!Object(l.c)(e.y))throw new Error(n+", y property is not a number");return new AMap.Pixel(e.x,e.y)}function a(e,t){var n="passed "+t+" is not correct";if(!Object(l.c)(e.width))throw new Error(n+", width property is not a number");if(!Object(l.c)(e.height))throw new Error(n+", height property is not a number");return new AMap.Size(e.width,e.height)}function c(e,t){if(Object(l.d)(e))return AMap.Icon({image:e});var n=JSON.parse(JSON.stringify(e));return n.size&&(n.size=a(n.size,t+".size")),n.imageOffset&&(n.imageOffset=i(n.imageOffset,t+".imageOffset")),n.imageSize&&(n.imageSize=a(n.imageSize,t+".imageSize")),new AMap.Icon(n)}function s(e,t){var n=e;return n.position&&(n.position=r(n.position,t+".position")),n.offset&&(n.offset=i(n.offset,t+".offset")),n.icon&&(n.icon=c(n.icon,t+".icon")),n.shadow&&(n.shadow=c(n.shadow,t+".shadow")),new AMap.Marker(n)}function u(e,t){var n=JSON.parse(JSON.stringify(e));return new AMap.TileLayer(n)}t.a=r,t.e=o,t.c=i,t.b=s,t.d=u;var l=n(0)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"ngAMap",function(){return u});var r=n(3),o=n.n(r),i=n(4),a=n(7),c=n(8),s=n(9);o.a.module("angular-amap",[]).provider("mapScriptService",s.a).component("ngAmap",i.a).component("marker",a.a).component("plugin",c.a);var u="angular-amap"},function(t,n){t.exports=e},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=n(5),i=n(0),a=n(6),c=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}}();t.a={bindings:{offlineTxt:"<",mapOptions:"<",loaded:"&",click:"&"},transclude:!0,template:'\n        <div ng-style="$ctrl.style.map" class="amap-instance"></div>\n        <div ng-style="$ctrl.style.offline" class="amap-offline">\n            <label ng-style="$ctrl.style.offlineLabel">{{ $ctrl.offlineTxt || \'NO_NETWORK\' }}</label>\n        </div>\n        <div ng-transclude style="display: none"></div>\n    ',controller:function(){function e(t,n,i,a){r(this,e),this.$scope=t,this.$element=n,this.$attrs=i,this.style=o,this.mapScriptService=a}return e.$inject=["$scope","$element","$attrs","mapScriptService"],c(e,[{key:"$onInit",value:function(){var e=this;Object(i.e)(this.mapOptions,"mapOptions is required for <ng-amap>"),Object(i.e)(this.mapOptions.center,"mapOptions.center is required for <ng-amap>"),this.mapReady=this.mapScriptService.load().then(function(){return Object(a.a)(e.$element.children()[0],e.mapOptions)}).then(function(t){return e.loaded({map:t}),e.$scope.$apply(),e.map=t}).then(function(){if(e.$attrs.click){var t=e.clickListener=function(t){e.click({e:t})};AMap.event.addListener(e.map,"click",t)}})}},{key:"$onChanges",value:function(e){this.map&&Object(a.b)(this.map,e.mapOptions.currentValue)}},{key:"$onDestroy",value:function(){this.map.destroy(),AMap.event.removeListener(this.map,"click",this.clickListener)}},{key:"getMap",value:function(){return this.map}}]),e}()}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n.d(t,"map",function(){return r}),n.d(t,"offline",function(){return o}),n.d(t,"offlineLabel",function(){return i});var r={width:"100%",height:"100%",display:"none"},o={width:"100%",height:"100%",backgroundColor:"#E6E6E6",position:"relative",display:"none"},i={fontSize:"30px",margin:0,position:"absolute",top:"50%",left:"50%","margin-right":"-50%",transform:"translate(-50%, -50%)"}},function(e,t,n){"use strict";function r(e,t){return new AMap.Map(e,i(t))}function o(e,t){var n=i(t);e.setCenter(n.center),Object(a.a)(n.layers)&&e.setLayers(n.layers),Object(a.c)(n.zoom)&&e.setZoom(n.zoom),Object(a.c)(n.labelzIndex)&&e.setlabelzIndex(n.labelzIndex),Object(a.d)(n.lang)&&e.setLang(n.lang),Object(a.d)(n.cursor)&&e.setDefaultCursor(n.cursor),!Object(a.b)(n.defaultLayer)&&e.setDefaultLayer(n.defaultLayer),!Object(a.b)(n.city)&&e.setCity(n.city)}function i(e){var t=JSON.parse(JSON.stringify(e));return t.center=Object(c.a)(t.center,"mapOptions.center"),Object(a.b)(t.view)||(t.view=Object(c.e)(t.view,"mapOptions.view")),Object(a.b)(t.defaultLayer)||(t.defaultLayer=Object(c.d)(t.defaultLayer,"mapOptions.defaultLayer")),t}t.a=r,t.b=o;var a=n(0),c=n(1)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var o=n(0),i=n(1),a=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}}();t.a={bindings:{options:"<",loaded:"&",click:"&"},require:{mapCtrl:"^ngAmap"},template:"",controller:function(){function e(t,n){r(this,e),this.$scope=t,this.$attrs=n}return e.$inject=["$scope","$attrs"],a(e,[{key:"$onInit",value:function(){var e=this;Object(o.e)(this.options,"options is required for <marker>"),Object(o.e)(this.options.position,"options.position is required for <marker>"),this.mapCtrl.mapReady.then(function(){var t=e.marker=Object(i.b)(e.options,"options");return t.setMap(e.mapCtrl.getMap()),e.loaded({marker:t}),e.$scope.$apply(),t}).then(function(t){e.$attrs.click&&(e.clickHandler=function(n){e.click({e:n,marker:t,map:e.mapCtrl.getMap()}),e.$scope.$apply()},AMap.event.addListener(t,"click",e.clickHandler))})}},{key:"$onDestroy",value:function(){AMap.event.removeListener(this.marker,"click",this.clickHandler),this.marker.setMap(null)}}]),e}()}},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t,n){return new Promise(function(r,o){return AMap.plugin(["AMap."+t],function(){if("MarkerClusterer"===t)return Object(a.a)(n)&&n.length?r(new AMap[t](e,n.map(function(e){return Object(c.b)(e,"option for MarkerClusterer")}))):o(new Error("[options] for MarkerClusterer should not be empty, it must be an Array of marker"));r(new AMap[t](n))})})}function i(e,t){var n=JSON.parse(JSON.stringify(t));return n.offset&&(n.offset=Object(c.c)(n.offset,"options.offset")),n.locationMarker&&(n.locationMarker=Object(c.b)(n.locationMarker,"options.locationMarker"),n.locationMarker.setMap(e)),n}var a=n(0),c=n(1),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}}();t.a={bindings:{name:"@",options:"<",loaded:"&"},require:{mapCtrl:"^ngAmap"},template:"",controller:function(){function e(t){r(this,e),this.$scope=t}return e.$inject=["$scope"],s(e,[{key:"$onInit",value:function(){var e=this;Object(a.b)(this.name),this.mapCtrl.mapReady.then(function(){return o(e.mapCtrl.getMap(),e.name,i(e.mapCtrl.getMap(),e.options||{}))}).then(function(t){e.control=t,e.loaded({plugin:t}),e.$scope.$apply(),t&&e.mapCtrl.getMap().addControl(t)})}},{key:"$onDestroy",value:function(){this.mapCtrl.getMap().removeControl(this.control)}}]),e}()}},function(e,t,n){"use strict";function r(e){var t=document.createElement("script");t.type="text/javascript",t.src=e,t.onerror=function(){Array.prototype.slice.call(document.querySelectorAll("ng-amap .amap-offline")).forEach(function(e){e.style.display="block"}),document.body.removeChild(t),setTimeout(function(){r(e)},3e4)},document.body.appendChild(t)}function o(){return Array.prototype.slice.call(document.querySelectorAll("ng-amap")).forEach(function(e){e.querySelector(".amap-offline")&&e.removeChild(e.querySelector(".amap-offline")),e.querySelector(".amap-instance").style.display="block"})}var i=n(0);t.a=function(){var e=null,t=void 0;this.setKey=function(n){e=n,t="//webapi.amap.com/maps?v=1.4.2&key="+n+"&callback=amapinit"},this.$get=["$rootScope",function(n){"ngInject";return{load:function(){Object(i.e)(e,"ak should be set before use. Read: https://leftstick.github.io/angular-amap/#!/quickstart");var a=n.loadAMapPromise;return a?a.then(o):n.loadAMapPromise=new Promise(function(e,n){window.amapinit=e,r(t)}).then(o)}}}]}}])});