@agm/core
Version:
Angular components for Google Maps
15 lines (13 loc) • 74.5 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("rxjs"),require("rxjs/operators"),require("@angular/common")):"function"==typeof define&&define.amd?define("@agm/core",["exports","@angular/core","rxjs","rxjs/operators","@angular/common"],e):e(((t=t||self).agm=t.agm||{},t.agm.core={}),t.ng.core,t.rxjs,t.rxjs.operators,t.ng.common)}(this,(function(t,e,n,r,i){"use strict";
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var o=function(t,e){return(o=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 s(t,e){function n(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function a(t,e,n,r){return new(n||(n=Promise))((function(i,o){function s(t){try{u(r.next(t))}catch(t){o(t)}}function a(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((r=r.apply(t,e||[])).next())}))}function u(t,e){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}Object.create;function p(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 c(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(p(arguments[e]));return t}Object.create;var l=function(){};l.decorators=[{type:e.Injectable}];var h=function(){function t(t,e){var n=this;this._loader=t,this._zone=e,this._map=new Promise((function(t){n._mapResolver=t}))}return t.prototype.createMap=function(t,e){var n=this;return this._zone.runOutsideAngular((function(){return n._loader.load().then((function(){var r=new google.maps.Map(t,e);n._mapResolver(r)}))}))},t.prototype.setMapOptions=function(t){var e=this;return this._zone.runOutsideAngular((function(){e._map.then((function(e){e.setOptions(t)}))}))},t.prototype.createMarker=function(t,e){var n=this;return void 0===t&&(t={}),void 0===e&&(e=!0),this._zone.runOutsideAngular((function(){return n._map.then((function(n){return e&&(t.map=n),new google.maps.Marker(t)}))}))},t.prototype.createInfoWindow=function(t){var e=this;return this._zone.runOutsideAngular((function(){return e._map.then((function(){return new google.maps.InfoWindow(t)}))}))},t.prototype.createCircle=function(t){var e=this;return this._zone.runOutsideAngular((function(){return e._map.then((function(e){return t.map=e,new google.maps.Circle(t)}))}))},t.prototype.createRectangle=function(t){var e=this;return this._zone.runOutsideAngular((function(){return e._map.then((function(e){return t.map=e,new google.maps.Rectangle(t)}))}))},t.prototype.createPolyline=function(t){var e=this;return this._zone.runOutsideAngular((function(){return e.getNativeMap().then((function(e){var n=new google.maps.Polyline(t);return n.setMap(e),n}))}))},t.prototype.createPolygon=function(t){var e=this;return this._zone.runOutsideAngular((function(){return e.getNativeMap().then((function(e){var n=new google.maps.Polygon(t);return n.setMap(e),n}))}))},t.prototype.createDataLayer=function(t){var e=this;return this._zone.runOutsideAngular((function(){return e._map.then((function(e){var n=new google.maps.Data(t);return n.setMap(e),n}))}))},t.prototype.createTransitLayer=function(){var t=this;return this._zone.runOutsideAngular((function(){return t._map.then((function(t){var e=new google.maps.TransitLayer;return e.setMap(t),e}))}))},t.prototype.createBicyclingLayer=function(){var t=this;return this._zone.runOutsideAngular((function(){return t._map.then((function(t){var e=new google.maps.BicyclingLayer;return e.setMap(t),e}))}))},t.prototype.containsLocation=function(t,e){return this._map.then((function(){return google.maps.geometry.poly.containsLocation(t,e)}))},t.prototype.subscribeToMapEvent=function(t){var e=this;return new n.Observable((function(n){e._map.then((function(r){return r.addListener(t,(function(){return e._zone.run((function(){return n.next(arguments[0])}))}))}))}))},t.prototype.clearInstanceListeners=function(){var t=this;return this._zone.runOutsideAngular((function(){t._map.then((function(t){google.maps.event.clearInstanceListeners(t)}))}))},t.prototype.setCenter=function(t){var e=this;return this._zone.runOutsideAngular((function(){return e._map.then((function(e){return e.setCenter(t)}))}))},t.prototype.getZoom=function(){var t=this;return this._zone.runOutsideAngular((function(){return t._map.then((function(t){return t.getZoom()}))}))},t.prototype.getBounds=function(){var t=this;return this._zone.runOutsideAngular((function(){return t._map.then((function(t){return t.getBounds()}))}))},t.prototype.getMapTypeId=function(){var t=this;return this._zone.runOutsideAngular((function(){return t._map.then((function(t){return t.getMapTypeId()}))}))},t.prototype.setZoom=function(t){var e=this;return this._zone.runOutsideAngular((function(){return e._map.then((function(e){return e.setZoom(t)}))}))},t.prototype.getCenter=function(){var t=this;return this._zone.runOutsideAngular((function(){return t._map.then((function(t){return t.getCenter()}))}))},t.prototype.panTo=function(t){var e=this;return this._zone.runOutsideAngular((function(){return e._map.then((function(e){return e.panTo(t)}))}))},t.prototype.panBy=function(t,e){var n=this;return this._zone.runOutsideAngular((function(){return n._map.then((function(n){return n.panBy(t,e)}))}))},t.prototype.fitBounds=function(t,e){var n=this;return this._zone.runOutsideAngular((function(){return n._map.then((function(n){return n.fitBounds(t,e)}))}))},t.prototype.panToBounds=function(t,e){var n=this;return this._zone.runOutsideAngular((function(){return n._map.then((function(n){return n.panToBounds(t,e)}))}))},t.prototype.getNativeMap=function(){return this._map},t.prototype.triggerMapEvent=function(t){return this._map.then((function(e){return google.maps.event.trigger(e,t)}))},t}();h.decorators=[{type:e.Injectable}],h.ctorParameters=function(){return[{type:l},{type:e.NgZone}]};var g=function(){function t(t,e){this._apiWrapper=t,this._zone=e,this._circles=new Map}return t.prototype.addCircle=function(t){var e=this;this._apiWrapper.getNativeMap().then((function(){return e._circles.set(t,e._apiWrapper.createCircle({center:{lat:t.latitude,lng:t.longitude},clickable:t.clickable,draggable:t.draggable,editable:t.editable,fillColor:t.fillColor,fillOpacity:t.fillOpacity,radius:t.radius,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokePosition:google.maps.StrokePosition[t.strokePosition],strokeWeight:t.strokeWeight,visible:t.visible,zIndex:t.zIndex}))}))},t.prototype.removeCircle=function(t){var e=this;return this._circles.get(t).then((function(n){n.setMap(null),e._circles.delete(t)}))},t.prototype.setOptions=function(t,e){return a(this,void 0,void 0,(function(){return u(this,(function(n){return[2,this._circles.get(t).then((function(t){var n=e.strokePosition;e.strokePosition=google.maps.StrokePosition[n],t.setOptions(e)}))]}))}))},t.prototype.getBounds=function(t){return this._circles.get(t).then((function(t){return t.getBounds()}))},t.prototype.getCenter=function(t){return this._circles.get(t).then((function(t){return t.getCenter()}))},t.prototype.getRadius=function(t){return this._circles.get(t).then((function(t){return t.getRadius()}))},t.prototype.setCenter=function(t){return this._circles.get(t).then((function(e){return e.setCenter({lat:t.latitude,lng:t.longitude})}))},t.prototype.setEditable=function(t){return this._circles.get(t).then((function(e){return e.setEditable(t.editable)}))},t.prototype.setDraggable=function(t){return this._circles.get(t).then((function(e){return e.setDraggable(t.draggable)}))},t.prototype.setVisible=function(t){return this._circles.get(t).then((function(e){return e.setVisible(t.visible)}))},t.prototype.setRadius=function(t){return this._circles.get(t).then((function(e){return e.setRadius(t.radius)}))},t.prototype.getNativeCircle=function(t){return this._circles.get(t)},t.prototype.createEventObservable=function(t,e){var r=this;return new n.Observable((function(n){var i=null;return r._circles.get(e).then((function(e){i=e.addListener(t,(function(t){return r._zone.run((function(){return n.next(t)}))}))})),function(){null!==i&&i.remove()}}))},t}();g.decorators=[{type:e.Injectable}],g.ctorParameters=function(){return[{type:h},{type:e.NgZone}]};var d=function(){function t(t,e){this._wrapper=t,this._zone=e,this._layers=new Map}return t.prototype.addDataLayer=function(t){var e=this,n=this._wrapper.createDataLayer({style:t.style}).then((function(n){return t.geoJson&&e.getDataFeatures(n,t.geoJson).then((function(t){return n.features=t})),n}));this._layers.set(t,n)},t.prototype.deleteDataLayer=function(t){var e=this;this._layers.get(t).then((function(n){n.setMap(null),e._layers.delete(t)}))},t.prototype.updateGeoJson=function(t,e){var n=this;this._layers.get(t).then((function(t){t.forEach((function(e){t.remove(e);var n=t.features.indexOf(e,0);n>-1&&t.features.splice(n,1)})),n.getDataFeatures(t,e).then((function(e){return t.features=e}))}))},t.prototype.setDataOptions=function(t,e){this._layers.get(t).then((function(t){t.setControlPosition(e.controlPosition),t.setControls(e.controls),t.setDrawingMode(e.drawingMode),t.setStyle(e.style)}))},t.prototype.createEventObservable=function(t,e){var r=this;return new n.Observable((function(n){r._layers.get(e).then((function(e){e.addListener(t,(function(t){return r._zone.run((function(){return n.next(t)}))}))}))}))},t.prototype.getDataFeatures=function(t,e){return new Promise((function(n,r){if("object"==typeof e)try{n(t.addGeoJson(e))}catch(t){r(t)}else"string"==typeof e?t.loadGeoJson(e,null,n):r("Impossible to extract features from geoJson: wrong argument type")}))},t}();d.decorators=[{type:e.Injectable}],d.ctorParameters=function(){return[{type:h},{type:e.NgZone}]};var f=function(){},y=function(){function t(t){var e=this;this._boundsChangeSampleTime$=new n.BehaviorSubject(200),this._includeInBounds$=new n.BehaviorSubject(new Map),this.bounds$=n.from(t.load()).pipe(r.flatMap((function(){return e._includeInBounds$})),r.sample(this._boundsChangeSampleTime$.pipe(r.switchMap((function(t){return n.timer(0,t)})))),r.map((function(t){return e._generateBounds(t)})),r.shareReplay(1))}return t.prototype._generateBounds=function(t){var e=new google.maps.LatLngBounds;return t.forEach((function(t){return e.extend(t)})),e},t.prototype.addToBounds=function(t){var e=this._createIdentifier(t);if(!this._includeInBounds$.value.has(e)){var n=this._includeInBounds$.value;n.set(e,t),this._includeInBounds$.next(n)}},t.prototype.removeFromBounds=function(t){var e=this._includeInBounds$.value;e.delete(this._createIdentifier(t)),this._includeInBounds$.next(e)},t.prototype.changeFitBoundsChangeSampleTime=function(t){this._boundsChangeSampleTime$.next(t)},t.prototype.getBounds$=function(){return this.bounds$},t.prototype._createIdentifier=function(t){return t.lat+"+"+t.lng},t}();y.decorators=[{type:e.Injectable}],y.ctorParameters=function(){return[{type:l}]};var m=function(){function t(t){var e=this,i=new n.Observable((function(e){t.load().then((function(){return e.next()}))})).pipe(r.map((function(){return e._createGeocoder()})),r.multicast(new n.ReplaySubject(1)));i.connect(),this.geocoder$=i}return t.prototype.geocode=function(t){var e=this;return this.geocoder$.pipe(r.switchMap((function(n){return e._getGoogleResults(n,t)})))},t.prototype._getGoogleResults=function(t,e){return n.bindCallback(t.geocode)(e).pipe(r.switchMap((function(t){var e=p(t,2),r=e[0],i=e[1];return i===google.maps.GeocoderStatus.OK?n.of(r):n.throwError(i)})))},t.prototype._createGeocoder=function(){return new google.maps.Geocoder},t}();m.ɵprov=e.ɵɵdefineInjectable({factory:function(){return new m(e.ɵɵinject(l))},token:m,providedIn:"root"}),m.decorators=[{type:e.Injectable,args:[{providedIn:"root"}]}],m.ctorParameters=function(){return[{type:l}]};var v,_=function(){function t(){}return t.prototype.getNativeWindow=function(){return window},t}(),b=function(){function t(){}return t.prototype.getNativeDocument=function(){return document},t}(),O=[_,b];(v=t.GoogleMapsScriptProtocol||(t.GoogleMapsScriptProtocol={}))[v.HTTP=1]="HTTP",v[v.HTTPS=2]="HTTPS",v[v.AUTO=3]="AUTO";var w=new e.InjectionToken("angular-google-maps LAZY_MAPS_API_CONFIG"),k=function(e){function n(t,n,r,i){void 0===t&&(t=null);var o=e.call(this)||this;return o.localeId=i,o._SCRIPT_ID="agmGoogleMapsApiScript",o.callbackName="agmLazyMapsAPILoader",o._config=t||{},o._windowRef=n,o._documentRef=r,o}return s(n,e),n.prototype.load=function(){var t=this._windowRef.getNativeWindow();if(t.google&&t.google.maps)return Promise.resolve();if(this._scriptLoadingPromise)return this._scriptLoadingPromise;var e=this._documentRef.getNativeDocument().getElementById(this._SCRIPT_ID);if(e)return this._assignScriptLoadingPromise(e),this._scriptLoadingPromise;var n=this._documentRef.getNativeDocument().createElement("script");return n.type="text/javascript",n.async=!0,n.defer=!0,n.id=this._SCRIPT_ID,n.src=this._getScriptSrc(this.callbackName),this._assignScriptLoadingPromise(n),this._documentRef.getNativeDocument().body.appendChild(n),this._scriptLoadingPromise},n.prototype._assignScriptLoadingPromise=function(t){var e=this;this._scriptLoadingPromise=new Promise((function(n,r){e._windowRef.getNativeWindow()[e.callbackName]=function(){n()},t.onerror=function(t){r(t)}}))},n.prototype._getScriptSrc=function(e){var n;switch(this._config&&this._config.protocol||t.GoogleMapsScriptProtocol.HTTPS){case t.GoogleMapsScriptProtocol.AUTO:n="";break;case t.GoogleMapsScriptProtocol.HTTP:n="http:";break;case t.GoogleMapsScriptProtocol.HTTPS:n="https:"}var r=this._config.hostAndPath||"maps.googleapis.com/maps/api/js",i={v:this._config.apiVersion||"quarterly",callback:e,key:this._config.apiKey,client:this._config.clientId,channel:this._config.channel,libraries:this._config.libraries,region:this._config.region,language:this._config.language||("en-US"!==this.localeId?this.localeId:null)};return n+"//"+r+"?"+Object.keys(i).filter((function(t){return null!=i[t]})).filter((function(t){return!Array.isArray(i[t])||Array.isArray(i[t])&&i[t].length>0})).map((function(t){var e=i[t];return Array.isArray(e)?{key:t,value:e.join(",")}:{key:t,value:i[t]}})).map((function(t){return t.key+"="+t.value})).join("&")},n}(l);k.decorators=[{type:e.Injectable}],k.ctorParameters=function(){return[{type:void 0,decorators:[{type:e.Optional},{type:e.Inject,args:[w]}]},{type:_},{type:b},{type:String,decorators:[{type:e.Inject,args:[e.LOCALE_ID]}]}]};var I=function(){function t(t,e){this._mapsWrapper=t,this._zone=e,this._markers=new Map}return t.prototype.convertAnimation=function(t){return a(this,void 0,void 0,(function(){return u(this,(function(e){return null===t?[2,null]:[2,this._mapsWrapper.getNativeMap().then((function(){return google.maps.Animation[t]}))]}))}))},t.prototype.deleteMarker=function(t){var e=this,n=this._markers.get(t);return null==n?Promise.resolve():n.then((function(n){return e._zone.run((function(){n.setMap(null),e._markers.delete(t)}))}))},t.prototype.updateMarkerPosition=function(t){return this._markers.get(t).then((function(e){return e.setPosition({lat:t.latitude,lng:t.longitude})}))},t.prototype.updateTitle=function(t){return this._markers.get(t).then((function(e){return e.setTitle(t.title)}))},t.prototype.updateLabel=function(t){return this._markers.get(t).then((function(e){e.setLabel(t.label)}))},t.prototype.updateDraggable=function(t){return this._markers.get(t).then((function(e){return e.setDraggable(t.draggable)}))},t.prototype.updateIcon=function(t){return this._markers.get(t).then((function(e){return e.setIcon(t.iconUrl)}))},t.prototype.updateOpacity=function(t){return this._markers.get(t).then((function(e){return e.setOpacity(t.opacity)}))},t.prototype.updateVisible=function(t){return this._markers.get(t).then((function(e){return e.setVisible(t.visible)}))},t.prototype.updateZIndex=function(t){return this._markers.get(t).then((function(e){return e.setZIndex(t.zIndex)}))},t.prototype.updateClickable=function(t){return this._markers.get(t).then((function(e){return e.setClickable(t.clickable)}))},t.prototype.updateAnimation=function(t){return a(this,void 0,void 0,(function(){var e,n,r;return u(this,(function(i){switch(i.label){case 0:return[4,this._markers.get(t)];case 1:return e=i.sent(),r=(n=e).setAnimation,[4,this.convertAnimation(t.animation)];case 2:return r.apply(n,[i.sent()]),[2]}}))}))},t.prototype.addMarker=function(t){var e=this,n=new Promise((function(n){return a(e,void 0,void 0,(function(){var e,r,i;return u(this,(function(o){switch(o.label){case 0:return r=(e=this._mapsWrapper).createMarker,i={position:{lat:t.latitude,lng:t.longitude},label:t.label,draggable:t.draggable,icon:t.iconUrl,opacity:t.opacity,visible:t.visible,zIndex:t.zIndex,title:t.title,clickable:t.clickable},[4,this.convertAnimation(t.animation)];case 1:return[2,r.apply(e,[(i.animation=o.sent(),i)]).then(n)]}}))}))}));this._markers.set(t,n)},t.prototype.getNativeMarker=function(t){return this._markers.get(t)},t.prototype.createEventObservable=function(t,e){var r=this;return new n.Observable((function(n){r._markers.get(e).then((function(e){return e.addListener(t,(function(t){return r._zone.run((function(){return n.next(t)}))}))}))}))},t}();I.decorators=[{type:e.Injectable}],I.ctorParameters=function(){return[{type:h},{type:e.NgZone}]};var E=function(){function t(t,e,n){this._mapsWrapper=t,this._zone=e,this._markerManager=n,this._infoWindows=new Map}return t.prototype.deleteInfoWindow=function(t){var e=this,n=this._infoWindows.get(t);return null==n?Promise.resolve():n.then((function(n){return e._zone.run((function(){n.close(),e._infoWindows.delete(t)}))}))},t.prototype.setPosition=function(t){return this._infoWindows.get(t).then((function(e){return e.setPosition({lat:t.latitude,lng:t.longitude})}))},t.prototype.setZIndex=function(t){return this._infoWindows.get(t).then((function(e){return e.setZIndex(t.zIndex)}))},t.prototype.open=function(t){var e=this;return this._infoWindows.get(t).then((function(n){return null!=t.hostMarker?e._markerManager.getNativeMarker(t.hostMarker).then((function(t){return e._mapsWrapper.getNativeMap().then((function(e){return n.open(e,t)}))})):e._mapsWrapper.getNativeMap().then((function(t){return n.open(t)}))}))},t.prototype.close=function(t){return this._infoWindows.get(t).then((function(t){return t.close()}))},t.prototype.setOptions=function(t,e){return this._infoWindows.get(t).then((function(t){return t.setOptions(e)}))},t.prototype.addInfoWindow=function(t){var e={content:t.content,maxWidth:t.maxWidth,zIndex:t.zIndex,disableAutoPan:t.disableAutoPan};"number"==typeof t.latitude&&"number"==typeof t.longitude&&(e.position={lat:t.latitude,lng:t.longitude});var n=this._mapsWrapper.createInfoWindow(e);this._infoWindows.set(t,n)},t.prototype.createEventObservable=function(t,e){var r=this;return new n.Observable((function(n){r._infoWindows.get(e).then((function(e){e.addListener(t,(function(t){return r._zone.run((function(){return n.next(t)}))}))}))}))},t}();E.decorators=[{type:e.Injectable}],E.ctorParameters=function(){return[{type:h},{type:e.NgZone},{type:I}]};var C=function(){function t(t,e){this._wrapper=t,this._zone=e,this._layers=new Map}return t.prototype.addKmlLayer=function(t){var e=this._wrapper.getNativeMap().then((function(e){return new google.maps.KmlLayer({clickable:t.clickable,map:e,preserveViewport:t.preserveViewport,screenOverlays:t.screenOverlays,suppressInfoWindows:t.suppressInfoWindows,url:t.url,zIndex:t.zIndex})}));this._layers.set(t,e)},t.prototype.setOptions=function(t,e){this._layers.get(t).then((function(t){return t.setOptions(e)}))},t.prototype.deleteKmlLayer=function(t){var e=this;this._layers.get(t).then((function(n){n.setMap(null),e._layers.delete(t)}))},t.prototype.createEventObservable=function(t,e){var r=this;return new n.Observable((function(n){r._layers.get(e).then((function(e){e.addListener(t,(function(t){return r._zone.run((function(){return n.next(t)}))}))}))}))},t}();C.decorators=[{type:e.Injectable}],C.ctorParameters=function(){return[{type:h},{type:e.NgZone}]};var M=function(){function t(t){this._wrapper=t,this._layers=new Map}return t.prototype.addTransitLayer=function(t){var e=this._wrapper.createTransitLayer();this._layers.set(t,e)},t.prototype.addBicyclingLayer=function(t){var e=this._wrapper.createBicyclingLayer();this._layers.set(t,e)},t.prototype.deleteLayer=function(t){var e=this;return this._layers.get(t).then((function(n){n.setMap(null),e._layers.delete(t)}))},t}();M.decorators=[{type:e.Injectable}],M.ctorParameters=function(){return[{type:h}]};var P=function(){function t(){}return t.prototype.load=function(){if(!window.google||!window.google.maps)throw new Error("Google Maps API not loaded on page. Make sure window.google.maps is available!");return Promise.resolve()},t}();function D(t){var e=["insert_at","remove_at","set_at"];return n.fromEventPattern((function(n){return e.map((function(e){return t.addListener(e,(function(r,i){return n.apply(t,[{newArr:t.getArray(),eventName:e,index:r,previous:i}])}))}))}),(function(t,e){return e.forEach((function(t){return t.remove()}))}))}!function(){function t(){this.vals=[],this.listeners={remove_at:[],insert_at:[],set_at:[]}}t.prototype.clear=function(){for(var t=this.vals.length-1;t>=0;t--)this.removeAt(t)},t.prototype.getArray=function(){return c(this.vals)},t.prototype.getAt=function(t){return this.vals[t]},t.prototype.getLength=function(){return this.vals.length},t.prototype.insertAt=function(t,e){this.vals.splice(t,0,e),this.listeners.insert_at.forEach((function(e){return e(t)}))},t.prototype.pop=function(){var t=this,e=this.vals.pop();return this.listeners.remove_at.forEach((function(n){return n(t.vals.length,e)})),e},t.prototype.push=function(t){var e=this;return this.vals.push(t),this.listeners.insert_at.forEach((function(t){return t(e.vals.length-1)})),this.vals.length},t.prototype.removeAt=function(t){var e=this.vals.splice(t,1)[0];return this.listeners.remove_at.forEach((function(n){return n(t,e)})),e},t.prototype.setAt=function(t,e){var n=this.vals[t];this.vals[t]=e,this.listeners.set_at.forEach((function(e){return e(t,n)}))},t.prototype.forEach=function(t){this.vals.forEach(t)},t.prototype.addListener=function(t,e){var n=this.listeners[t];return n.push(e),{remove:function(){n.splice(n.indexOf(e),1)}}},t.prototype.bindTo=function(){throw new Error("Not implemented")},t.prototype.changed=function(){throw new Error("Not implemented")},t.prototype.get=function(){throw new Error("Not implemented")},t.prototype.notify=function(){throw new Error("Not implemented")},t.prototype.set=function(){throw new Error("Not implemented")},t.prototype.setValues=function(){throw new Error("Not implemented")},t.prototype.unbind=function(){throw new Error("Not implemented")},t.prototype.unbindAll=function(){throw new Error("Not implemented")}}();var A=function(){function t(t,e){this._mapsWrapper=t,this._zone=e,this._polygons=new Map}return t.prototype.addPolygon=function(t){var e=this._mapsWrapper.createPolygon({clickable:t.clickable,draggable:t.draggable,editable:t.editable,fillColor:t.fillColor,fillOpacity:t.fillOpacity,geodesic:t.geodesic,paths:t.paths,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokeWeight:t.strokeWeight,visible:t.visible,zIndex:t.zIndex});this._polygons.set(t,e)},t.prototype.updatePolygon=function(t){var e=this,n=this._polygons.get(t);return null==n?Promise.resolve():n.then((function(n){return e._zone.run((function(){n.setPaths(t.paths)}))}))},t.prototype.setPolygonOptions=function(t,e){return this._polygons.get(t).then((function(t){t.setOptions(e)}))},t.prototype.deletePolygon=function(t){var e=this,n=this._polygons.get(t);return null==n?Promise.resolve():n.then((function(n){return e._zone.run((function(){n.setMap(null),e._polygons.delete(t)}))}))},t.prototype.getPath=function(t){return this._polygons.get(t).then((function(t){return t.getPath().getArray()}))},t.prototype.getPaths=function(t){return this._polygons.get(t).then((function(t){return t.getPaths().getArray().map((function(t){return t.getArray()}))}))},t.prototype.createEventObservable=function(t,e){var r=this;return new n.Observable((function(n){r._polygons.get(e).then((function(e){e.addListener(t,(function(t){return r._zone.run((function(){return n.next(t)}))}))}))}))},t.prototype.createPathEventObservable=function(t){return a(this,void 0,void 0,(function(){var e,i;return u(this,(function(o){switch(o.label){case 0:return[4,this._polygons.get(t)];case 1:return e=o.sent(),i=e.getPaths(),[2,D(i).pipe(r.startWith({newArr:i.getArray()}),r.switchMap((function(t){return n.merge.apply(void 0,c(t.newArr.map((function(e,n){return D(e).pipe(r.map((function(e){return{parentMVEvent:t,chMVCEvent:e,pathIndex:n}})))})))).pipe(r.startWith({parentMVEvent:t,chMVCEvent:null,pathIndex:null}))})),r.skip(1),r.map((function(t){var e,n=t.parentMVEvent,r=t.chMVCEvent,i=t.pathIndex;return r?(e={newArr:n.newArr.map((function(t){return t.getArray().map((function(t){return t.toJSON()}))})),pathIndex:i,eventName:r.eventName,index:r.index},r.previous&&(e.previous=r.previous)):(e={newArr:n.newArr.map((function(t){return t.getArray().map((function(t){return t.toJSON()}))})),eventName:n.eventName,index:n.index},n.previous&&(e.previous=n.previous.getArray())),e})))]}}))}))},t}();A.decorators=[{type:e.Injectable}],A.ctorParameters=function(){return[{type:h},{type:e.NgZone}]};var S=function(){function t(t,e){this._mapsWrapper=t,this._zone=e,this._polylines=new Map}return t._convertPoints=function(t){return t._getPoints().map((function(t){return{lat:t.latitude,lng:t.longitude}}))},t._convertPath=function(t){var e=google.maps.SymbolPath[t];return"number"==typeof e?e:t},t._convertIcons=function(e){var n=e._getIcons().map((function(e){return{fixedRotation:e.fixedRotation,offset:e.offset,repeat:e.repeat,icon:{anchor:new google.maps.Point(e.anchorX,e.anchorY),fillColor:e.fillColor,fillOpacity:e.fillOpacity,path:t._convertPath(e.path),rotation:e.rotation,scale:e.scale,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight}}}));return n.forEach((function(t){Object.entries(t).forEach((function(e){var n=p(e,2),r=n[0];void 0===n[1]&&delete t[r]})),void 0!==t.icon.anchor.x&&void 0!==t.icon.anchor.y||delete t.icon.anchor})),n},t.prototype.addPolyline=function(e){var n=this,r=this._mapsWrapper.getNativeMap().then((function(){return[t._convertPoints(e),t._convertIcons(e)]})).then((function(t){var r=p(t,2),i=r[0],o=r[1];return n._mapsWrapper.createPolyline({clickable:e.clickable,draggable:e.draggable,editable:e.editable,geodesic:e.geodesic,strokeColor:e.strokeColor,strokeOpacity:e.strokeOpacity,strokeWeight:e.strokeWeight,visible:e.visible,zIndex:e.zIndex,path:i,icons:o})}));this._polylines.set(e,r)},t.prototype.updatePolylinePoints=function(e){var n=this,r=t._convertPoints(e),i=this._polylines.get(e);return null==i?Promise.resolve():i.then((function(t){return n._zone.run((function(){return t.setPath(r)}))}))},t.prototype.updateIconSequences=function(e){return a(this,void 0,void 0,(function(){var n,r,i=this;return u(this,(function(o){switch(o.label){case 0:return[4,this._mapsWrapper.getNativeMap()];case 1:return o.sent(),n=t._convertIcons(e),null==(r=this._polylines.get(e))?[2]:[2,r.then((function(t){return i._zone.run((function(){return t.setOptions({icons:n})}))}))]}}))}))},t.prototype.setPolylineOptions=function(t,e){return this._polylines.get(t).then((function(t){t.setOptions(e)}))},t.prototype.deletePolyline=function(t){var e=this,n=this._polylines.get(t);return null==n?Promise.resolve():n.then((function(n){return e._zone.run((function(){n.setMap(null),e._polylines.delete(t)}))}))},t.prototype.getMVCPath=function(t){return a(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,this._polylines.get(t)];case 1:return[2,e.sent().getPath()]}}))}))},t.prototype.getPath=function(t){return a(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,this.getMVCPath(t)];case 1:return[2,e.sent().getArray()]}}))}))},t.prototype.createEventObservable=function(t,e){var r=this;return new n.Observable((function(n){r._polylines.get(e).then((function(e){e.addListener(t,(function(t){return r._zone.run((function(){return n.next(t)}))}))}))}))},t.prototype.createPathEventObservable=function(t){return a(this,void 0,void 0,(function(){return u(this,(function(e){switch(e.label){case 0:return[4,this.getMVCPath(t)];case 1:return[2,D(e.sent())]}}))}))},t}();S.decorators=[{type:e.Injectable}],S.ctorParameters=function(){return[{type:h},{type:e.NgZone}]};var W=function(){function t(t,e){this._apiWrapper=t,this._zone=e,this._rectangles=new Map}return t.prototype.addRectangle=function(t){var e=this;this._apiWrapper.getNativeMap().then((function(){return e._rectangles.set(t,e._apiWrapper.createRectangle({bounds:{north:t.north,east:t.east,south:t.south,west:t.west},clickable:t.clickable,draggable:t.draggable,editable:t.editable,fillColor:t.fillColor,fillOpacity:t.fillOpacity,strokeColor:t.strokeColor,strokeOpacity:t.strokeOpacity,strokePosition:google.maps.StrokePosition[t.strokePosition],strokeWeight:t.strokeWeight,visible:t.visible,zIndex:t.zIndex}))}))},t.prototype.removeRectangle=function(t){var e=this;return this._rectangles.get(t).then((function(n){n.setMap(null),e._rectangles.delete(t)}))},t.prototype.setOptions=function(t,e){return this._rectangles.get(t).then((function(t){var n=e.strokePosition;e.strokePosition=google.maps.StrokePosition[n],t.setOptions(e)}))},t.prototype.getBounds=function(t){return this._rectangles.get(t).then((function(t){return t.getBounds()}))},t.prototype.setBounds=function(t){return this._rectangles.get(t).then((function(e){return e.setBounds({north:t.north,east:t.east,south:t.south,west:t.west})}))},t.prototype.setEditable=function(t){return this._rectangles.get(t).then((function(e){return e.setEditable(t.editable)}))},t.prototype.setDraggable=function(t){return this._rectangles.get(t).then((function(e){return e.setDraggable(t.draggable)}))},t.prototype.setVisible=function(t){return this._rectangles.get(t).then((function(e){return e.setVisible(t.visible)}))},t.prototype.createEventObservable=function(t,e){var r=this;return new n.Observable((function(n){var i=null;return r._rectangles.get(e).then((function(e){i=e.addListener(t,(function(t){return r._zone.run((function(){return n.next(t)}))}))})),function(){null!==i&&i.remove()}}))},t}();W.decorators=[{type:e.Injectable}],W.ctorParameters=function(){return[{type:h},{type:e.NgZone}]};var L=0,T=function(){function t(t){this._manager=t,this._addedToManager=!1,this._id=(L++).toString(),this.visible=!0}return t.prototype.ngOnInit=function(){this._addedToManager||(this._manager.addBicyclingLayer(this),this._addedToManager=!0)},t.prototype.id=function(){return this._id},t.prototype.toString=function(){return"AgmBicyclingLayer-"+this._id.toString()},t.prototype.ngOnDestroy=function(){this._manager.deleteLayer(this)},t}();T.decorators=[{type:e.Directive,args:[{selector:"agm-bicycling-layer"}]}],T.ctorParameters=function(){return[{type:M}]},T.propDecorators={visible:[{type:e.Input}]};var B=function(){function t(t){this._manager=t,this.clickable=!0,this.draggable=!1,this.editable=!1,this.radius=0,this.strokePosition="CENTER",this.strokeWeight=0,this.visible=!0,this.centerChange=new e.EventEmitter,this.circleClick=new e.EventEmitter,this.circleDblClick=new e.EventEmitter,this.drag=new e.EventEmitter,this.dragEnd=new e.EventEmitter,this.dragStart=new e.EventEmitter,this.mouseDown=new e.EventEmitter,this.mouseMove=new e.EventEmitter,this.mouseOut=new e.EventEmitter,this.mouseOver=new e.EventEmitter,this.mouseUp=new e.EventEmitter,this.radiusChange=new e.EventEmitter,this.rightClick=new e.EventEmitter,this._circleAddedToManager=!1,this._eventSubscriptions=[]}return t.prototype.ngOnInit=function(){this._manager.addCircle(this),this._circleAddedToManager=!0,this._registerEventListeners()},t.prototype.ngOnChanges=function(t){this._circleAddedToManager&&((t.latitude||t.longitude)&&this._manager.setCenter(this),t.editable&&this._manager.setEditable(this),t.draggable&&this._manager.setDraggable(this),t.visible&&this._manager.setVisible(this),t.radius&&this._manager.setRadius(this),this._updateCircleOptionsChanges(t))},t.prototype._updateCircleOptionsChanges=function(e){var n={},r=Object.keys(e).filter((function(e){return-1!==t._mapOptions.indexOf(e)}));r.forEach((function(t){n[t]=e[t].currentValue})),r.length>0&&this._manager.setOptions(this,n)},t.prototype._registerEventListeners=function(){var t=this,e=new Map;e.set("center_changed",this.centerChange),e.set("click",this.circleClick),e.set("dblclick",this.circleDblClick),e.set("drag",this.drag),e.set("dragend",this.dragEnd),e.set("dragstart",this.dragStart),e.set("mousedown",this.mouseDown),e.set("mousemove",this.mouseMove),e.set("mouseout",this.mouseOut),e.set("mouseover",this.mouseOver),e.set("mouseup",this.mouseUp),e.set("radius_changed",this.radiusChange),e.set("rightclick",this.rightClick),e.forEach((function(e,n){t._eventSubscriptions.push(t._manager.createEventObservable(n,t).subscribe((function(r){switch(n){case"radius_changed":t._manager.getRadius(t).then((function(t){return e.emit(t)}));break;case"center_changed":t._manager.getCenter(t).then((function(t){return e.emit({lat:t.lat(),lng:t.lng()})}));break;default:e.emit(r)}})))}))},t.prototype.ngOnDestroy=function(){this._eventSubscriptions.forEach((function(t){return t.unsubscribe()})),this._eventSubscriptions=null,this._manager.removeCircle(this)},t.prototype.getBounds=function(){return this._manager.getBounds(this)},t.prototype.getCenter=function(){return this._manager.getCenter(this)},t}();B._mapOptions=["fillColor","fillOpacity","strokeColor","strokeOpacity","strokePosition","strokeWeight","visible","zIndex","clickable"],B.decorators=[{type:e.Directive,args:[{selector:"agm-circle"}]}],B.ctorParameters=function(){return[{type:g}]},B.propDecorators={latitude:[{type:e.Input}],longitude:[{type:e.Input}],clickable:[{type:e.Input}],draggable:[{type:e.Input,args:["circleDraggable"]}],editable:[{type:e.Input}],fillColor:[{type:e.Input}],fillOpacity:[{type:e.Input}],radius:[{type:e.Input}],strokeColor:[{type:e.Input}],strokeOpacity:[{type:e.Input}],strokePosition:[{type:e.Input}],strokeWeight:[{type:e.Input}],visible:[{type:e.Input}],zIndex:[{type:e.Input}],centerChange:[{type:e.Output}],circleClick:[{type:e.Output}],circleDblClick:[{type:e.Output}],drag:[{type:e.Output}],dragEnd:[{type:e.Output}],dragStart:[{type:e.Output}],mouseDown:[{type:e.Output}],mouseMove:[{type:e.Output}],mouseOut:[{type:e.Output}],mouseOver:[{type:e.Output}],mouseUp:[{type:e.Output}],radiusChange:[{type:e.Output}],rightClick:[{type:e.Output}]};var x=0,z=function(){function t(t){this._manager=t,this._addedToManager=!1,this._id=(x++).toString(),this._subscriptions=[],this.layerClick=new e.EventEmitter,this.geoJson=null}return t.prototype.ngOnInit=function(){this._addedToManager||(this._manager.addDataLayer(this),this._addedToManager=!0,this._addEventListeners())},t.prototype._addEventListeners=function(){var t=this;[{name:"click",handler:function(e){return t.layerClick.emit(e)}}].forEach((function(e){var n=t._manager.createEventObservable(e.name,t).subscribe(e.handler);t._subscriptions.push(n)}))},t.prototype.id=function(){return this._id},t.prototype.toString=function(){return"AgmDataLayer-"+this._id.toString()},t.prototype.ngOnDestroy=function(){this._manager.deleteDataLayer(this),this._subscriptions.forEach((function(t){return t.unsubscribe()}))},t.prototype.ngOnChanges=function(e){var n=this;if(this._addedToManager){var r=e.geoJson;r&&this._manager.updateGeoJson(this,r.currentValue);var i=t._dataOptionsAttributes.reduce((function(t,r){return t[r]=e.hasOwnProperty(r)?e[r].currentValue:n[r]}),{});this._manager.setDataOptions(this,i)}},t}();z._dataOptionsAttributes=["style"],z.decorators=[{type:e.Directive,args:[{selector:"agm-data-layer"}]}],z.ctorParameters=function(){return[{type:d}]},z.propDecorators={layerClick:[{type:e.Output}],geoJson:[{type:e.Input}],style:[{type:e.Input}]};var R=function(){function t(t,e){this._fitBoundsAccessor=t,this._fitBoundsService=e,this.agmFitBounds=!0,this._destroyed$=new n.Subject,this._latestFitBoundsDetails=null}return t.prototype.ngOnChanges=function(){this._updateBounds()},t.prototype.ngOnInit=function(){var t=this;this._fitBoundsAccessor.getFitBoundsDetails$().pipe(r.distinctUntilChanged((function(t,e){return t.latLng.lat===e.latLng.lat&&t.latLng.lng===e.latLng.lng})),r.takeUntil(this._destroyed$)).subscribe((function(e){return t._updateBounds(e)}))},t.prototype._updateBounds=function(t){this._latestFitBoundsDetails&&this._fitBoundsService.removeFromBounds(this._latestFitBoundsDetails.latLng),t&&(this._latestFitBoundsDetails=t),this._latestFitBoundsDetails&&!0===this.agmFitBounds&&this._fitBoundsService.addToBounds(this._latestFitBoundsDetails.latLng)},t.prototype.ngOnDestroy=function(){this._destroyed$.next(),this._destroyed$.complete(),null!==this._latestFitBoundsDetails&&this._fitBoundsService.removeFromBounds(this._latestFitBoundsDetails.latLng)},t}();R.decorators=[{type:e.Directive,args:[{selector:"[agmFitBounds]"}]}],R.ctorParameters=function(){return[{type:f,decorators:[{type:e.Self}]},{type:y}]},R.propDecorators={agmFitBounds:[{type:e.Input}]};var N=0,j=function(){function t(t,n){this._infoWindowManager=t,this._el=n,this.isOpen=!1,this.infoWindowClose=new e.EventEmitter,this._infoWindowAddedToManager=!1,this._id=(N++).toString()}return t.prototype.ngOnInit=function(){this.content=this._el.nativeElement.querySelector(".agm-info-window-content"),this._infoWindowManager.addInfoWindow(this),this._infoWindowAddedToManager=!0,this._updateOpenState(),this._registerEventListeners()},t.prototype.ngOnChanges=function(t){this._infoWindowAddedToManager&&((t.latitude||t.longitude)&&"number"==typeof this.latitude&&"number"==typeof this.longitude&&this._infoWindowManager.setPosition(this),t.zIndex&&this._infoWindowManager.setZIndex(this),t.isOpen&&this._updateOpenState(),this._setInfoWindowOptions(t))},t.prototype._registerEventListeners=function(){var t=this;this._infoWindowManager.createEventObservable("closeclick",this).subscribe((function(){t.isOpen=!1,t.infoWindowClose.emit()}))},t.prototype._updateOpenState=function(){this.isOpen?this.open():this.close()},t.prototype._setInfoWindowOptions=function(e){var n={};Object.keys(e).filter((function(e){return-1!==t._infoWindowOptionsInputs.indexOf(e)})).forEach((function(t){n[t]=e[t].currentValue})),this._infoWindowManager.setOptions(this,n)},t.prototype.open=function(){return this._infoWindowManager.open(this)},t.prototype.close=function(){var t=this;return this._infoWindowManager.close(this).then((function(){t.infoWindowClose.emit()}))},t.prototype.id=function(){return this._id},t.prototype.toString=function(){return"AgmInfoWindow-"+this._id.toString()},t.prototype.ngOnDestroy=function(){this._infoWindowManager.deleteInfoWindow(this)},t}();j._infoWindowOptionsInputs=["disableAutoPan","maxWidth"],j.decorators=[{type:e.Component,args:[{selector:"agm-info-window",template:"<div class='agm-info-window-content'>\n <ng-content></ng-content>\n </div>\n "}]}],j.ctorParameters=function(){return[{type:E},{type:e.ElementRef}]},j.propDecorators={latitude:[{type:e.Input}],longitude:[{type:e.Input}],disableAutoPan:[{type:e.Input}],zIndex:[{type:e.Input}],maxWidth:[{type:e.Input}],isOpen:[{type:e.Input}],infoWindowClose:[{type:e.Output}]};var V=0,Z=function(){function t(t){this._manager=t,this._addedToManager=!1,this._id=(V++).toString(),this._subscriptions=[],this.clickable=!0,this.preserveViewport=!1,this.screenOverlays=!0,this.suppressInfoWindows=!1,this.url=null,this.zIndex=null,this.layerClick=new e.EventEmitter,this.defaultViewportChange=new e.EventEmitter,this.statusChange=new e.EventEmitter}return t.prototype.ngOnInit=function(){this._addedToManager||(this._manager.addKmlLayer(this),this._addedToManager=!0,this._addEventListeners())},t.prototype.ngOnChanges=function(t){this._addedToManager&&this._updatePolygonOptions(t)},t.prototype._updatePolygonOptions=function(e){var n=Object.keys(e).filter((function(e){return-1!==t._kmlLayerOptions.indexOf(e)})).reduce((function(t,n){return t[n]=e[n].currentValue,t}),{});Object.keys(n).length>0&&this._manager.setOptions(this,n)},t.prototype._addEventListeners=function(){var t=this;[{name:"click",handler:function(e){return t.layerClick.emit(e)}},{name:"defaultviewport_changed",handler:function(){return t.defaultViewportChange.emit()}},{name:"status_changed",handler:function(){return t.statusChange.emit()}}].forEach((function(e){var n=t._manager.createEventObservable(e.name,t).subscribe(e.handler);t._subscriptions.push(n)}))},t.prototype.id=function(){return this._id},t.prototype.toString=function(){return"AgmKmlLayer-"+this._id.toString()},t.prototype.ngOnDestroy=function(){this._manager.deleteKmlLayer(this),this._subscriptions.forEach((function(t){return t.unsubscribe()}))},t}();Z._kmlLayerOptions=["clickable","preserveViewport","screenOverlays","suppressInfoWindows","url","zIndex"],Z.decorators=[{type:e.Directive,args:[{selector:"agm-kml-layer"}]}],Z.ctorParameters=function(){return[{type:C}]},Z.propDecorators={clickable:[{type:e.Input}],preserveViewport:[{type:e.Input}],screenOverlays:[{type:e.Input}],suppressInfoWindows:[{type:e.Input}],url:[{type:e.Input}],zIndex:[{type:e.Input}],layerClick:[{type:e.Output}],defaultViewportChange:[{type:e.Output}],statusChange:[{type:e.Output}]};var U=function(){};U.decorators=[{type:e.Directive}],U.propDecorators={position:[{type:e.Input}]};var F=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.getOptions=function(){return{fullscreenControl:!0,fullscreenControlOptions:{position:this.position&&google.maps.ControlPosition[this.position]}}},e}(U);F.decorators=[{type:e.Directive,args:[{selector:"agm-map agm-fullscreen-control",providers:[{provide:U,useExisting:F}]}]}];var $=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.getOptions=function(){return{mapTypeControl:!0,mapTypeControlOptions:{position:this.position&&google.maps.ControlPosition[this.position],style:this.style&&google.maps.MapTypeControlStyle[this.style],mapTypeIds:this.mapTypeIds&&this.mapTypeIds.map((function(t){return google.maps.MapTypeId[t]}))}}},e}(U);$.decorators=[{type:e.Directive,args:[{selector:"agm-map agm-map-type-control",providers:[{provide:U,useExisting:$}]}]}],$.propDecorators={mapTypeIds:[{type:e.Input}],style:[{type:e.Input}]};var G=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.getOptions=function(){return{panControl:!0,panControlOptions:{position:this.position&&google.maps.ControlPosition[this.position]}}},e}(U);G.decorators=[{type:e.Directive,args:[{selector:"agm-map agm-pan-control",providers:[{provide:U,useExisting:G}]}]}];var q=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.getOptions=function(){return{rotateControl:!0,rotateControlOptions:{position:this.position&&google.maps.ControlPosition[this.position]}}},e}(U);q.decorators=[{type:e.Directive,args:[{selector:"agm-map agm-rotate-control",providers:[{provide:U,useExisting:q}]}]}];var H=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.getOptions=function(){return{scaleControl:!0}},e}(U);H.decorators=[{type:e.Directive,args:[{selector:"agm-map agm-scale-control",providers:[{provide:U,useExisting:H}]}]}];var J=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.getOptions=function(){return{streetViewControl:!0,streetViewControlOptions:{position:this.position&&google.maps.ControlPosition[this.position]}}},e}(U);J.decorators=[{type:e.Directive,args:[{selector:"agm-map agm-street-view-control",providers:[{provide:U,useExisting:J}]}]}];var K=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return s(e,t),e.prototype.getOptions=function(){return{zoomControl:!0,zoomControlOptions:{position:this.position&&google.maps.ControlPosition[this.position],style:this.style&&google.maps.ZoomControlStyle[this.style]}}},e}(U);K.decorators=[{type:e.Directive,args:[{selector:"agm-map agm-zoom-control",providers:[{provide:U,useExisting:K}]}]}],K.propDecorators={style:[{type:e.Input}]};var Y=function(){function t(t,n,r,i,o){this._elem=t,this._mapsWrapper=n,this._platformId=r,this._fitBoundsService=i,this._zone=o,this.longitude=0,this.latitude=0,this.zoom=8,this.draggable=!0,this.disableDoubleClickZoom=!1,this.disableDefaultUI=!1,this.scrollwheel=!0,this.keyboardShortcuts=!0,this.styles=[],this.usePanning=!1,this.fitBounds=!1,this.mapTypeId="ROADMAP",this.clickableIcons=!0,this.showDefaultInfoWindow=!0,this.gestureHandling="auto",this.tilt=0,this._observableSubscriptions=[],this.mapClick=new e.EventEmitter,this.mapRightClick=new e.EventEmitter,this.mapDblClick=new e.EventEmitter,this.centerChange=new e.EventEmitter,this.boundsChange=new e.EventEmitter,this.mapTypeIdChange=new e.EventEmitter,this.idle=new e.EventEmitter,this.zoomChange=new e.EventEmitter,this.mapReady=new e.EventEmitter,this.tilesLoaded=new e.EventEmitter}return t.prototype.ngAfterContentInit=function(){if(!i.isPlatformServer(this._platformId)){var t=this._elem.nativeElement.querySelector(".agm-map-container-inner");this._initMapInstance(t)}},t.prototype._initMapInstance=function(t){var e=this;this._mapsWrapper.createMap(t,{center:{lat:this.latitude||0,lng:this.longitude||0},zoom:this.zoom,minZoom:this.minZoom,maxZoom:this.maxZoom,controlSize:this.controlSize,disableDefaultUI:this.disableDefaultUI,disableDoubleClickZoom:this.disableDoubleClickZoom,scrollwheel:this.scrollwheel,backgroundColor:this.backgroundColor,draggable:this.draggable,draggableCursor:this.draggableCursor,draggingCursor:this.draggingCursor,keyboardShortcuts:this.keyboardShortcuts,styles:this.styles,mapTypeId:this.mapTypeId.toLocaleLowerCase(),clickableIcons:this.clickableIcons,gestureHandling:this.gestureHandling,tilt:this.tilt,restriction:this.restriction}).then((function(){return e._mapsWrapper.getNativeMap()})).then((function(t){return e.mapReady.emit(t)})),this._handleMapCenterChange(),this._handleMapZoomChange(),this._handleMapMouseEvents(),this._handleBoundsChange(),this._handleMapTypeIdChange(),this._handleTilesLoadedEvent(),this._handleIdleEvent(),this._handleControlChange()},t.prototype.ngOnDestroy=function(){this._observableSubscriptions.forEach((function(t){return t.unsubscribe()})),this._mapsWrapper.clearInstanceListeners(),this._fitBoundsSubscription&&this._fitBoundsSubscription.unsubscribe()},t.prototype.ngOnChanges=function(t){this._updateMapOptionsChanges(t),this._updatePosition(t)},t.prototype._updateMapOptionsChanges=function(e){var n={};Object.keys(e).filter((function(e){return-1!==t._mapOptionsAttributes.indexOf(e)})).forEach((function(t){n[t]=e[t].currentValue})),this._mapsWrapper.setMapOptions(n)},t.prototype.triggerResize=function(t){var e=this;return void 0===t&&(t=!0),new Promise((function(n){setTimeout((function(){return e._mapsWrapper.triggerMapEvent("resize").then((function(){t&&(null!=e.fitBounds?e._fitBounds():e._setCenter()),n()}))}))}))},t.prototype._updatePosition=function(t){(null!=t.latitude||null!=t.longitude||t.fitBounds)&&("fitBounds"in t?this._fitBounds():"number"==typeof this.latitude&&"number"==typeof this.longitude&&this._setCenter())},t.prototype._setCenter=function(){var t={lat:this.latitude,lng:this.longitude};this.usePanning?this._mapsWrapper.panTo(t):this._mapsWrapper.setCenter(t)},t.prototype._fitBounds=function(){switch(this.fitBounds){case!0:this._subscribeToFitBoundsUpdates();break;case!1:this._fitBoundsSubscription&&this._fitBoundsSubscription.unsubscribe();break;default:this._fitBoundsSubscription&&this._fitBoundsSubscription.unsubscribe(),this._updateBounds(this.fitBou