16 lines
5.0 KiB
JavaScript
16 lines
5.0 KiB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/core"),require("@angular/common")):"function"==typeof define&&define.amd?define("primeng/gmap",["exports","@angular/core","@angular/common"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).primeng=e.primeng||{},e.primeng.gmap={}),e.ng.core,e.ng.common)}(this,(function(e,t,n){"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.
|
|
***************************************************************************** */Object.create;function i(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}Object.create;var o=function(){function e(e,n,i,o){this.el=e,this.cd=i,this.zone=o,this.onMapClick=new t.EventEmitter,this.onOverlayClick=new t.EventEmitter,this.onOverlayDblClick=new t.EventEmitter,this.onOverlayDragStart=new t.EventEmitter,this.onOverlayDrag=new t.EventEmitter,this.onOverlayDragEnd=new t.EventEmitter,this.onMapReady=new t.EventEmitter,this.onMapDragEnd=new t.EventEmitter,this.onZoomChanged=new t.EventEmitter,this.differ=n.find([]).create(null)}return e.prototype.ngAfterViewChecked=function(){!this.map&&this.el.nativeElement.offsetParent&&this.initialize()},e.prototype.initialize=function(){var e,t,n=this;if(this.map=new google.maps.Map(this.el.nativeElement.children[0],this.options),this.onMapReady.emit({map:this.map}),this.overlays)try{for(var o=i(this.overlays),r=o.next();!r.done;r=o.next()){var a=r.value;a.setMap(this.map),this.bindOverlayEvents(a)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this.map.addListener("click",(function(e){n.zone.run((function(){n.onMapClick.emit(e)}))})),this.map.addListener("dragend",(function(e){n.zone.run((function(){n.onMapDragEnd.emit(e)}))})),this.map.addListener("zoom_changed",(function(e){n.zone.run((function(){n.onZoomChanged.emit(e)}))}))},e.prototype.bindOverlayEvents=function(e){var t=this;e.addListener("click",(function(n){t.zone.run((function(){t.onOverlayClick.emit({originalEvent:n,overlay:e,map:t.map})}))})),e.addListener("dblclick",(function(n){t.zone.run((function(){t.onOverlayDblClick.emit({originalEvent:n,overlay:e,map:t.map})}))})),e.getDraggable()&&this.bindDragEvents(e)},e.prototype.ngDoCheck=function(){var e=this,t=this.differ.diff(this.overlays);t&&this.map&&(t.forEachRemovedItem((function(e){google.maps.event.clearInstanceListeners(e.item),e.item.setMap(null)})),t.forEachAddedItem((function(t){t.item.setMap(e.map),t.item.addListener("click",(function(n){e.zone.run((function(){e.onOverlayClick.emit({originalEvent:n,overlay:t.item,map:e.map})}))})),t.item.getDraggable()&&e.bindDragEvents(t.item)})))},e.prototype.bindDragEvents=function(e){var t=this;e.addListener("dragstart",(function(n){t.zone.run((function(){t.onOverlayDragStart.emit({originalEvent:n,overlay:e,map:t.map})}))})),e.addListener("drag",(function(n){t.zone.run((function(){t.onOverlayDrag.emit({originalEvent:n,overlay:e,map:t.map})}))})),e.addListener("dragend",(function(n){t.zone.run((function(){t.onOverlayDragEnd.emit({originalEvent:n,overlay:e,map:t.map})}))}))},e.prototype.getMap=function(){return this.map},e}();o.decorators=[{type:t.Component,args:[{selector:"p-gmap",template:'<div [ngStyle]="style" [class]="styleClass"></div>',changeDetection:t.ChangeDetectionStrategy.OnPush,encapsulation:t.ViewEncapsulation.None}]}],o.ctorParameters=function(){return[{type:t.ElementRef},{type:t.IterableDiffers},{type:t.ChangeDetectorRef},{type:t.NgZone}]},o.propDecorators={style:[{type:t.Input}],styleClass:[{type:t.Input}],options:[{type:t.Input}],overlays:[{type:t.Input}],onMapClick:[{type:t.Output}],onOverlayClick:[{type:t.Output}],onOverlayDblClick:[{type:t.Output}],onOverlayDragStart:[{type:t.Output}],onOverlayDrag:[{type:t.Output}],onOverlayDragEnd:[{type:t.Output}],onMapReady:[{type:t.Output}],onMapDragEnd:[{type:t.Output}],onZoomChanged:[{type:t.Output}]};var r=function(){};r.decorators=[{type:t.NgModule,args:[{imports:[n.CommonModule],exports:[o],declarations:[o]}]}],e.GMap=o,e.GMapModule=r,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
//# sourceMappingURL=primeng-gmap.umd.min.js.map
|