UNPKG

ngx-amap

Version:

[![npm](https://img.shields.io/npm/v/ngx-amap.svg)][npm-badge-url] [![npm](https://img.shields.io/npm/dm/ngx-amap.svg)][npm-badge-url] [![Build Status](https://travis-ci.org/xieziyu/ngx-amap.svg?branch=master)][ci-url]

15 lines (13 loc) 80.4 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators")):"function"==typeof define&&define.amd?define("ngx-amap",["exports","@angular/core","rxjs","rxjs/operators"],e):e((t=t||self)["ngx-amap"]={},t.ng.core,t.rxjs,t.rxjs.operators)}(this,(function(t,e,n,r){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */var i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function o(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function a(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(s(arguments[e]));return t}var p=new e.InjectionToken("NGX_AMAP_CONFIG"),u=function(){function t(){}return t.prototype.i=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.log.apply(console,a(t))},t.prototype.e=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.error.apply(console,a(t))},t.prototype.w=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.warn.apply(console,a(t))},t.prototype.d=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e]},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[]},t}(),c=function(){function t(t){void 0===t&&(t={}),this.config=t,this.debugTags=[],this.debugAll=!0,t.debugTags&&("*"===t.debugTags?this.debugAll=!0:(this.debugAll=!1,this.debugTags=t.debugTags.split(",")))}return t.prototype.i=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.log.apply(console,a(t))},t.prototype.e=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.error.apply(console,a(t))},t.prototype.w=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];console.warn.apply(console,a(t))},t.prototype.d=function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];(this.debugAll||this.debugTags.includes(t))&&console.log.apply(console,a(["["+t+"]"],e))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[p]}]}]},t}();var d="AMapLoader",l=function(){function t(t,e){void 0===t&&(t={}),this.config=t,this.logger=e,this.defaultProtocol="https",this.defaultVersion="1.4.15",this.defaultUIVersion="1.0.11",this.config=t||{}}return t.prototype.load=function(){var t=this;if(this.loading$)return this.loading$.asObservable();this.logger.d(d,"loading AMap API ..."),this.loading$=new n.ReplaySubject;var e=document.createElement("script");return e.type="text/javascript",e.async=!0,e.defer=!0,e.src=this.getSrcFromConfig("_NgxAmapAPILoader"),e.onerror=function(e){t.logger.e("failed to load AMap API."),t.loading$.error(e)},window._NgxAmapAPILoader=function(){t.logger.d(d,"loading AMap API COMPLETE"),t.loading$.next(),t.loading$.complete()},document.body.appendChild(e),this.loading$.asObservable()},t.prototype.loadUI=function(){var t=this;if(this.uiLoading$)return this.uiLoading$.asObservable();this.logger.d(d,"loading AMap UI ..."),this.uiLoading$=new n.ReplaySubject;var e=document.createElement("script");return e.type="text/javascript",e.async=!0,e.defer=!0,e.src=this.getUISrcFromConfig(),e.onerror=function(e){t.logger.e("failed to load AMap API.")},e.onload=function(){window.initAMapUI(),t.logger.d(d,"loading AMap UI COMPLETE"),t.uiLoading$.next(),t.uiLoading$.complete()},document.body.appendChild(e),this.uiLoading$.asObservable()},t.prototype.getSrcFromConfig=function(t){var e=(this.config.protocol||this.defaultProtocol)+"://webapi.amap.com/maps",n={v:this.config.apiVersion||this.defaultVersion,callback:t,key:this.config.apiKey};return e+"?"+Object.keys(n).filter((function(t){return null!=n[t]})).filter((function(t){return!Array.isArray(n[t])||Array.isArray(n[t])&&n[t].length>0})).map((function(t){var e=n[t];return Array.isArray(e)?{key:t,value:e.join(",")}:{key:t,value:n[t]}})).map((function(t){return t.key+"="+t.value})).join("&")},t.prototype.getUISrcFromConfig=function(){return(this.config.protocol||this.defaultProtocol)+"://webapi.amap.com/ui/1.0/main-async.js?v="+(this.config.uiVersion||this.defaultUIVersion)},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Inject,args:[p]}]},{type:u}]},t}();var h=function(){function t(t,e,r){this.loader=t,this.logger=e,this.ngZone=r,this.map$=new n.ReplaySubject}return t.prototype.get=function(){return this.map$.asObservable()},t.prototype.create=function(t,e){var n=this;return this.loader.load().pipe(r.map((function(){return n.map=n.ngZone.runOutsideAngular((function(){return new AMap.Map(t,e)})),n.logger.d("AMap","new map created."),n.map$.next(n.map),n.map$.complete(),n.map})))},t.prototype.destroy=function(){var t=this;this.get().subscribe((function(e){e.destroy(),t.logger.d("AMap","map destroyed."),t.map=null}))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:l},{type:u},{type:e.NgZone}]},t}();var g=function(){function t(t,e){this.logger=t,this.ngZone=e}return t.prototype.bindEvent=function(t,e){var i=this;return(t.pipe(r.switchMap((function(t){return new n.Observable((function(n){var r=AMap.event.addListener(t,e,(function(t){i.ngZone.run((function(){return n.next(t)}))}),i);return i.logger.d("EventBinder","subscribed event: "+e),function(){AMap.event.removeListener(r),i.logger.d("EventBinder","unsubscribed event: "+e),e=null,r=null}}))}))))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:u},{type:e.NgZone}]},t}();var y=function(){function t(t,e){this.amap=t,this.logger=e,this.state=new Map}return t.prototype.load=function(t){var e=this,i="";return i=Array.isArray(t)?t.join(","):t,this.state.has(i)?this.state.get(i).asObservable():(this.logger.d("PluginLoader","loading plugin:",i,"..."),this.amap.get().pipe(r.switchMap((function(r){var o=new n.ReplaySubject(1);return r.plugin(t,(function(){e.logger.d("PluginLoader","loading plugin:",i,"COMPLETE"),o.next(),o.complete()})),e.state.set(i,o),o.asObservable()}))))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:h},{type:u}]},t}();var f=function(){function t(t){this.changes=t}return t.of=function(e){return new t(e)},t.prototype.notEmpty=function(t){if(this.changes[t]){var e=this.changes[t].currentValue;if(null!=e)return n.of(e)}return n.EMPTY},t.prototype.has=function(t){if(this.changes[t]){var e=this.changes[t].currentValue;return n.of(e)}return n.EMPTY},t}();function b(t,e){var n={};return e.forEach((function(e){void 0!==t[e]&&null!==t[e]&&(n[e]=t[e])})),n}var v="ngx-amap",m=["view","layers","zoom","center","labelzIndex","zooms","lang","defaultCursor","crs","animateEnable","isHotspot","defaultLayer","rotateEnable","resizeEnable","showIndoorMap","indoorMap","expandZoomRange","dragEnable","zoomEnable","doubleClickZoom","keyboardEnable","jogEnable","scrollWheel","touchZoom","touchZoomCenter","mapStyle","features","showBuildingBlock","viewMode","pitch","pitchEnable","buildingAnimation","skyColor","preloadMode","mask","maxPitch","rotation","forceVector","gridMapForeign","vectorMapForeign"],E=function(){function t(t,n,r,i,o,s){this.el=t,this.amap=n,this.pluginLoader=r,this.logger=i,this.binder=o,this.ngZone=s,this.naReady=new e.EventEmitter,this.naPluginsLoaded=new e.EventEmitter,this.inited=!1;var a=this.amap.get();this.naComplete=this.binder.bindEvent(a,"complete"),this.naClick=this.binder.bindEvent(a,"click"),this.naDblClick=this.binder.bindEvent(a,"dblclick"),this.naRightClick=this.binder.bindEvent(a,"rightclick"),this.naMouseMove=this.binder.bindEvent(a,"mousemove"),this.naMouseOver=this.binder.bindEvent(a,"mouseover"),this.naMouseWheel=this.binder.bindEvent(a,"mousewheel"),this.naMouseUp=this.binder.bindEvent(a,"mouseup"),this.naMouseOut=this.binder.bindEvent(a,"mouseout"),this.naMouseDown=this.binder.bindEvent(a,"mousedown"),this.naTouchStart=this.binder.bindEvent(a,"touchstart"),this.naTouchMove=this.binder.bindEvent(a,"touchmove"),this.naTouchEnd=this.binder.bindEvent(a,"touchend"),this.naHotspotClick=this.binder.bindEvent(a,"hotspotclick"),this.naHotspotOver=this.binder.bindEvent(a,"hotspotover"),this.naHotspotOut=this.binder.bindEvent(a,"hotspotout"),this.naDragStart=this.binder.bindEvent(a,"dragstart"),this.naDragging=this.binder.bindEvent(a,"dragging"),this.naDragEnd=this.binder.bindEvent(a,"dragend"),this.naResize=this.binder.bindEvent(a,"resize"),this.naZoomStart=this.binder.bindEvent(a,"zoomstart"),this.naZoomEnd=this.binder.bindEvent(a,"zoomend"),this.naZoomChange=this.binder.bindEvent(a,"zoomchange"),this.naMoveStart=this.binder.bindEvent(a,"movestart"),this.naMoveEnd=this.binder.bindEvent(a,"moveend"),this.naMove=this.binder.bindEvent(a,"mapmove")}return t.prototype.ngOnInit=function(){var t=this;this.logger.d(v,"initializing ...");var e=this.el.nativeElement.querySelector("div.ngx-amap-container-inner"),n=b(this,m);this.logger.d(v,"options:",n),this.amap.create(e,n).subscribe((function(e){t.logger.d(v,"map is ready."),t.ngZone.run((function(){return t.naReady.emit(e)}))})),this.inited=!0},t.prototype.ngOnDestroy=function(){this.amap.destroy()},t.prototype.ngOnChanges=function(t){var e=this,r=f.of(t),i=this.get();this.inited&&(n.zip(r.has("zoom"),i).subscribe((function(t){var n=s(t,2),r=n[0],i=n[1];e.logger.d(v,"setZoom:",r),i.setZoom(r)})),n.zip(r.has("center"),i).subscribe((function(t){var n=s(t,2),r=n[0],i=n[1];e.logger.d(v,"setCenter:",r),i.setCenter(r)}))),n.zip(r.has("city"),i).subscribe((function(t){var n=s(t,2),r=n[0];n[1].setCity(r,(function(){e.logger.d(v,"setCity:",r)}))})),n.zip(r.notEmpty("plugins"),i).subscribe((function(t){var n=s(t,2),r=n[0],i=n[1];e.pluginLoader.load(r).subscribe((function(){e.logger.d(v,"plugins loaded."),e.ngZone.run((function(){return e.naPluginsLoaded.emit(i)}))}))}))},t.prototype.get=function(){return this.amap.get()},t.decorators=[{type:e.Component,args:[{selector:"ngx-amap",exportAs:"amap",template:"<div class='ngx-amap-container-inner'></div>\n<div class='ngx-amap-content'>\n <ng-content></ng-content>\n</div>",providers:[h,y],styles:[".ngx-amap-container-inner{width:inherit;height:inherit}.ngx-amap-content{display:none}"]}]}],t.ctorParameters=function(){return[{type:e.ElementRef},{type:h},{type:y},{type:u},{type:g},{type:e.NgZone}]},t.propDecorators={view:[{type:e.Input}],layers:[{type:e.Input}],zoom:[{type:e.Input}],center:[{type:e.Input}],labelzIndex:[{type:e.Input}],zooms:[{type:e.Input}],lang:[{type:e.Input}],defaultCursor:[{type:e.Input}],crs:[{type:e.Input}],animateEnable:[{type:e.Input}],isHotspot:[{type:e.Input}],defaultLayer:[{type:e.Input}],rotateEnable:[{type:e.Input}],resizeEnable:[{type:e.Input}],showIndoorMap:[{type:e.Input}],indoorMap:[{type:e.Input}],expandZoomRange:[{type:e.Input}],dragEnable:[{type:e.Input}],zoomEnable:[{type:e.Input}],doubleClickZoom:[{type:e.Input}],keyboardEnable:[{type:e.Input}],jogEnable:[{type:e.Input}],scrollWheel:[{type:e.Input}],touchZoom:[{type:e.Input}],touchZoomCenter:[{type:e.Input}],mapStyle:[{type:e.Input}],features:[{type:e.Input}],showBuildingBlock:[{type:e.Input}],viewMode:[{type:e.Input}],pitch:[{type:e.Input}],pitchEnable:[{type:e.Input}],buildingAnimation:[{type:e.Input}],skyColor:[{type:e.Input}],preloadMode:[{type:e.Input}],mask:[{type:e.Input}],maxPitch:[{type:e.Input}],rotation:[{type:e.Input}],forceVector:[{type:e.Input}],gridMapForeign:[{type:e.Input}],vectorMapForeign:[{type:e.Input}],city:[{type:e.Input}],name:[{type:e.Input}],plugins:[{type:e.Input}],naReady:[{type:e.Output}],naComplete:[{type:e.Output}],naClick:[{type:e.Output}],naDblClick:[{type:e.Output}],naRightClick:[{type:e.Output}],naMouseMove:[{type:e.Output}],naMouseOver:[{type:e.Output}],naMouseWheel:[{type:e.Output}],naMouseUp:[{type:e.Output}],naMouseOut:[{type:e.Output}],naMouseDown:[{type:e.Output}],naTouchStart:[{type:e.Output}],naTouchMove:[{type:e.Output}],naTouchEnd:[{type:e.Output}],naHotspotClick:[{type:e.Output}],naHotspotOver:[{type:e.Output}],naHotspotOut:[{type:e.Output}],naDragStart:[{type:e.Output}],naDragging:[{type:e.Output}],naDragEnd:[{type:e.Output}],naResize:[{type:e.Output}],naZoomStart:[{type:e.Output}],naZoomEnd:[{type:e.Output}],naZoomChange:[{type:e.Output}],naMoveStart:[{type:e.Output}],naMoveEnd:[{type:e.Output}],naMove:[{type:e.Output}],naPluginsLoaded:[{type:e.Output}]},t}();var I=function(){function t(t,e,r){this.amaps=t,this.logger=e,this.ngZone=r,this.marker$=new n.ReplaySubject(1)}return t.prototype.get=function(){return this.marker$.asObservable()},t.prototype.create=function(t,e){var n=this;return void 0===e&&(e=!0),this.amaps.get().pipe(r.map((function(r){return e&&(t.map=r),n.marker=n.ngZone.runOutsideAngular((function(){return new AMap.Marker(t)})),n.logger.d("AmapMarker","new marker created."),n.marker$.next(n.marker),n.marker$.complete(),n.marker})))},t.prototype.destroy=function(){var t=this;this.get().subscribe((function(e){e.setMap(null),t.logger.d("AmapMarker","marker destroyed."),t.marker=null}))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:h},{type:u},{type:e.NgZone}]},t}();var w=["cursor","extData","bubble","clickable","draggable"],O=function(){function t(t,e){this.os=t,this.binder=e;var n=t.get();this.naTouchStart=this.binder.bindEvent(n,"touchstart"),this.naTouchMove=this.binder.bindEvent(n,"touchmove"),this.naTouchEnd=this.binder.bindEvent(n,"touchend"),this.naClick=this.binder.bindEvent(n,"click"),this.naDblClick=this.binder.bindEvent(n,"dblclick"),this.naRightClick=this.binder.bindEvent(n,"rightclick"),this.naMouseOver=this.binder.bindEvent(n,"mouseover"),this.naMouseUp=this.binder.bindEvent(n,"mouseup"),this.naMouseOut=this.binder.bindEvent(n,"mouseout"),this.naMouseDown=this.binder.bindEvent(n,"mousedown")}return t.propDecorators={cursor:[{type:e.Input}],extData:[{type:e.Input}],bubble:[{type:e.Input}],clickable:[{type:e.Input}],draggable:[{type:e.Input}],naTouchStart:[{type:e.Output}],naTouchMove:[{type:e.Output}],naTouchEnd:[{type:e.Output}],naClick:[{type:e.Output}],naDblClick:[{type:e.Output}],naRightClick:[{type:e.Output}],naMouseOver:[{type:e.Output}],naMouseUp:[{type:e.Output}],naMouseOut:[{type:e.Output}],naMouseDown:[{type:e.Output}]},t}();var C=function(){function t(){}return t.prototype.create=function(t){return t?t instanceof AMap.Pixel?t:Array.isArray(t)?new AMap.Pixel(t[0],t[1]):new AMap.Pixel(t.x||0,t.y||0,t.round):null},t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[]},t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}(),z=function(){function t(){}return t.prototype.create=function(t){return t?t instanceof AMap.Size||Array.isArray(t)?t:void 0!==t.width&&void 0!==t.height?new AMap.Size(t.width,t.height):void 0!==t.w&&void 0!==t.h?new AMap.Size(t.w,t.h):null:null},t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[]},t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t},token:t,providedIn:"root"}),t}(),A=function(){function t(t,e){this.pixels=t,this.sizes=e}return t.prototype.create=function(t){if(!t)return null;if("string"==typeof t)return t;if(t instanceof AMap.Icon)return t;var e={},n=t.size,r=t.image,i=t.imageOffset,o=t.imageSize;return void 0!==n&&(e.size=this.sizes.create(n)),void 0!==r&&(e.image=r),void 0!==i&&(e.imageOffset=this.pixels.create(i)),void 0!==o&&(e.imageSize=this.sizes.create(o)),new AMap.Icon(e)},t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:C},{type:z}]},t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(C),e.ɵɵinject(z))},token:t,providedIn:"root"}),t}();var M=function(){function t(t){this.pixel=t}return t.prototype.create=function(t){if(t){var e={};return void 0!==t.content&&(e.content=t.content),void 0!==t.offset&&(t.offset instanceof AMap.Pixel?e.offset=t.offset:e.offset=this.pixel.create(t.offset)),void 0!==t.direction&&(e.direction=t.direction),e}return null},t.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:C}]},t.ngInjectableDef=e.ɵɵdefineInjectable({factory:function(){return new t(e.ɵɵinject(C))},token:t,providedIn:"root"}),t}();var k=function(){function t(t,e,r){this.amaps=t,this.logger=e,this.ngZone=r,this.infoWindow$=new n.ReplaySubject(1)}return t.prototype.get=function(){return this.infoWindow$.asObservable()},t.prototype.create=function(t){var e=this;return this.amaps.get().pipe(r.map((function(n){return e.map=n,e.infoWindow=e.ngZone.runOutsideAngular((function(){return new AMap.InfoWindow(t)})),e.logger.d("AmapInfoWindow","new InfoWindow created."),e.infoWindow$.next(e.infoWindow),e.infoWindow$.complete(),e.infoWindow})))},t.prototype.destroy=function(){var t=this;this.get().subscribe((function(e){e.close(),t.logger.d("AmapInfoWindow","InfoWindow destroyed."),t.infoWindow=null,t.map=null}))},t.prototype.open=function(t){var e=this;this.get().subscribe((function(n){return n.open(e.map,t)}))},t.prototype.openOnMark=function(t){var e=this;n.zip(t,this.get()).subscribe((function(t){var n=s(t,2),r=n[0];n[1].open(e.map,r.getPosition())}))},t.prototype.close=function(){this.get().subscribe((function(t){return t.close()}))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:h},{type:u},{type:e.NgZone}]},t}();var x="amap-info-window",D=["isCustom","autoMove","closeWhenClickMap","content","size","anchor","offset","position","showShadow"],P=function(){function t(t,n,r,i,o,s,a,p){this.os=t,this.binder=n,this.amaps=r,this.el=i,this.logger=o,this.pixels=s,this.sizes=a,this.ngZone=p,this.isOpen=!1,this.naReady=new e.EventEmitter,this.isOpenChange=new e.EventEmitter,this.inited=!1;var u=this.os.get();this.naOpen=this.binder.bindEvent(u,"open"),this.naClose=this.binder.bindEvent(u,"close"),this.naChange=this.binder.bindEvent(u,"change")}return t.prototype.ngOnChanges=function(t){var e=this,r=f.of(t),i=this.get();this.inited?(r.has("isOpen").subscribe((function(){return e.toggleOpen()})),n.zip(r.has("content"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setContent(n)})),n.zip(r.notEmpty("position"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setPosition(n)})),n.zip(r.notEmpty("size"),i).subscribe((function(t){var n=s(t,2),r=n[0];return n[1].setSize(e.sizes.create(r))})),n.zip(r.notEmpty("anchor"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setAnchor(n)}))):this.amaps.get().subscribe((function(){e.logger.d(x,"initializing ..."),e.subscriptions=e.binder.bindEvent(i,"open").subscribe((function(){e.isOpen||(e.isOpen=!0,e.isOpenChange.emit(!0))})),e.subscriptions.add(e.binder.bindEvent(i,"close").subscribe((function(){e.isOpen&&(e.isOpen=!1,e.isOpenChange.emit(!1))}))),e.content=e.content?e.content:e.el.nativeElement.querySelector(".amap-info-window-content");var t=b(e,D);e.offset&&(t.offset=e.pixels.create(e.offset)),e.size&&(t.size=e.sizes.create(e.size)),e.logger.d(x,"options:",t),e.os.create(t).subscribe((function(t){e.ngZone.run((function(){e.toggleOpen(),e.naReady.emit(t)})),e.logger.d(x,"InfoWindow is ready.")})),e.inited=!0}))},t.prototype.ngOnDestroy=function(){this.subscriptions&&this.subscriptions.unsubscribe(),this.os.destroy()},t.prototype.get=function(){return this.os.get()},t.prototype.toggleOpen=function(){this.logger.d(x,"toggle open"),this.isOpen?this.open():this.close()},t.prototype.open=function(){this.hostMarker?this.os.openOnMark(this.hostMarker):this.os.open()},t.prototype.close=function(){this.os.close()},t.decorators=[{type:e.Component,args:[{selector:"amap-info-window",template:"<div class='amap-info-window-inner'></div>\n<div class='amap-info-window-content'>\n <ng-content></ng-content>\n</div>",providers:[k],styles:[""]}]}],t.ctorParameters=function(){return[{type:k},{type:g},{type:h},{type:e.ElementRef},{type:u},{type:C},{type:z},{type:e.NgZone}]},t.propDecorators={isCustom:[{type:e.Input}],autoMove:[{type:e.Input}],closeWhenClickMap:[{type:e.Input}],content:[{type:e.Input}],size:[{type:e.Input}],anchor:[{type:e.Input}],offset:[{type:e.Input}],position:[{type:e.Input}],showShadow:[{type:e.Input}],isOpen:[{type:e.Input}],naReady:[{type:e.Output}],naOpen:[{type:e.Output}],naClose:[{type:e.Output}],naChange:[{type:e.Output}],isOpenChange:[{type:e.Output}]},t}();var Z="amap-marker",j=a(w,["position","anchor","offset","icon","content","topWhenClick","raiseOnDrag","visible","zIndex","angle","autoRotation","animation","shadow","title","shape","label"]),R=function(t){function r(n,r,i,o,s,a,p,u){var c=t.call(this,n,r)||this;c.os=n,c.binder=r,c.amaps=i,c.pixels=o,c.icons=s,c.mlabels=a,c.logger=p,c.ngZone=u,c.hidden=!1,c.inCluster=!1,c.openInfoWindow=!0,c.naReady=new e.EventEmitter,c.infoWindowComponent=new e.QueryList,c.inited=!1;var d=c.os.get();return c.naMouseOut=c.binder.bindEvent(d,"mouseout"),c.naDragStart=c.binder.bindEvent(d,"dragstart"),c.naDragging=c.binder.bindEvent(d,"dragging"),c.naDragEnd=c.binder.bindEvent(d,"dragend"),c.naMoving=c.binder.bindEvent(d,"moving"),c.naMoveEnd=c.binder.bindEvent(d,"moveend"),c.naMoveAlong=c.binder.bindEvent(d,"movealong"),c}return o(r,t),r.prototype.ngOnDestroy=function(){this.subscription&&this.subscription.unsubscribe(),this.os.destroy()},r.prototype.ngOnChanges=function(t){var e=this,r=f.of(t),i=this.get();if(this.inited)n.zip(r.has("icon"),i).subscribe((function(t){var n=s(t,2),r=n[0];return n[1].setIcon(e.icons.create(r))})),n.zip(r.has("shadow"),i).subscribe((function(t){var n=s(t,2),r=n[0];return n[1].setShadow(e.icons.create(r))})),n.zip(r.has("label"),i).subscribe((function(t){var n=s(t,2),r=n[0];return n[1].setLabel(e.mlabels.create(r))})),n.zip(r.has("title"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setTitle(n)})),n.zip(r.has("content"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setContent(n)})),n.zip(r.has("extData"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setExtData(n)})),n.zip(r.has("clickable"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setClickable(!!n)})),n.zip(r.has("draggable"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setDraggable(!!n)})),n.zip(r.has("visible"),i).subscribe((function(t){var e=s(t,2),n=e[0],r=e[1];return n?r.show():r.hide()})),n.zip(r.has("cursor"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setCursor(n)})),n.zip(r.has("animation"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setAnimation(n)})),n.zip(r.has("angle"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setAngle(n)})),n.zip(r.has("zIndex"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setzIndex(n)})),n.zip(r.has("shape"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setShape(n)})),n.zip(r.notEmpty("offset"),i).subscribe((function(t){var n=s(t,2),r=n[0];return n[1].setOffset(e.pixels.create(r))})),n.zip(r.notEmpty("position"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setPosition(n)}));else{if(!this.position)return;this.amaps.get().subscribe((function(){e.logger.d(Z,"initializing ..."),e.subscription=e.binder.bindEvent(i,"click").subscribe((function(){e.openInfoWindow&&e.infoWindowComponent.forEach((function(t){return t.open()}))}));var t=b(e,j);e.icon&&(t.icon=e.icons.create(e.icon)),e.shadow&&(t.shadow=e.icons.create(e.shadow)),e.label&&(t.label=e.mlabels.create(e.label)),e.offset&&(t.offset=e.pixels.create(e.offset)),e.logger.d(Z,"options:",t),e.os.create(t,!e.inCluster).subscribe((function(t){e.ngZone.run((function(){return e.naReady.emit(t)})),e.logger.d(Z,"marker is ready.")})),e.inited=!0,e.updateInfoWindow(),e.updateInfoWindowPosition()}))}n.zip(r.has("isTop"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setTop(!!n)})),n.zip(r.has("hidden"),i).subscribe((function(t){var e=s(t,2),n=e[0],r=e[1];return n?r.hide():r.show()}))},r.prototype.ngAfterContentInit=function(){var t=this;this.updateInfoWindow(),this.infoWindowComponent.changes.subscribe((function(){return t.updateInfoWindow()}))},r.prototype.updateInfoWindow=function(){if(this.infoWindowComponent&&this.inited){if(this.infoWindowComponent.length>1)return void this.logger.e(Z,"Expected no more than 1 info window.");var t=this.os.get();this.infoWindowComponent.forEach((function(e){e.hostMarker=t}))}},r.prototype.updateInfoWindowPosition=function(){this.infoWindowComponent&&this.inited&&this.infoWindowComponent.forEach((function(t){t.toggleOpen()}))},r.prototype.get=function(){return this.os.get()},r.decorators=[{type:e.Directive,args:[{selector:"amap-marker",exportAs:"marker",providers:[I]}]}],r.ctorParameters=function(){return[{type:I},{type:g},{type:h},{type:C},{type:A},{type:M},{type:u},{type:e.NgZone}]},r.propDecorators={position:[{type:e.Input}],anchor:[{type:e.Input}],offset:[{type:e.Input}],icon:[{type:e.Input}],content:[{type:e.Input}],topWhenClick:[{type:e.Input}],raiseOnDrag:[{type:e.Input}],visible:[{type:e.Input}],zIndex:[{type:e.Input}],angle:[{type:e.Input}],autoRotation:[{type:e.Input}],animation:[{type:e.Input}],shadow:[{type:e.Input}],title:[{type:e.Input}],shape:[{type:e.Input}],label:[{type:e.Input}],isTop:[{type:e.Input}],hidden:[{type:e.Input}],inCluster:[{type:e.Input}],openInfoWindow:[{type:e.Input}],naReady:[{type:e.Output}],naMouseOut:[{type:e.Output}],naDragStart:[{type:e.Output}],naDragging:[{type:e.Output}],naDragEnd:[{type:e.Output}],naMoving:[{type:e.Output}],naMoveEnd:[{type:e.Output}],naMoveAlong:[{type:e.Output}],infoWindowComponent:[{type:e.ContentChildren,args:[P]}]},r}(O);var S=function(t){function n(e,n){var r=t.call(this,e,n)||this;r.os=e,r.binder=n;var i=e.get();return r.naShow=r.binder.bindEvent(i,"show"),r.naHide=r.binder.bindEvent(i,"hide"),r.naChange=r.binder.bindEvent(i,"change"),r}return o(n,t),n.propDecorators={naShow:[{type:e.Output}],naHide:[{type:e.Output}],naChange:[{type:e.Output}]},n}(O);var $=a(w,["visible","zIndex","strokeColor","strokeOpacity","strokeWeight","strokeStyle","strokeDasharray","lineJoin","lineCap"]),W=function(t){function n(e,n){var r=t.call(this,e,n)||this;return r.os=e,r.binder=n,r}return o(n,t),n.propDecorators={visible:[{type:e.Input}],zIndex:[{type:e.Input}],strokeColor:[{type:e.Input}],strokeOpacity:[{type:e.Input}],strokeWeight:[{type:e.Input}],strokeStyle:[{type:e.Input}],strokeDasharray:[{type:e.Input}],lineJoin:[{type:e.Input}],lineCap:[{type:e.Input}]},n}(S);var N="AmapPolyline",T=function(){function t(t,e,r,i){this.amaps=t,this.logger=e,this.ngZone=r,this.plugins=i,this.polyline$=new n.ReplaySubject(1),this.editor$=new n.ReplaySubject(1)}return t.prototype.get=function(){return this.polyline$.asObservable()},t.prototype.create=function(t){var e=this;return this.amaps.get().pipe(r.map((function(n){return t.map=n,e.polyline=e.ngZone.runOutsideAngular((function(){return new AMap.Polyline(t)})),e.logger.d(N,"new Polyline created."),e.polyline$.next(e.polyline),e.polyline$.complete(),e.polyline})))},t.prototype.destroy=function(){var t=this;this.get().subscribe((function(e){e.setMap(null),t.logger.d(N,"Polyline destroyed."),t.polyline=null}))},t.prototype.getEditor=function(){return this.editor$.asObservable()},t.prototype.loadEditor=function(){return this.plugins.load("AMap.PolyEditor")},t.prototype.createEditor=function(){var t=this;return this.loadEditor().pipe(r.switchMapTo(n.zip(this.amaps.get(),this.get())),r.map((function(e){var n=s(e,2),r=n[0],i=n[1];return t.editor=t.ngZone.runOutsideAngular((function(){return new AMap.PolyEditor(r,i)})),t.logger.d(N,"new PolyEditor created."),t.editor$.next(t.editor),t.editor$.complete(),t.editor})))},t.prototype.toggleEditor=function(t){!t||this.editor?this.editor&&(t?this.editor.open():this.editor.close()):this.createEditor().subscribe((function(t){return t.open()}))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:h},{type:u},{type:e.NgZone},{type:y}]},t}();var L="amap-polyline",B=a($,["isOutline","outlineColor","geodesic","dirColor","borderWeight","showDir","path"]),U=function(t){function r(n,r,i,o){var s=t.call(this,n,r)||this;s.os=n,s.binder=r,s.logger=i,s.ngZone=o,s.hidden=!1,s.editor=!1,s.naReady=new e.EventEmitter,s.inited=!1;var a=s.os.getEditor();return s.naEditorAddNode=s.binder.bindEvent(a,"addnode"),s.naEditorRemoveNode=s.binder.bindEvent(a,"removenode"),s.naEditorAdjust=s.binder.bindEvent(a,"adjust"),s.naEditorEnd=s.binder.bindEvent(a,"end"),s}return o(r,t),r.prototype.ngOnDestroy=function(){this.os.destroy()},r.prototype.ngOnChanges=function(t){var e=this,r=f.of(t),i=this.get();if(this.inited)n.zip(r.has("path"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setPath(n)})),n.zip(r.has("options"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setOptions(n||{})})),n.zip(r.has("extData"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setExtData(n)}));else{this.logger.d(L,"initializing ...");var o=this.options||b(this,B);this.logger.d(L,"options:",o),this.os.create(o).subscribe((function(t){e.ngZone.run((function(){return e.naReady.emit(t)})),e.logger.d(L,"polyline is ready.")})),this.inited=!0}n.zip(r.has("hidden"),i).subscribe((function(t){var e=s(t,2),n=e[0],r=e[1];return n?r.hide():r.show()})),r.has("editor").subscribe((function(t){return e.os.toggleEditor(t)}))},r.prototype.get=function(){return this.os.get()},r.decorators=[{type:e.Directive,args:[{selector:"amap-polyline",exportAs:"polyline",providers:[T]}]}],r.ctorParameters=function(){return[{type:T},{type:g},{type:u},{type:e.NgZone}]},r.propDecorators={isOutline:[{type:e.Input}],outlineColor:[{type:e.Input}],geodesic:[{type:e.Input}],dirColor:[{type:e.Input}],borderWeight:[{type:e.Input}],showDir:[{type:e.Input}],path:[{type:e.Input}],hidden:[{type:e.Input}],editor:[{type:e.Input}],options:[{type:e.Input}],naReady:[{type:e.Output}],naEditorAddNode:[{type:e.Output}],naEditorRemoveNode:[{type:e.Output}],naEditorAdjust:[{type:e.Output}],naEditorEnd:[{type:e.Output}]},r}(W);var H=function(){function t(t,e,r){this.amaps=t,this.logger=e,this.ngZone=r,this.text$=new n.ReplaySubject(1)}return t.prototype.get=function(){return this.text$.asObservable()},t.prototype.create=function(t,e){var n=this;return void 0===e&&(e=!0),this.amaps.get().pipe(r.map((function(r){return e&&(t.map=r),n.text=n.ngZone.runOutsideAngular((function(){return new AMap.Text(t)})),n.logger.d("AmapText","new text created."),n.text$.next(n.text),n.text$.complete(),n.text})))},t.prototype.destroy=function(){var t=this;this.get().subscribe((function(e){e.setMap(null),t.logger.d("AmapText","text destroyed."),t.text=null}))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:h},{type:u},{type:e.NgZone}]},t}();var _="amap-text",V=a(w,["text","position","anchor","offset","topWhenClick","raiseOnDrag","visible","zIndex","angle","autoRotation","animation","shadow","title","style"]),F=function(t){function r(n,r,i,o,s,a,p,u){var c=t.call(this,n,r)||this;c.os=n,c.binder=r,c.amaps=i,c.el=o,c.pixels=s,c.icons=a,c.logger=p,c.ngZone=u,c.hidden=!1,c.inCluster=!1,c.openInfoWindow=!0,c.naReady=new e.EventEmitter,c.infoWindowComponent=new e.QueryList,c.inited=!1;var d=c.os.get();return c.naMouseOut=c.binder.bindEvent(d,"mouseout"),c.naDragStart=c.binder.bindEvent(d,"dragstart"),c.naDragging=c.binder.bindEvent(d,"dragging"),c.naDragEnd=c.binder.bindEvent(d,"dragend"),c.naMoving=c.binder.bindEvent(d,"moving"),c.naMoveEnd=c.binder.bindEvent(d,"moveend"),c.naMoveAlong=c.binder.bindEvent(d,"movealong"),c}return o(r,t),r.prototype.ngOnDestroy=function(){this.subscription&&this.subscription.unsubscribe(),this.os.destroy()},r.prototype.ngOnChanges=function(t){var e=this,r=f.of(t),i=this.get();if(this.inited)n.zip(r.has("shadow"),i).subscribe((function(t){var n=s(t,2),r=n[0];return n[1].setShadow(e.icons.create(r))})),n.zip(r.has("offset"),i).subscribe((function(t){var n=s(t,2),r=n[0];return n[1].setOffset(e.pixels.create(r))})),n.zip(r.has("title"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setTitle(n)})),n.zip(r.has("content"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setContent(n)})),n.zip(r.has("extData"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setExtData(n)})),n.zip(r.has("clickable"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setClickable(!!n)})),n.zip(r.has("draggable"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setDraggable(!!n)})),n.zip(r.has("visible"),i).subscribe((function(t){var e=s(t,2),n=e[0],r=e[1];return n?r.show():r.hide()})),n.zip(r.has("cursor"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setCursor(n)})),n.zip(r.has("animation"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setAnimation(n)})),n.zip(r.has("angle"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setAngle(n)})),n.zip(r.has("zIndex"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setzIndex(n)})),n.zip(r.notEmpty("position"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setPosition(n)})),n.zip(r.notEmpty("style"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setStyle(n)}));else{if(!this.position)return;this.amaps.get().subscribe((function(){e.logger.d(_,"initializing ..."),e.subscription=e.binder.bindEvent(i,"click").subscribe((function(){e.openInfoWindow&&e.infoWindowComponent.forEach((function(t){return t.open()}))}));var t=e.el.nativeElement.querySelector(".amap-text-content");e.text=e.text?e.text:t.innerText;var n=b(e,V);e.shadow&&(n.shadow=e.icons.create(e.shadow)),e.offset&&(n.offset=e.pixels.create(e.offset)),e.logger.d(_,"options:",n),e.os.create(n).subscribe((function(t){e.ngZone.run((function(){return e.naReady.emit(t)})),e.logger.d(_,"marker is ready.")})),e.inited=!0,e.updateInfoWindow(),e.updateInfoWindowPosition()}))}n.zip(r.has("isTop"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setTop(!!n)})),n.zip(r.has("hidden"),i).subscribe((function(t){var e=s(t,2),n=e[0],r=e[1];return n?r.hide():r.show()}))},r.prototype.ngAfterContentInit=function(){var t=this;this.updateInfoWindow(),this.infoWindowComponent.changes.subscribe((function(){return t.updateInfoWindow()}))},r.prototype.updateInfoWindow=function(){if(this.infoWindowComponent&&this.inited){if(this.infoWindowComponent.length>1)return void this.logger.e(_,"Expected no more than 1 info window.");var t=this.os.get();this.infoWindowComponent.forEach((function(e){e.hostMarker=t}))}},r.prototype.updateInfoWindowPosition=function(){this.infoWindowComponent&&this.inited&&this.infoWindowComponent.forEach((function(t){t.toggleOpen()}))},r.prototype.get=function(){return this.os.get()},r.decorators=[{type:e.Component,args:[{selector:"amap-text",exportAs:"text",template:"<div class='amap-text-inner'></div>\n<div class='amap-text-content'>\n <ng-content></ng-content>\n</div>",providers:[H]}]}],r.ctorParameters=function(){return[{type:H},{type:g},{type:h},{type:e.ElementRef},{type:C},{type:A},{type:u},{type:e.NgZone}]},r.propDecorators={text:[{type:e.Input}],position:[{type:e.Input}],anchor:[{type:e.Input}],offset:[{type:e.Input}],topWhenClick:[{type:e.Input}],raiseOnDrag:[{type:e.Input}],visible:[{type:e.Input}],zIndex:[{type:e.Input}],angle:[{type:e.Input}],autoRotation:[{type:e.Input}],animation:[{type:e.Input}],shadow:[{type:e.Input}],title:[{type:e.Input}],style:[{type:e.Input}],isTop:[{type:e.Input}],hidden:[{type:e.Input}],inCluster:[{type:e.Input}],openInfoWindow:[{type:e.Input}],naReady:[{type:e.Output}],naMouseOut:[{type:e.Output}],naDragStart:[{type:e.Output}],naDragging:[{type:e.Output}],naDragEnd:[{type:e.Output}],naMoving:[{type:e.Output}],naMoveEnd:[{type:e.Output}],naMoveAlong:[{type:e.Output}],infoWindowComponent:[{type:e.ContentChildren,args:[P]}]},r}(O);var G=a($,["fillColor","fillOpacity","path"]),q=function(t){function n(n,r){var i=t.call(this,n,r)||this;i.os=n,i.binder=r,i.hidden=!1,i.editor=!1,i.naReady=new e.EventEmitter;var o=i.os.getEditor();return i.naEditorAddNode=i.binder.bindEvent(o,"addnode"),i.naEditorRemoveNode=i.binder.bindEvent(o,"removenode"),i.naEditorAdjust=i.binder.bindEvent(o,"adjust"),i.naEditorEnd=i.binder.bindEvent(o,"end"),i}return o(n,t),n.propDecorators={path:[{type:e.Input}],fillColor:[{type:e.Input}],fillOpacity:[{type:e.Input}],hidden:[{type:e.Input}],editor:[{type:e.Input}],options:[{type:e.Input}],naReady:[{type:e.Output}],naEditorAddNode:[{type:e.Output}],naEditorRemoveNode:[{type:e.Output}],naEditorAdjust:[{type:e.Output}],naEditorEnd:[{type:e.Output}]},n}(W);var Q="AmapPolygon",J=function(){function t(t,e,r,i){this.amaps=t,this.logger=e,this.ngZone=r,this.plugins=i,this.polygon$=new n.ReplaySubject(1),this.editor$=new n.ReplaySubject(1)}return t.prototype.get=function(){return this.polygon$.asObservable()},t.prototype.create=function(t){var e=this;return this.amaps.get().pipe(r.map((function(n){return t.map=n,e.polygon=e.ngZone.runOutsideAngular((function(){return new AMap.Polygon(t)})),e.logger.d(Q,"new Polygon created."),e.polygon$.next(e.polygon),e.polygon$.complete(),e.polygon})))},t.prototype.destroy=function(){var t=this;this.get().subscribe((function(e){e.setMap(null),t.logger.d(Q,"Polygon destroyed."),t.polygon=null}))},t.prototype.getEditor=function(){return this.editor$.asObservable()},t.prototype.loadEditor=function(){return this.plugins.load("AMap.PolyEditor")},t.prototype.createEditor=function(){var t=this;return this.loadEditor().pipe(r.switchMapTo(n.zip(this.amaps.get(),this.get())),r.map((function(e){var n=s(e,2),r=n[0],i=n[1];return t.editor=t.ngZone.runOutsideAngular((function(){return new AMap.PolyEditor(r,i)})),t.logger.d(Q,"new PolyEditor created."),t.editor$.next(t.editor),t.editor$.complete(),t.editor})))},t.prototype.toggleEditor=function(t){!t||this.editor?this.editor&&(t?this.editor.open():this.editor.close()):this.createEditor().subscribe((function(t){return t.open()}))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:h},{type:u},{type:e.NgZone},{type:y}]},t}();var Y="amap-polygon",K=function(t){function r(e,n,r,i){var o=t.call(this,e,n)||this;return o.os=e,o.binder=n,o.logger=r,o.ngZone=i,o.inited=!1,o}return o(r,t),r.prototype.ngOnDestroy=function(){this.os.destroy()},r.prototype.ngOnChanges=function(t){var e=this,r=f.of(t),i=this.get();if(this.inited)n.zip(r.has("path"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setPath(n)})),n.zip(r.has("options"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setOptions(n||{})})),n.zip(r.has("extData"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setExtData(n)}));else{this.logger.d(Y,"initializing ...");var o=this.options||b(this,G);this.logger.d(Y,"options:",o),this.os.create(o).subscribe((function(t){e.ngZone.run((function(){return e.naReady.emit(t)})),e.logger.d(Y,"polygon is ready.")})),this.inited=!0}n.zip(r.has("hidden"),i).subscribe((function(t){var e=s(t,2),n=e[0],r=e[1];return n?r.hide():r.show()})),r.has("editor").subscribe((function(t){return e.os.toggleEditor(t)}))},r.prototype.get=function(){return this.os.get()},r.decorators=[{type:e.Directive,args:[{selector:"amap-polygon",exportAs:"polygon",providers:[J]}]}],r.ctorParameters=function(){return[{type:J},{type:g},{type:u},{type:e.NgZone}]},r}(q);var X="AmapBezierCurve",tt=function(){function t(t,e,r,i){this.amaps=t,this.logger=e,this.ngZone=r,this.plugins=i,this.bezierCurve$=new n.ReplaySubject(1),this.editor$=new n.ReplaySubject(1),this.polyEditor$=new n.ReplaySubject(1)}return t.prototype.get=function(){return this.bezierCurve$.asObservable()},t.prototype.create=function(t){var e=this;return this.amaps.get().pipe(r.map((function(n){return t.map=n,e.bezierCurve=e.ngZone.runOutsideAngular((function(){return new AMap.BezierCurve(t)})),e.logger.d(X,"new BezierCurve created."),e.bezierCurve$.next(e.bezierCurve),e.bezierCurve$.complete(),e.bezierCurve})))},t.prototype.destroy=function(){var t=this;this.get().subscribe((function(e){e.setMap(null),t.logger.d(X,"BezierCurve destroyed."),t.bezierCurve=null}))},t.prototype.getEditor=function(){return this.editor$.asObservable()},t.prototype.getPolyEditor=function(){return this.polyEditor$.asObservable()},t.prototype.loadEditor=function(){return this.plugins.load("AMap.BezierCurveEditor")},t.prototype.loadPolyEditor=function(){return this.plugins.load("AMap.PolyEditor")},t.prototype.createEditor=function(){var t=this;return this.loadEditor().pipe(r.switchMapTo(n.zip(this.amaps.get(),this.get())),r.map((function(e){var n=s(e,2),r=n[0],i=n[1];return t.editor=t.ngZone.runOutsideAngular((function(){return new AMap.BezierCurveEditor(r,i)})),t.logger.d(X,"new BezierCurveEditor created."),t.editor$.next(t.editor),t.editor$.complete(),t.editor})))},t.prototype.createPolyEditor=function(){var t=this;return this.loadPolyEditor().pipe(r.switchMapTo(n.zip(this.amaps.get(),this.get())),r.map((function(e){var n=s(e,2),r=n[0],i=n[1];return t.polyEditor=t.ngZone.runOutsideAngular((function(){return new AMap.PolyEditor(r,i)})),t.logger.d(X,"new PolyEditor created."),t.polyEditor$.next(t.polyEditor),t.polyEditor$.complete(),t.polyEditor})))},t.prototype.toggleEditor=function(t){!t||this.editor?this.editor&&(t?this.editor.open():this.editor.close()):this.createEditor().subscribe((function(t){return t.open()}))},t.prototype.togglePolyEditor=function(t){!t||this.polyEditor?this.polyEditor&&(t?this.polyEditor.open():this.polyEditor.close()):this.createPolyEditor().subscribe((function(t){return t.open()}))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:h},{type:u},{type:e.NgZone},{type:y}]},t}();var et="amap-bezier-curve",nt=a($,["isOutline","outlineColor","dirColor","borderWeight","showDir","path"]),rt=function(t){function r(n,r,i,o){var s=t.call(this,n,r)||this;s.os=n,s.binder=r,s.logger=i,s.ngZone=o,s.hidden=!1,s.editor=!1,s.polyEditor=!1,s.naReady=new e.EventEmitter,s.inited=!1;var a=s.os.getEditor(),p=s.os.getPolyEditor();return s.naEditorAddNode=s.binder.bindEvent(a,"addnode"),s.naEditorRemoveNode=s.binder.bindEvent(a,"removenode"),s.naEditorAdjust=s.binder.bindEvent(a,"adjust"),s.naEditorEnd=s.binder.bindEvent(a,"end"),s.naPolyEditorAddNode=s.binder.bindEvent(p,"addnode"),s.naPolyEditorRemoveNode=s.binder.bindEvent(p,"removenode"),s.naPolyEditorAdjust=s.binder.bindEvent(p,"adjust"),s.naPolyEditorEnd=s.binder.bindEvent(p,"end"),s}return o(r,t),r.prototype.ngOnDestroy=function(){this.os.destroy()},r.prototype.ngOnChanges=function(t){var e=this,r=f.of(t),i=this.get();if(this.inited)n.zip(r.has("path"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setPath(n)})),n.zip(r.has("options"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setOptions(n||{})})),n.zip(r.has("extData"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setExtData(n)}));else{this.logger.d(et,"initializing ...");var o=this.options||b(this,nt);this.logger.d(et,"options:",o),this.os.create(o).subscribe((function(t){e.ngZone.run((function(){return e.naReady.emit(t)})),e.logger.d(et,"bezierCurve is ready.")})),this.inited=!0}n.zip(r.has("hidden"),i).subscribe((function(t){var e=s(t,2),n=e[0],r=e[1];return n?r.hide():r.show()})),r.has("editor").subscribe((function(t){return e.os.toggleEditor(t)})),r.has("polyEditor").subscribe((function(t){return e.os.togglePolyEditor(t)}))},r.prototype.get=function(){return this.os.get()},r.decorators=[{type:e.Directive,args:[{selector:"amap-bezier-curve",exportAs:"bezier-curve",providers:[tt]}]}],r.ctorParameters=function(){return[{type:tt},{type:g},{type:u},{type:e.NgZone}]},r.propDecorators={isOutline:[{type:e.Input}],outlineColor:[{type:e.Input}],dirColor:[{type:e.Input}],borderWeight:[{type:e.Input}],showDir:[{type:e.Input}],path:[{type:e.Input}],hidden:[{type:e.Input}],editor:[{type:e.Input}],polyEditor:[{type:e.Input}],options:[{type:e.Input}],naReady:[{type:e.Output}],naEditorAddNode:[{type:e.Output}],naEditorRemoveNode:[{type:e.Output}],naEditorAdjust:[{type:e.Output}],naEditorEnd:[{type:e.Output}],naPolyEditorAddNode:[{type:e.Output}],naPolyEditorRemoveNode:[{type:e.Output}],naPolyEditorAdjust:[{type:e.Output}],naPolyEditorEnd:[{type:e.Output}]},r}(W);var it="AmapRectangle",ot=function(){function t(t,e,r,i){this.amaps=t,this.logger=e,this.ngZone=r,this.plugins=i,this.rectangle$=new n.ReplaySubject(1),this.editor$=new n.ReplaySubject(1)}return t.prototype.get=function(){return this.rectangle$.asObservable()},t.prototype.create=function(t){var e=this;return this.amaps.get().pipe(r.map((function(n){return t.map=n,e.rectangle=e.ngZone.runOutsideAngular((function(){return new AMap.Rectangle(t)})),e.logger.d(it,"new Rectangle created."),e.rectangle$.next(e.rectangle),e.rectangle$.complete(),e.rectangle})))},t.prototype.destroy=function(){var t=this;this.get().subscribe((function(e){e.setMap(null),t.logger.d(it,"Rectangle destroyed."),t.rectangle=null}))},t.prototype.getEditor=function(){return this.editor$.asObservable()},t.prototype.loadEditor=function(){return this.plugins.load("AMap.RectangleEditor")},t.prototype.createEditor=function(){var t=this;return this.loadEditor().pipe(r.switchMapTo(n.zip(this.amaps.get(),this.get())),r.map((function(e){var n=s(e,2),r=n[0],i=n[1];return t.editor=t.ngZone.runOutsideAngular((function(){return new AMap.RectangleEditor(r,i)})),t.logger.d(it,"new RectangleEditor created."),t.editor$.next(t.editor),t.editor$.complete(),t.editor})))},t.prototype.toggleEditor=function(t){!t||this.editor?this.editor&&(t?this.editor.open():this.editor.close()):this.createEditor().subscribe((function(t){return t.open()}))},t.decorators=[{type:e.Injectable}],t.ctorParameters=function(){return[{type:h},{type:u},{type:e.NgZone},{type:y}]},t}();var st="amap-rectangle",at=a(G,["bounds"]),pt=function(t){function r(e,n,r,i){var o=t.call(this,e,n)||this;return o.os=e,o.binder=n,o.logger=r,o.ngZone=i,o.inited=!1,o}return o(r,t),r.prototype.ngOnDestroy=function(){this.os.destroy()},r.prototype.ngOnChanges=function(t){var e=this,r=f.of(t),i=this.get();if(this.inited)n.zip(r.has("path"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setPath(n)})),n.zip(r.has("options"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setOptions(n||{})})),n.zip(r.has("bounds"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setBounds(n)})),n.zip(r.has("extData"),i).subscribe((function(t){var e=s(t,2),n=e[0];return e[1].setExtData(n)}));else{this.logger.d(st,"initializing ...");var o=this.options||b(this,at);this.logger.d(st,"options:",o),this.os.create(o).subscribe((function(t){e.ngZone.run((function(){return e.naReady.emit(t)})),e.logger.d(st,"rectangle is ready.")})),this.inited=!0}n.zip(r.has("hidden"),i).subscribe((function(t){var e=s(t,2),n=e[0],r=e[1];return n?r.hide():r.show()})),r.has("editor").subscribe((function(t){return e.os.toggleEditor(t)}))},r.prototype.get=function(){return this.os.get()},r.decorators=[{type:e.Directive,args:[{selector:"amap-rectangle",exportAs:"rectangle",providers:[ot]}]}],r.ctorParameters=function(){return[{type:ot},{type:g},{type:u},{type:e.NgZone}]},r.propDecorators={bounds:[{type:e.Input}],options:[{type:e.Input}]},r}(q);var ut=["zIndex","center","bubble","cursor","radius","strokeColor","strokeOpacity","strokeWeight","fillColor","fillOpacity","strokeStyle","extData","strokeDasharray"],ct=function(t){function n(n,r){var i=t.call(this,n,r)||this;return i.os=n,i.binder=r,i.hidden=!1,i.editor=!1,i.naReady=new e.EventEmitter,i}return o(n,t),n.propDecorators={zIndex:[{type:e.Input}],center:[{type:e.Input}],radius:[{type:e.Input}],strokeColor:[{type:e.Input}],strokeOpacity:[{type:e.Input}],strokeWeight:[{type:e.Input}],fillColor:[{type:e.Input}],fillOpacity:[{type:e.Input}],strokeStyle:[{type:e.Input}],strokeDasharray:[{type:e.Input}],hidden:[{type:e.Input}],editor:[{type:e.Input}],options:[{type:e.Input}],naReady:[{type:e.Output}]},n}(S);var dt="AmapCircle",lt=function(){function t(t,e,r,i){this.amaps=t,this.logger=e,this.ngZone=r,this.plugins=i,this.circle$=new n.ReplaySubject(1),this.editor$=new n.ReplaySubject(1)}return t.prototype.get=function(){return this.circle$.asObservable()},t.prototype.create=function(t){var e=this;return this.amaps.get().pipe(r.map((function(n){return t.map=n,e.circle=e.ngZone.runOutsideAngular((function(){return new AMap.Circle(t)})),e.logger.d(dt,"new Circle created."),e.circle$.next(e.circle),e.circle$.complete(),e.circle})))},t.prototype.destroy=function(){var t=this;this.get().subscribe((function(e){e.setMap(null),t.logger.d(dt,"Circle destroyed."),t.circle=null}))},t.prototype.getEditor=function(){return this.editor$.asObservable()},t.prototype.loadEditor=function(){return this.plugins.load("AMap.CircleEditor")},t.prototype.createEditor=function(){var t=this;return this.loadEditor().pipe(r.switchMapTo(n.zip(this.amaps.get(),this.get())),r.map((function(e){var n=s(e,2),r=n[0],i=n[1];r