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