| 56 | encapsulation: ViewEncapsulation.None, |
| 57 | }) |
| 58 | export class GoogleMap implements OnChanges, OnInit, OnDestroy { |
| 59 | private readonly _elementRef = inject(ElementRef); |
| 60 | private _ngZone = inject(NgZone); |
| 61 | private _eventManager = new MapEventManager(inject(NgZone)); |
| 62 | private _mapEl!: HTMLElement; |
| 63 | private _existingAuthFailureCallback!: GoogleMapsWindow['gm_authFailure']; |
| 64 | |
| 65 | /** |
| 66 | * The underlying google.maps.Map object |
| 67 | * |
| 68 | * See developers.google.com/maps/documentation/javascript/reference/map#Map |
| 69 | */ |
| 70 | googleMap?: google.maps.Map; |
| 71 | |
| 72 | /** Whether we're currently rendering inside a browser. */ |
| 73 | _isBrowser: boolean; |
| 74 | |
| 75 | /** Height of the map. Set this to `null` if you'd like to control the height through CSS. */ |
| 76 | @Input() height: string | number | null = DEFAULT_HEIGHT; |
| 77 | |
| 78 | /** Width of the map. Set this to `null` if you'd like to control the width through CSS. */ |
| 79 | @Input() width: string | number | null = DEFAULT_WIDTH; |
| 80 | |
| 81 | /** |
| 82 | * The Map ID of the map. This parameter cannot be set or changed after a map is instantiated. |
| 83 | * See: https://developers.google.com/maps/documentation/javascript/reference/map#MapOptions.mapId |
| 84 | */ |
| 85 | @Input() mapId: string | undefined; |
| 86 | |
| 87 | /** |
| 88 | * Type of map that should be rendered. E.g. hybrid map, terrain map etc. |
| 89 | * See: https://developers.google.com/maps/documentation/javascript/reference/map#MapTypeId |
| 90 | */ |
| 91 | @Input() mapTypeId: google.maps.MapTypeId | undefined; |
| 92 | |
| 93 | @Input() |
| 94 | set center(center: google.maps.LatLngLiteral | google.maps.LatLng) { |
| 95 | this._center = center; |
| 96 | } |
| 97 | private _center!: google.maps.LatLngLiteral | google.maps.LatLng; |
| 98 | |
| 99 | @Input() |
| 100 | set zoom(zoom: number) { |
| 101 | this._zoom = zoom; |
| 102 | } |
| 103 | private _zoom!: number; |
| 104 | |
| 105 | @Input() |
| 106 | set options(options: google.maps.MapOptions) { |
| 107 | this._options = options || DEFAULT_OPTIONS; |
| 108 | } |
| 109 | private _options = DEFAULT_OPTIONS; |
| 110 | |
| 111 | /** Event emitted when the map is initialized. */ |
| 112 | @Output() readonly mapInitialized: EventEmitter<google.maps.Map> = |
| 113 | new EventEmitter<google.maps.Map>(); |
| 114 | |
| 115 | /** |
nothing calls this directly
no test coverage detected