@angular/google-maps 13.0.0-next.7 → 13.0.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/esm2020/google-map/google-map.mjs +445 -0
  2. package/esm2020/google-maps-module.mjs +86 -0
  3. package/esm2020/google-maps_public_index.mjs +5 -0
  4. package/esm2020/index.mjs +9 -0
  5. package/{esm2015/map-anchor-point.js → esm2020/map-anchor-point.mjs} +2 -2
  6. package/esm2020/map-base-layer.mjs +51 -0
  7. package/esm2020/map-bicycling-layer/map-bicycling-layer.mjs +48 -0
  8. package/esm2020/map-circle/map-circle.mjs +268 -0
  9. package/esm2020/map-directions-renderer/map-directions-renderer.mjs +138 -0
  10. package/esm2020/map-directions-renderer/map-directions-service.mjs +51 -0
  11. package/esm2020/map-event-manager.mjs +67 -0
  12. package/esm2020/map-geocoder/map-geocoder.mjs +47 -0
  13. package/esm2020/map-ground-overlay/map-ground-overlay.mjs +177 -0
  14. package/esm2020/map-heatmap-layer/map-heatmap-layer.mjs +135 -0
  15. package/esm2020/map-info-window/map-info-window.mjs +203 -0
  16. package/esm2020/map-kml-layer/map-kml-layer.mjs +170 -0
  17. package/esm2020/map-marker/map-marker.mjs +427 -0
  18. package/esm2020/map-marker-clusterer/map-marker-clusterer.mjs +407 -0
  19. package/esm2020/map-marker-clusterer/marker-clusterer-types.mjs +9 -0
  20. package/esm2020/map-polygon/map-polygon.mjs +216 -0
  21. package/esm2020/map-polyline/map-polyline.mjs +207 -0
  22. package/esm2020/map-rectangle/map-rectangle.mjs +229 -0
  23. package/esm2020/map-traffic-layer/map-traffic-layer.mjs +93 -0
  24. package/esm2020/map-transit-layer/map-transit-layer.mjs +48 -0
  25. package/{esm2015/public-api.js → esm2020/public-api.mjs} +0 -0
  26. package/fesm2015/{google-maps.js → google-maps.mjs} +590 -518
  27. package/fesm2015/google-maps.mjs.map +1 -0
  28. package/fesm2020/google-maps.mjs +3257 -0
  29. package/fesm2020/google-maps.mjs.map +1 -0
  30. package/google-map/google-map.d.ts +10 -7
  31. package/google-maps-module.d.ts +20 -7
  32. package/google-maps_public_index.d.ts +4 -0
  33. package/index.d.ts +5 -1
  34. package/map-anchor-point.d.ts +1 -1
  35. package/map-base-layer.d.ts +3 -0
  36. package/map-bicycling-layer/map-bicycling-layer.d.ts +4 -8
  37. package/map-circle/map-circle.d.ts +6 -3
  38. package/map-directions-renderer/map-directions-renderer.d.ts +6 -3
  39. package/map-directions-renderer/map-directions-service.d.ts +4 -1
  40. package/map-event-manager.d.ts +1 -1
  41. package/map-geocoder/map-geocoder.d.ts +4 -1
  42. package/map-ground-overlay/map-ground-overlay.d.ts +5 -2
  43. package/map-heatmap-layer/map-heatmap-layer.d.ts +4 -1
  44. package/map-info-window/map-info-window.d.ts +5 -2
  45. package/map-kml-layer/map-kml-layer.d.ts +6 -3
  46. package/map-marker/map-marker.d.ts +4 -1
  47. package/map-marker-clusterer/map-marker-clusterer.d.ts +5 -2
  48. package/map-marker-clusterer/marker-clusterer-types.d.ts +1 -1
  49. package/map-polygon/map-polygon.d.ts +4 -1
  50. package/map-polyline/map-polyline.d.ts +4 -1
  51. package/map-rectangle/map-rectangle.d.ts +5 -2
  52. package/map-traffic-layer/map-traffic-layer.d.ts +4 -1
  53. package/map-transit-layer/map-transit-layer.d.ts +4 -8
  54. package/package.json +23 -9
  55. package/bundles/google-maps.umd.js +0 -3757
  56. package/bundles/google-maps.umd.js.map +0 -1
  57. package/esm2015/google-map/google-map.js +0 -418
  58. package/esm2015/google-maps-module.js +0 -51
  59. package/esm2015/google-maps.externs.js +0 -6
  60. package/esm2015/index.js +0 -5
  61. package/esm2015/map-base-layer.js +0 -49
  62. package/esm2015/map-bicycling-layer/map-bicycling-layer.js +0 -43
  63. package/esm2015/map-circle/map-circle.js +0 -247
  64. package/esm2015/map-directions-renderer/map-directions-renderer.js +0 -131
  65. package/esm2015/map-directions-renderer/map-directions-service.js +0 -52
  66. package/esm2015/map-event-manager.js +0 -67
  67. package/esm2015/map-geocoder/map-geocoder.js +0 -47
  68. package/esm2015/map-ground-overlay/map-ground-overlay.js +0 -171
  69. package/esm2015/map-heatmap-layer/map-heatmap-layer.js +0 -130
  70. package/esm2015/map-info-window/map-info-window.js +0 -193
  71. package/esm2015/map-kml-layer/map-kml-layer.js +0 -160
  72. package/esm2015/map-marker/map-marker.js +0 -391
  73. package/esm2015/map-marker-clusterer/map-marker-clusterer.js +0 -360
  74. package/esm2015/map-marker-clusterer/marker-clusterer-types.js +0 -9
  75. package/esm2015/map-polygon/map-polygon.js +0 -198
  76. package/esm2015/map-polyline/map-polyline.js +0 -189
  77. package/esm2015/map-rectangle/map-rectangle.js +0 -210
  78. package/esm2015/map-traffic-layer/map-traffic-layer.js +0 -88
  79. package/esm2015/map-transit-layer/map-transit-layer.js +0 -43
  80. package/fesm2015/google-maps.js.map +0 -1
  81. package/index.metadata.json +0 -1
@@ -0,0 +1,3257 @@
1
+ import * as i0 from '@angular/core';
2
+ import { EventEmitter, PLATFORM_ID, Component, ChangeDetectionStrategy, ViewEncapsulation, Inject, Input, Output, Directive, ContentChildren, NgModule, Injectable } from '@angular/core';
3
+ import { isPlatformBrowser } from '@angular/common';
4
+ import { BehaviorSubject, Observable, Subject, combineLatest } from 'rxjs';
5
+ import { switchMap, take, map, takeUntil } from 'rxjs/operators';
6
+
7
+ /**
8
+ * @license
9
+ * Copyright Google LLC All Rights Reserved.
10
+ *
11
+ * Use of this source code is governed by an MIT-style license that can be
12
+ * found in the LICENSE file at https://angular.io/license
13
+ */
14
+ /** Manages event on a Google Maps object, ensuring that events are added only when necessary. */
15
+ class MapEventManager {
16
+ constructor(_ngZone) {
17
+ this._ngZone = _ngZone;
18
+ /** Pending listeners that were added before the target was set. */
19
+ this._pending = [];
20
+ this._listeners = [];
21
+ this._targetStream = new BehaviorSubject(undefined);
22
+ }
23
+ /** Clears all currently-registered event listeners. */
24
+ _clearListeners() {
25
+ for (const listener of this._listeners) {
26
+ listener.remove();
27
+ }
28
+ this._listeners = [];
29
+ }
30
+ /** Gets an observable that adds an event listener to the map when a consumer subscribes to it. */
31
+ getLazyEmitter(name) {
32
+ return this._targetStream.pipe(switchMap(target => {
33
+ const observable = new Observable(observer => {
34
+ // If the target hasn't been initialized yet, cache the observer so it can be added later.
35
+ if (!target) {
36
+ this._pending.push({ observable, observer });
37
+ return undefined;
38
+ }
39
+ const listener = target.addListener(name, (event) => {
40
+ this._ngZone.run(() => observer.next(event));
41
+ });
42
+ this._listeners.push(listener);
43
+ return () => listener.remove();
44
+ });
45
+ return observable;
46
+ }));
47
+ }
48
+ /** Sets the current target that the manager should bind events to. */
49
+ setTarget(target) {
50
+ const currentTarget = this._targetStream.value;
51
+ if (target === currentTarget) {
52
+ return;
53
+ }
54
+ // Clear the listeners from the pre-existing target.
55
+ if (currentTarget) {
56
+ this._clearListeners();
57
+ this._pending = [];
58
+ }
59
+ this._targetStream.next(target);
60
+ // Add the listeners that were bound before the map was initialized.
61
+ this._pending.forEach(subscriber => subscriber.observable.subscribe(subscriber.observer));
62
+ this._pending = [];
63
+ }
64
+ /** Destroys the manager and clears the event listeners. */
65
+ destroy() {
66
+ this._clearListeners();
67
+ this._pending = [];
68
+ this._targetStream.complete();
69
+ }
70
+ }
71
+
72
+ /// <reference types="google.maps" />
73
+ /** default options set to the Googleplex */
74
+ const DEFAULT_OPTIONS = {
75
+ center: { lat: 37.421995, lng: -122.084092 },
76
+ zoom: 17,
77
+ // Note: the type conversion here isn't necessary for our CI, but it resolves a g3 failure.
78
+ mapTypeId: 'roadmap',
79
+ };
80
+ /** Arbitrary default height for the map element */
81
+ const DEFAULT_HEIGHT = '500px';
82
+ /** Arbitrary default width for the map element */
83
+ const DEFAULT_WIDTH = '500px';
84
+ /**
85
+ * Angular component that renders a Google Map via the Google Maps JavaScript
86
+ * API.
87
+ * @see https://developers.google.com/maps/documentation/javascript/reference/
88
+ */
89
+ class GoogleMap {
90
+ constructor(_elementRef, _ngZone, platformId) {
91
+ this._elementRef = _elementRef;
92
+ this._ngZone = _ngZone;
93
+ this._eventManager = new MapEventManager(this._ngZone);
94
+ /** Height of the map. Set this to `null` if you'd like to control the height through CSS. */
95
+ this.height = DEFAULT_HEIGHT;
96
+ /** Width of the map. Set this to `null` if you'd like to control the width through CSS. */
97
+ this.width = DEFAULT_WIDTH;
98
+ this._options = DEFAULT_OPTIONS;
99
+ /**
100
+ * See
101
+ * https://developers.google.com/maps/documentation/javascript/events#auth-errors
102
+ */
103
+ this.authFailure = new EventEmitter();
104
+ /**
105
+ * See
106
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.bounds_changed
107
+ */
108
+ this.boundsChanged = this._eventManager.getLazyEmitter('bounds_changed');
109
+ /**
110
+ * See
111
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.center_changed
112
+ */
113
+ this.centerChanged = this._eventManager.getLazyEmitter('center_changed');
114
+ /**
115
+ * See
116
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.click
117
+ */
118
+ this.mapClick = this._eventManager.getLazyEmitter('click');
119
+ /**
120
+ * See
121
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.dblclick
122
+ */
123
+ this.mapDblclick = this._eventManager.getLazyEmitter('dblclick');
124
+ /**
125
+ * See
126
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.drag
127
+ */
128
+ this.mapDrag = this._eventManager.getLazyEmitter('drag');
129
+ /**
130
+ * See
131
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.dragend
132
+ */
133
+ this.mapDragend = this._eventManager.getLazyEmitter('dragend');
134
+ /**
135
+ * See
136
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.dragstart
137
+ */
138
+ this.mapDragstart = this._eventManager.getLazyEmitter('dragstart');
139
+ /**
140
+ * See
141
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.heading_changed
142
+ */
143
+ this.headingChanged = this._eventManager.getLazyEmitter('heading_changed');
144
+ /**
145
+ * See
146
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.idle
147
+ */
148
+ this.idle = this._eventManager.getLazyEmitter('idle');
149
+ /**
150
+ * See
151
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.maptypeid_changed
152
+ */
153
+ this.maptypeidChanged = this._eventManager.getLazyEmitter('maptypeid_changed');
154
+ /**
155
+ * See
156
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.mousemove
157
+ */
158
+ this.mapMousemove = this._eventManager.getLazyEmitter('mousemove');
159
+ /**
160
+ * See
161
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.mouseout
162
+ */
163
+ this.mapMouseout = this._eventManager.getLazyEmitter('mouseout');
164
+ /**
165
+ * See
166
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.mouseover
167
+ */
168
+ this.mapMouseover = this._eventManager.getLazyEmitter('mouseover');
169
+ /**
170
+ * See
171
+ * developers.google.com/maps/documentation/javascript/reference/map#Map.projection_changed
172
+ */
173
+ this.projectionChanged = this._eventManager.getLazyEmitter('projection_changed');
174
+ /**
175
+ * See
176
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.rightclick
177
+ */
178
+ this.mapRightclick = this._eventManager.getLazyEmitter('rightclick');
179
+ /**
180
+ * See
181
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.tilesloaded
182
+ */
183
+ this.tilesloaded = this._eventManager.getLazyEmitter('tilesloaded');
184
+ /**
185
+ * See
186
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.tilt_changed
187
+ */
188
+ this.tiltChanged = this._eventManager.getLazyEmitter('tilt_changed');
189
+ /**
190
+ * See
191
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.zoom_changed
192
+ */
193
+ this.zoomChanged = this._eventManager.getLazyEmitter('zoom_changed');
194
+ this._isBrowser = isPlatformBrowser(platformId);
195
+ if (this._isBrowser) {
196
+ const googleMapsWindow = window;
197
+ if (!googleMapsWindow.google && (typeof ngDevMode === 'undefined' || ngDevMode)) {
198
+ throw Error('Namespace google not found, cannot construct embedded google ' +
199
+ 'map. Please install the Google Maps JavaScript API: ' +
200
+ 'https://developers.google.com/maps/documentation/javascript/' +
201
+ 'tutorial#Loading_the_Maps_API');
202
+ }
203
+ this._existingAuthFailureCallback = googleMapsWindow.gm_authFailure;
204
+ googleMapsWindow.gm_authFailure = () => {
205
+ if (this._existingAuthFailureCallback) {
206
+ this._existingAuthFailureCallback();
207
+ }
208
+ this.authFailure.emit();
209
+ };
210
+ }
211
+ }
212
+ set center(center) {
213
+ this._center = center;
214
+ }
215
+ set zoom(zoom) {
216
+ this._zoom = zoom;
217
+ }
218
+ set options(options) {
219
+ this._options = options || DEFAULT_OPTIONS;
220
+ }
221
+ ngOnChanges(changes) {
222
+ if (changes['height'] || changes['width']) {
223
+ this._setSize();
224
+ }
225
+ const googleMap = this.googleMap;
226
+ if (googleMap) {
227
+ if (changes['options']) {
228
+ googleMap.setOptions(this._combineOptions());
229
+ }
230
+ if (changes['center'] && this._center) {
231
+ googleMap.setCenter(this._center);
232
+ }
233
+ // Note that the zoom can be zero.
234
+ if (changes['zoom'] && this._zoom != null) {
235
+ googleMap.setZoom(this._zoom);
236
+ }
237
+ if (changes['mapTypeId'] && this.mapTypeId) {
238
+ googleMap.setMapTypeId(this.mapTypeId);
239
+ }
240
+ }
241
+ }
242
+ ngOnInit() {
243
+ // It should be a noop during server-side rendering.
244
+ if (this._isBrowser) {
245
+ this._mapEl = this._elementRef.nativeElement.querySelector('.map-container');
246
+ this._setSize();
247
+ // Create the object outside the zone so its events don't trigger change detection.
248
+ // We'll bring it back in inside the `MapEventManager` only for the events that the
249
+ // user has subscribed to.
250
+ this._ngZone.runOutsideAngular(() => {
251
+ this.googleMap = new google.maps.Map(this._mapEl, this._combineOptions());
252
+ });
253
+ this._eventManager.setTarget(this.googleMap);
254
+ }
255
+ }
256
+ ngOnDestroy() {
257
+ this._eventManager.destroy();
258
+ if (this._isBrowser) {
259
+ const googleMapsWindow = window;
260
+ googleMapsWindow.gm_authFailure = this._existingAuthFailureCallback;
261
+ }
262
+ }
263
+ /**
264
+ * See
265
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.fitBounds
266
+ */
267
+ fitBounds(bounds, padding) {
268
+ this._assertInitialized();
269
+ this.googleMap.fitBounds(bounds, padding);
270
+ }
271
+ /**
272
+ * See
273
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.panBy
274
+ */
275
+ panBy(x, y) {
276
+ this._assertInitialized();
277
+ this.googleMap.panBy(x, y);
278
+ }
279
+ /**
280
+ * See
281
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.panTo
282
+ */
283
+ panTo(latLng) {
284
+ this._assertInitialized();
285
+ this.googleMap.panTo(latLng);
286
+ }
287
+ /**
288
+ * See
289
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.panToBounds
290
+ */
291
+ panToBounds(latLngBounds, padding) {
292
+ this._assertInitialized();
293
+ this.googleMap.panToBounds(latLngBounds, padding);
294
+ }
295
+ /**
296
+ * See
297
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getBounds
298
+ */
299
+ getBounds() {
300
+ this._assertInitialized();
301
+ return this.googleMap.getBounds() || null;
302
+ }
303
+ /**
304
+ * See
305
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getCenter
306
+ */
307
+ getCenter() {
308
+ this._assertInitialized();
309
+ return this.googleMap.getCenter();
310
+ }
311
+ /**
312
+ * See
313
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getClickableIcons
314
+ */
315
+ getClickableIcons() {
316
+ this._assertInitialized();
317
+ return this.googleMap.getClickableIcons();
318
+ }
319
+ /**
320
+ * See
321
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getHeading
322
+ */
323
+ getHeading() {
324
+ this._assertInitialized();
325
+ return this.googleMap.getHeading();
326
+ }
327
+ /**
328
+ * See
329
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getMapTypeId
330
+ */
331
+ getMapTypeId() {
332
+ this._assertInitialized();
333
+ return this.googleMap.getMapTypeId();
334
+ }
335
+ /**
336
+ * See
337
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getProjection
338
+ */
339
+ getProjection() {
340
+ this._assertInitialized();
341
+ return this.googleMap.getProjection() || null;
342
+ }
343
+ /**
344
+ * See
345
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getStreetView
346
+ */
347
+ getStreetView() {
348
+ this._assertInitialized();
349
+ return this.googleMap.getStreetView();
350
+ }
351
+ /**
352
+ * See
353
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getTilt
354
+ */
355
+ getTilt() {
356
+ this._assertInitialized();
357
+ return this.googleMap.getTilt();
358
+ }
359
+ /**
360
+ * See
361
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.getZoom
362
+ */
363
+ getZoom() {
364
+ this._assertInitialized();
365
+ return this.googleMap.getZoom();
366
+ }
367
+ /**
368
+ * See
369
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.controls
370
+ */
371
+ get controls() {
372
+ this._assertInitialized();
373
+ return this.googleMap.controls;
374
+ }
375
+ /**
376
+ * See
377
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.data
378
+ */
379
+ get data() {
380
+ this._assertInitialized();
381
+ return this.googleMap.data;
382
+ }
383
+ /**
384
+ * See
385
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.mapTypes
386
+ */
387
+ get mapTypes() {
388
+ this._assertInitialized();
389
+ return this.googleMap.mapTypes;
390
+ }
391
+ /**
392
+ * See
393
+ * https://developers.google.com/maps/documentation/javascript/reference/map#Map.overlayMapTypes
394
+ */
395
+ get overlayMapTypes() {
396
+ this._assertInitialized();
397
+ return this.googleMap.overlayMapTypes;
398
+ }
399
+ _setSize() {
400
+ if (this._mapEl) {
401
+ const styles = this._mapEl.style;
402
+ styles.height =
403
+ this.height === null ? '' : coerceCssPixelValue(this.height) || DEFAULT_HEIGHT;
404
+ styles.width = this.width === null ? '' : coerceCssPixelValue(this.width) || DEFAULT_WIDTH;
405
+ }
406
+ }
407
+ /** Combines the center and zoom and the other map options into a single object */
408
+ _combineOptions() {
409
+ const options = this._options || {};
410
+ return {
411
+ ...options,
412
+ // It's important that we set **some** kind of `center` and `zoom`, otherwise
413
+ // Google Maps will render a blank rectangle which looks broken.
414
+ center: this._center || options.center || DEFAULT_OPTIONS.center,
415
+ zoom: this._zoom ?? options.zoom ?? DEFAULT_OPTIONS.zoom,
416
+ // Passing in an undefined `mapTypeId` seems to break tile loading
417
+ // so make sure that we have some kind of default (see #22082).
418
+ mapTypeId: this.mapTypeId || options.mapTypeId || DEFAULT_OPTIONS.mapTypeId,
419
+ };
420
+ }
421
+ /** Asserts that the map has been initialized. */
422
+ _assertInitialized() {
423
+ if (!this.googleMap && (typeof ngDevMode === 'undefined' || ngDevMode)) {
424
+ throw Error('Cannot access Google Map information before the API has been initialized. ' +
425
+ 'Please wait for the API to load before trying to interact with it.');
426
+ }
427
+ }
428
+ }
429
+ GoogleMap.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: GoogleMap, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component });
430
+ GoogleMap.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0-next.15", type: GoogleMap, selector: "google-map", inputs: { height: "height", width: "width", mapTypeId: "mapTypeId", center: "center", zoom: "zoom", options: "options" }, outputs: { authFailure: "authFailure", boundsChanged: "boundsChanged", centerChanged: "centerChanged", mapClick: "mapClick", mapDblclick: "mapDblclick", mapDrag: "mapDrag", mapDragend: "mapDragend", mapDragstart: "mapDragstart", headingChanged: "headingChanged", idle: "idle", maptypeidChanged: "maptypeidChanged", mapMousemove: "mapMousemove", mapMouseout: "mapMouseout", mapMouseover: "mapMouseover", projectionChanged: "projectionChanged", mapRightclick: "mapRightclick", tilesloaded: "tilesloaded", tiltChanged: "tiltChanged", zoomChanged: "zoomChanged" }, exportAs: ["googleMap"], usesOnChanges: true, ngImport: i0, template: '<div class="map-container"></div><ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
431
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: GoogleMap, decorators: [{
432
+ type: Component,
433
+ args: [{
434
+ selector: 'google-map',
435
+ exportAs: 'googleMap',
436
+ changeDetection: ChangeDetectionStrategy.OnPush,
437
+ template: '<div class="map-container"></div><ng-content></ng-content>',
438
+ encapsulation: ViewEncapsulation.None,
439
+ }]
440
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: Object, decorators: [{
441
+ type: Inject,
442
+ args: [PLATFORM_ID]
443
+ }] }]; }, propDecorators: { height: [{
444
+ type: Input
445
+ }], width: [{
446
+ type: Input
447
+ }], mapTypeId: [{
448
+ type: Input
449
+ }], center: [{
450
+ type: Input
451
+ }], zoom: [{
452
+ type: Input
453
+ }], options: [{
454
+ type: Input
455
+ }], authFailure: [{
456
+ type: Output
457
+ }], boundsChanged: [{
458
+ type: Output
459
+ }], centerChanged: [{
460
+ type: Output
461
+ }], mapClick: [{
462
+ type: Output
463
+ }], mapDblclick: [{
464
+ type: Output
465
+ }], mapDrag: [{
466
+ type: Output
467
+ }], mapDragend: [{
468
+ type: Output
469
+ }], mapDragstart: [{
470
+ type: Output
471
+ }], headingChanged: [{
472
+ type: Output
473
+ }], idle: [{
474
+ type: Output
475
+ }], maptypeidChanged: [{
476
+ type: Output
477
+ }], mapMousemove: [{
478
+ type: Output
479
+ }], mapMouseout: [{
480
+ type: Output
481
+ }], mapMouseover: [{
482
+ type: Output
483
+ }], projectionChanged: [{
484
+ type: Output
485
+ }], mapRightclick: [{
486
+ type: Output
487
+ }], tilesloaded: [{
488
+ type: Output
489
+ }], tiltChanged: [{
490
+ type: Output
491
+ }], zoomChanged: [{
492
+ type: Output
493
+ }] } });
494
+ const cssUnitsPattern = /([A-Za-z%]+)$/;
495
+ /** Coerces a value to a CSS pixel value. */
496
+ function coerceCssPixelValue(value) {
497
+ if (value == null) {
498
+ return '';
499
+ }
500
+ return cssUnitsPattern.test(value) ? value : `${value}px`;
501
+ }
502
+
503
+ /// <reference types="google.maps" />
504
+ class MapBaseLayer {
505
+ constructor(_map, _ngZone) {
506
+ this._map = _map;
507
+ this._ngZone = _ngZone;
508
+ }
509
+ ngOnInit() {
510
+ if (this._map._isBrowser) {
511
+ this._ngZone.runOutsideAngular(() => {
512
+ this._initializeObject();
513
+ });
514
+ this._assertInitialized();
515
+ this._setMap();
516
+ }
517
+ }
518
+ ngOnDestroy() {
519
+ this._unsetMap();
520
+ }
521
+ _assertInitialized() {
522
+ if (!this._map.googleMap) {
523
+ throw Error('Cannot access Google Map information before the API has been initialized. ' +
524
+ 'Please wait for the API to load before trying to interact with it.');
525
+ }
526
+ }
527
+ _initializeObject() { }
528
+ _setMap() { }
529
+ _unsetMap() { }
530
+ }
531
+ MapBaseLayer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapBaseLayer, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
532
+ MapBaseLayer.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-next.15", type: MapBaseLayer, selector: "map-base-layer", exportAs: ["mapBaseLayer"], ngImport: i0 });
533
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapBaseLayer, decorators: [{
534
+ type: Directive,
535
+ args: [{
536
+ selector: 'map-base-layer',
537
+ exportAs: 'mapBaseLayer',
538
+ }]
539
+ }], ctorParameters: function () { return [{ type: GoogleMap }, { type: i0.NgZone }]; } });
540
+
541
+ /// <reference types="google.maps" />
542
+ /**
543
+ * Angular component that renders a Google Maps Bicycling Layer via the Google Maps JavaScript API.
544
+ *
545
+ * See developers.google.com/maps/documentation/javascript/reference/map#BicyclingLayer
546
+ */
547
+ class MapBicyclingLayer extends MapBaseLayer {
548
+ _initializeObject() {
549
+ this.bicyclingLayer = new google.maps.BicyclingLayer();
550
+ }
551
+ _setMap() {
552
+ this._assertLayerInitialized();
553
+ this.bicyclingLayer.setMap(this._map.googleMap);
554
+ }
555
+ _unsetMap() {
556
+ if (this.bicyclingLayer) {
557
+ this.bicyclingLayer.setMap(null);
558
+ }
559
+ }
560
+ _assertLayerInitialized() {
561
+ if (!this.bicyclingLayer) {
562
+ throw Error('Cannot interact with a Google Map Bicycling Layer before it has been initialized. ' +
563
+ 'Please wait for the Transit Layer to load before trying to interact with it.');
564
+ }
565
+ }
566
+ }
567
+ MapBicyclingLayer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapBicyclingLayer, deps: null, target: i0.ɵɵFactoryTarget.Directive });
568
+ MapBicyclingLayer.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-next.15", type: MapBicyclingLayer, selector: "map-bicycling-layer", exportAs: ["mapBicyclingLayer"], usesInheritance: true, ngImport: i0 });
569
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapBicyclingLayer, decorators: [{
570
+ type: Directive,
571
+ args: [{
572
+ selector: 'map-bicycling-layer',
573
+ exportAs: 'mapBicyclingLayer',
574
+ }]
575
+ }] });
576
+
577
+ /// <reference types="google.maps" />
578
+ /**
579
+ * Angular component that renders a Google Maps Circle via the Google Maps JavaScript API.
580
+ * @see developers.google.com/maps/documentation/javascript/reference/polygon#Circle
581
+ */
582
+ class MapCircle {
583
+ constructor(_map, _ngZone) {
584
+ this._map = _map;
585
+ this._ngZone = _ngZone;
586
+ this._eventManager = new MapEventManager(this._ngZone);
587
+ this._options = new BehaviorSubject({});
588
+ this._center = new BehaviorSubject(undefined);
589
+ this._radius = new BehaviorSubject(undefined);
590
+ this._destroyed = new Subject();
591
+ /**
592
+ * @see
593
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.center_changed
594
+ */
595
+ this.centerChanged = this._eventManager.getLazyEmitter('center_changed');
596
+ /**
597
+ * @see
598
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.click
599
+ */
600
+ this.circleClick = this._eventManager.getLazyEmitter('click');
601
+ /**
602
+ * @see
603
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.dblclick
604
+ */
605
+ this.circleDblclick = this._eventManager.getLazyEmitter('dblclick');
606
+ /**
607
+ * @see
608
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.drag
609
+ */
610
+ this.circleDrag = this._eventManager.getLazyEmitter('drag');
611
+ /**
612
+ * @see
613
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.dragend
614
+ */
615
+ this.circleDragend = this._eventManager.getLazyEmitter('dragend');
616
+ /**
617
+ * @see
618
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.dragstart
619
+ */
620
+ this.circleDragstart = this._eventManager.getLazyEmitter('dragstart');
621
+ /**
622
+ * @see
623
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.mousedown
624
+ */
625
+ this.circleMousedown = this._eventManager.getLazyEmitter('mousedown');
626
+ /**
627
+ * @see
628
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.mousemove
629
+ */
630
+ this.circleMousemove = this._eventManager.getLazyEmitter('mousemove');
631
+ /**
632
+ * @see
633
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.mouseout
634
+ */
635
+ this.circleMouseout = this._eventManager.getLazyEmitter('mouseout');
636
+ /**
637
+ * @see
638
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.mouseover
639
+ */
640
+ this.circleMouseover = this._eventManager.getLazyEmitter('mouseover');
641
+ /**
642
+ * @see
643
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.mouseup
644
+ */
645
+ this.circleMouseup = this._eventManager.getLazyEmitter('mouseup');
646
+ /**
647
+ * @see
648
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.radius_changed
649
+ */
650
+ this.radiusChanged = this._eventManager.getLazyEmitter('radius_changed');
651
+ /**
652
+ * @see
653
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.rightclick
654
+ */
655
+ this.circleRightclick = this._eventManager.getLazyEmitter('rightclick');
656
+ }
657
+ set options(options) {
658
+ this._options.next(options || {});
659
+ }
660
+ set center(center) {
661
+ this._center.next(center);
662
+ }
663
+ set radius(radius) {
664
+ this._radius.next(radius);
665
+ }
666
+ ngOnInit() {
667
+ if (this._map._isBrowser) {
668
+ this._combineOptions()
669
+ .pipe(take(1))
670
+ .subscribe(options => {
671
+ // Create the object outside the zone so its events don't trigger change detection.
672
+ // We'll bring it back in inside the `MapEventManager` only for the events that the
673
+ // user has subscribed to.
674
+ this._ngZone.runOutsideAngular(() => {
675
+ this.circle = new google.maps.Circle(options);
676
+ });
677
+ this._assertInitialized();
678
+ this.circle.setMap(this._map.googleMap);
679
+ this._eventManager.setTarget(this.circle);
680
+ });
681
+ this._watchForOptionsChanges();
682
+ this._watchForCenterChanges();
683
+ this._watchForRadiusChanges();
684
+ }
685
+ }
686
+ ngOnDestroy() {
687
+ this._eventManager.destroy();
688
+ this._destroyed.next();
689
+ this._destroyed.complete();
690
+ if (this.circle) {
691
+ this.circle.setMap(null);
692
+ }
693
+ }
694
+ /**
695
+ * @see
696
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.getBounds
697
+ */
698
+ getBounds() {
699
+ this._assertInitialized();
700
+ return this.circle.getBounds();
701
+ }
702
+ /**
703
+ * @see
704
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.getCenter
705
+ */
706
+ getCenter() {
707
+ this._assertInitialized();
708
+ return this.circle.getCenter();
709
+ }
710
+ /**
711
+ * @see
712
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.getDraggable
713
+ */
714
+ getDraggable() {
715
+ this._assertInitialized();
716
+ return this.circle.getDraggable();
717
+ }
718
+ /**
719
+ * @see
720
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.getEditable
721
+ */
722
+ getEditable() {
723
+ this._assertInitialized();
724
+ return this.circle.getEditable();
725
+ }
726
+ /**
727
+ * @see
728
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.getRadius
729
+ */
730
+ getRadius() {
731
+ this._assertInitialized();
732
+ return this.circle.getRadius();
733
+ }
734
+ /**
735
+ * @see
736
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Circle.getVisible
737
+ */
738
+ getVisible() {
739
+ this._assertInitialized();
740
+ return this.circle.getVisible();
741
+ }
742
+ _combineOptions() {
743
+ return combineLatest([this._options, this._center, this._radius]).pipe(map(([options, center, radius]) => {
744
+ const combinedOptions = {
745
+ ...options,
746
+ center: center || options.center,
747
+ radius: radius !== undefined ? radius : options.radius,
748
+ };
749
+ return combinedOptions;
750
+ }));
751
+ }
752
+ _watchForOptionsChanges() {
753
+ this._options.pipe(takeUntil(this._destroyed)).subscribe(options => {
754
+ this._assertInitialized();
755
+ this.circle.setOptions(options);
756
+ });
757
+ }
758
+ _watchForCenterChanges() {
759
+ this._center.pipe(takeUntil(this._destroyed)).subscribe(center => {
760
+ if (center) {
761
+ this._assertInitialized();
762
+ this.circle.setCenter(center);
763
+ }
764
+ });
765
+ }
766
+ _watchForRadiusChanges() {
767
+ this._radius.pipe(takeUntil(this._destroyed)).subscribe(radius => {
768
+ if (radius !== undefined) {
769
+ this._assertInitialized();
770
+ this.circle.setRadius(radius);
771
+ }
772
+ });
773
+ }
774
+ _assertInitialized() {
775
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
776
+ if (!this._map.googleMap) {
777
+ throw Error('Cannot access Google Map information before the API has been initialized. ' +
778
+ 'Please wait for the API to load before trying to interact with it.');
779
+ }
780
+ if (!this.circle) {
781
+ throw Error('Cannot interact with a Google Map Circle before it has been ' +
782
+ 'initialized. Please wait for the Circle to load before trying to interact with it.');
783
+ }
784
+ }
785
+ }
786
+ }
787
+ MapCircle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapCircle, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
788
+ MapCircle.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-next.15", type: MapCircle, selector: "map-circle", inputs: { options: "options", center: "center", radius: "radius" }, outputs: { centerChanged: "centerChanged", circleClick: "circleClick", circleDblclick: "circleDblclick", circleDrag: "circleDrag", circleDragend: "circleDragend", circleDragstart: "circleDragstart", circleMousedown: "circleMousedown", circleMousemove: "circleMousemove", circleMouseout: "circleMouseout", circleMouseover: "circleMouseover", circleMouseup: "circleMouseup", radiusChanged: "radiusChanged", circleRightclick: "circleRightclick" }, exportAs: ["mapCircle"], ngImport: i0 });
789
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapCircle, decorators: [{
790
+ type: Directive,
791
+ args: [{
792
+ selector: 'map-circle',
793
+ exportAs: 'mapCircle',
794
+ }]
795
+ }], ctorParameters: function () { return [{ type: GoogleMap }, { type: i0.NgZone }]; }, propDecorators: { options: [{
796
+ type: Input
797
+ }], center: [{
798
+ type: Input
799
+ }], radius: [{
800
+ type: Input
801
+ }], centerChanged: [{
802
+ type: Output
803
+ }], circleClick: [{
804
+ type: Output
805
+ }], circleDblclick: [{
806
+ type: Output
807
+ }], circleDrag: [{
808
+ type: Output
809
+ }], circleDragend: [{
810
+ type: Output
811
+ }], circleDragstart: [{
812
+ type: Output
813
+ }], circleMousedown: [{
814
+ type: Output
815
+ }], circleMousemove: [{
816
+ type: Output
817
+ }], circleMouseout: [{
818
+ type: Output
819
+ }], circleMouseover: [{
820
+ type: Output
821
+ }], circleMouseup: [{
822
+ type: Output
823
+ }], radiusChanged: [{
824
+ type: Output
825
+ }], circleRightclick: [{
826
+ type: Output
827
+ }] } });
828
+
829
+ /// <reference types="google.maps" />
830
+ /**
831
+ * Angular component that renders a Google Maps Directions Renderer via the Google Maps
832
+ * JavaScript API.
833
+ *
834
+ * See developers.google.com/maps/documentation/javascript/reference/directions#DirectionsRenderer
835
+ */
836
+ class MapDirectionsRenderer {
837
+ constructor(_googleMap, _ngZone) {
838
+ this._googleMap = _googleMap;
839
+ this._ngZone = _ngZone;
840
+ this._eventManager = new MapEventManager(this._ngZone);
841
+ /**
842
+ * See developers.google.com/maps/documentation/javascript/reference/directions
843
+ * #DirectionsRenderer.directions_changed
844
+ */
845
+ this.directionsChanged = this._eventManager.getLazyEmitter('directions_changed');
846
+ }
847
+ /**
848
+ * See developers.google.com/maps/documentation/javascript/reference/directions
849
+ * #DirectionsRendererOptions.directions
850
+ */
851
+ set directions(directions) {
852
+ this._directions = directions;
853
+ }
854
+ /**
855
+ * See developers.google.com/maps/documentation/javascript/reference/directions
856
+ * #DirectionsRendererOptions
857
+ */
858
+ set options(options) {
859
+ this._options = options;
860
+ }
861
+ ngOnInit() {
862
+ if (this._googleMap._isBrowser) {
863
+ // Create the object outside the zone so its events don't trigger change detection.
864
+ // We'll bring it back in inside the `MapEventManager` only for the events that the
865
+ // user has subscribed to.
866
+ this._ngZone.runOutsideAngular(() => {
867
+ this.directionsRenderer = new google.maps.DirectionsRenderer(this._combineOptions());
868
+ });
869
+ this._assertInitialized();
870
+ this.directionsRenderer.setMap(this._googleMap.googleMap);
871
+ this._eventManager.setTarget(this.directionsRenderer);
872
+ }
873
+ }
874
+ ngOnChanges(changes) {
875
+ if (this.directionsRenderer) {
876
+ if (changes['options']) {
877
+ this.directionsRenderer.setOptions(this._combineOptions());
878
+ }
879
+ if (changes['directions'] && this._directions !== undefined) {
880
+ this.directionsRenderer.setDirections(this._directions);
881
+ }
882
+ }
883
+ }
884
+ ngOnDestroy() {
885
+ this._eventManager.destroy();
886
+ if (this.directionsRenderer) {
887
+ this.directionsRenderer.setMap(null);
888
+ }
889
+ }
890
+ /**
891
+ * See developers.google.com/maps/documentation/javascript/reference/directions
892
+ * #DirectionsRenderer.getDirections
893
+ */
894
+ getDirections() {
895
+ this._assertInitialized();
896
+ return this.directionsRenderer.getDirections();
897
+ }
898
+ /**
899
+ * See developers.google.com/maps/documentation/javascript/reference/directions
900
+ * #DirectionsRenderer.getPanel
901
+ */
902
+ getPanel() {
903
+ this._assertInitialized();
904
+ return this.directionsRenderer.getPanel();
905
+ }
906
+ /**
907
+ * See developers.google.com/maps/documentation/javascript/reference/directions
908
+ * #DirectionsRenderer.getRouteIndex
909
+ */
910
+ getRouteIndex() {
911
+ this._assertInitialized();
912
+ return this.directionsRenderer.getRouteIndex();
913
+ }
914
+ _combineOptions() {
915
+ const options = this._options || {};
916
+ return {
917
+ ...options,
918
+ directions: this._directions || options.directions,
919
+ map: this._googleMap.googleMap,
920
+ };
921
+ }
922
+ _assertInitialized() {
923
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
924
+ if (!this._googleMap.googleMap) {
925
+ throw Error('Cannot access Google Map information before the API has been initialized. ' +
926
+ 'Please wait for the API to load before trying to interact with it.');
927
+ }
928
+ if (!this.directionsRenderer) {
929
+ throw Error('Cannot interact with a Google Map Directions Renderer before it has been ' +
930
+ 'initialized. Please wait for the Directions Renderer to load before trying ' +
931
+ 'to interact with it.');
932
+ }
933
+ }
934
+ }
935
+ }
936
+ MapDirectionsRenderer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapDirectionsRenderer, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
937
+ MapDirectionsRenderer.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-next.15", type: MapDirectionsRenderer, selector: "map-directions-renderer", inputs: { directions: "directions", options: "options" }, outputs: { directionsChanged: "directionsChanged" }, exportAs: ["mapDirectionsRenderer"], usesOnChanges: true, ngImport: i0 });
938
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapDirectionsRenderer, decorators: [{
939
+ type: Directive,
940
+ args: [{
941
+ selector: 'map-directions-renderer',
942
+ exportAs: 'mapDirectionsRenderer',
943
+ }]
944
+ }], ctorParameters: function () { return [{ type: GoogleMap }, { type: i0.NgZone }]; }, propDecorators: { directions: [{
945
+ type: Input
946
+ }], options: [{
947
+ type: Input
948
+ }], directionsChanged: [{
949
+ type: Output
950
+ }] } });
951
+
952
+ /// <reference types="google.maps" />
953
+ /**
954
+ * Angular component that renders a Google Maps Ground Overlay via the Google Maps JavaScript API.
955
+ *
956
+ * See developers.google.com/maps/documentation/javascript/reference/image-overlay#GroundOverlay
957
+ */
958
+ class MapGroundOverlay {
959
+ constructor(_map, _ngZone) {
960
+ this._map = _map;
961
+ this._ngZone = _ngZone;
962
+ this._eventManager = new MapEventManager(this._ngZone);
963
+ this._opacity = new BehaviorSubject(1);
964
+ this._url = new BehaviorSubject('');
965
+ this._bounds = new BehaviorSubject(undefined);
966
+ this._destroyed = new Subject();
967
+ /** Whether the overlay is clickable */
968
+ this.clickable = false;
969
+ /**
970
+ * See
971
+ * developers.google.com/maps/documentation/javascript/reference/image-overlay#GroundOverlay.click
972
+ */
973
+ this.mapClick = this._eventManager.getLazyEmitter('click');
974
+ /**
975
+ * See
976
+ * developers.google.com/maps/documentation/javascript/reference/image-overlay
977
+ * #GroundOverlay.dblclick
978
+ */
979
+ this.mapDblclick = this._eventManager.getLazyEmitter('dblclick');
980
+ }
981
+ /** URL of the image that will be shown in the overlay. */
982
+ set url(url) {
983
+ this._url.next(url);
984
+ }
985
+ /** Bounds for the overlay. */
986
+ get bounds() {
987
+ return this._bounds.value;
988
+ }
989
+ set bounds(bounds) {
990
+ this._bounds.next(bounds);
991
+ }
992
+ /** Opacity of the overlay. */
993
+ set opacity(opacity) {
994
+ this._opacity.next(opacity);
995
+ }
996
+ ngOnInit() {
997
+ if (this._map._isBrowser) {
998
+ // The ground overlay setup is slightly different from the other Google Maps objects in that
999
+ // we have to recreate the `GroundOverlay` object whenever the bounds change, because
1000
+ // Google Maps doesn't provide an API to update the bounds of an existing overlay.
1001
+ this._bounds.pipe(takeUntil(this._destroyed)).subscribe(bounds => {
1002
+ if (this.groundOverlay) {
1003
+ this.groundOverlay.setMap(null);
1004
+ this.groundOverlay = undefined;
1005
+ }
1006
+ // Create the object outside the zone so its events don't trigger change detection.
1007
+ // We'll bring it back in inside the `MapEventManager` only for the events that the
1008
+ // user has subscribed to.
1009
+ if (bounds) {
1010
+ this._ngZone.runOutsideAngular(() => {
1011
+ this.groundOverlay = new google.maps.GroundOverlay(this._url.getValue(), bounds, {
1012
+ clickable: this.clickable,
1013
+ opacity: this._opacity.value,
1014
+ });
1015
+ });
1016
+ this._assertInitialized();
1017
+ this.groundOverlay.setMap(this._map.googleMap);
1018
+ this._eventManager.setTarget(this.groundOverlay);
1019
+ }
1020
+ });
1021
+ this._watchForOpacityChanges();
1022
+ this._watchForUrlChanges();
1023
+ }
1024
+ }
1025
+ ngOnDestroy() {
1026
+ this._eventManager.destroy();
1027
+ this._destroyed.next();
1028
+ this._destroyed.complete();
1029
+ if (this.groundOverlay) {
1030
+ this.groundOverlay.setMap(null);
1031
+ }
1032
+ }
1033
+ /**
1034
+ * See
1035
+ * developers.google.com/maps/documentation/javascript/reference/image-overlay
1036
+ * #GroundOverlay.getBounds
1037
+ */
1038
+ getBounds() {
1039
+ this._assertInitialized();
1040
+ return this.groundOverlay.getBounds();
1041
+ }
1042
+ /**
1043
+ * See
1044
+ * developers.google.com/maps/documentation/javascript/reference/image-overlay
1045
+ * #GroundOverlay.getOpacity
1046
+ */
1047
+ getOpacity() {
1048
+ this._assertInitialized();
1049
+ return this.groundOverlay.getOpacity();
1050
+ }
1051
+ /**
1052
+ * See
1053
+ * developers.google.com/maps/documentation/javascript/reference/image-overlay
1054
+ * #GroundOverlay.getUrl
1055
+ */
1056
+ getUrl() {
1057
+ this._assertInitialized();
1058
+ return this.groundOverlay.getUrl();
1059
+ }
1060
+ _watchForOpacityChanges() {
1061
+ this._opacity.pipe(takeUntil(this._destroyed)).subscribe(opacity => {
1062
+ if (opacity != null) {
1063
+ this._assertInitialized();
1064
+ this.groundOverlay.setOpacity(opacity);
1065
+ }
1066
+ });
1067
+ }
1068
+ _watchForUrlChanges() {
1069
+ this._url.pipe(takeUntil(this._destroyed)).subscribe(url => {
1070
+ this._assertInitialized();
1071
+ const overlay = this.groundOverlay;
1072
+ overlay.set('url', url);
1073
+ // Google Maps only redraws the overlay if we re-set the map.
1074
+ overlay.setMap(null);
1075
+ overlay.setMap(this._map.googleMap);
1076
+ });
1077
+ }
1078
+ _assertInitialized() {
1079
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
1080
+ if (!this._map.googleMap) {
1081
+ throw Error('Cannot access Google Map information before the API has been initialized. ' +
1082
+ 'Please wait for the API to load before trying to interact with it.');
1083
+ }
1084
+ if (!this.groundOverlay) {
1085
+ throw Error('Cannot interact with a Google Map GroundOverlay before it has been initialized. ' +
1086
+ 'Please wait for the GroundOverlay to load before trying to interact with it.');
1087
+ }
1088
+ }
1089
+ }
1090
+ }
1091
+ MapGroundOverlay.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapGroundOverlay, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
1092
+ MapGroundOverlay.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-next.15", type: MapGroundOverlay, selector: "map-ground-overlay", inputs: { url: "url", bounds: "bounds", clickable: "clickable", opacity: "opacity" }, outputs: { mapClick: "mapClick", mapDblclick: "mapDblclick" }, exportAs: ["mapGroundOverlay"], ngImport: i0 });
1093
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapGroundOverlay, decorators: [{
1094
+ type: Directive,
1095
+ args: [{
1096
+ selector: 'map-ground-overlay',
1097
+ exportAs: 'mapGroundOverlay',
1098
+ }]
1099
+ }], ctorParameters: function () { return [{ type: GoogleMap }, { type: i0.NgZone }]; }, propDecorators: { url: [{
1100
+ type: Input
1101
+ }], bounds: [{
1102
+ type: Input
1103
+ }], clickable: [{
1104
+ type: Input
1105
+ }], opacity: [{
1106
+ type: Input
1107
+ }], mapClick: [{
1108
+ type: Output
1109
+ }], mapDblclick: [{
1110
+ type: Output
1111
+ }] } });
1112
+
1113
+ /// <reference types="google.maps" />
1114
+ /**
1115
+ * Angular component that renders a Google Maps info window via the Google Maps JavaScript API.
1116
+ *
1117
+ * See developers.google.com/maps/documentation/javascript/reference/info-window
1118
+ */
1119
+ class MapInfoWindow {
1120
+ constructor(_googleMap, _elementRef, _ngZone) {
1121
+ this._googleMap = _googleMap;
1122
+ this._elementRef = _elementRef;
1123
+ this._ngZone = _ngZone;
1124
+ this._eventManager = new MapEventManager(this._ngZone);
1125
+ this._options = new BehaviorSubject({});
1126
+ this._position = new BehaviorSubject(undefined);
1127
+ this._destroy = new Subject();
1128
+ /**
1129
+ * See
1130
+ * developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindow.closeclick
1131
+ */
1132
+ this.closeclick = this._eventManager.getLazyEmitter('closeclick');
1133
+ /**
1134
+ * See
1135
+ * developers.google.com/maps/documentation/javascript/reference/info-window
1136
+ * #InfoWindow.content_changed
1137
+ */
1138
+ this.contentChanged = this._eventManager.getLazyEmitter('content_changed');
1139
+ /**
1140
+ * See
1141
+ * developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindow.domready
1142
+ */
1143
+ this.domready = this._eventManager.getLazyEmitter('domready');
1144
+ /**
1145
+ * See
1146
+ * developers.google.com/maps/documentation/javascript/reference/info-window
1147
+ * #InfoWindow.position_changed
1148
+ */
1149
+ this.positionChanged = this._eventManager.getLazyEmitter('position_changed');
1150
+ /**
1151
+ * See
1152
+ * developers.google.com/maps/documentation/javascript/reference/info-window
1153
+ * #InfoWindow.zindex_changed
1154
+ */
1155
+ this.zindexChanged = this._eventManager.getLazyEmitter('zindex_changed');
1156
+ }
1157
+ set options(options) {
1158
+ this._options.next(options || {});
1159
+ }
1160
+ set position(position) {
1161
+ this._position.next(position);
1162
+ }
1163
+ ngOnInit() {
1164
+ if (this._googleMap._isBrowser) {
1165
+ const combinedOptionsChanges = this._combineOptions();
1166
+ combinedOptionsChanges.pipe(take(1)).subscribe(options => {
1167
+ // Create the object outside the zone so its events don't trigger change detection.
1168
+ // We'll bring it back in inside the `MapEventManager` only for the events that the
1169
+ // user has subscribed to.
1170
+ this._ngZone.runOutsideAngular(() => {
1171
+ this.infoWindow = new google.maps.InfoWindow(options);
1172
+ });
1173
+ this._eventManager.setTarget(this.infoWindow);
1174
+ });
1175
+ this._watchForOptionsChanges();
1176
+ this._watchForPositionChanges();
1177
+ }
1178
+ }
1179
+ ngOnDestroy() {
1180
+ this._eventManager.destroy();
1181
+ this._destroy.next();
1182
+ this._destroy.complete();
1183
+ // If no info window has been created on the server, we do not try closing it.
1184
+ // On the server, an info window cannot be created and this would cause errors.
1185
+ if (this.infoWindow) {
1186
+ this.close();
1187
+ }
1188
+ }
1189
+ /**
1190
+ * See developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindow.close
1191
+ */
1192
+ close() {
1193
+ this._assertInitialized();
1194
+ this.infoWindow.close();
1195
+ }
1196
+ /**
1197
+ * See
1198
+ * developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindow.getContent
1199
+ */
1200
+ getContent() {
1201
+ this._assertInitialized();
1202
+ return this.infoWindow.getContent() || null;
1203
+ }
1204
+ /**
1205
+ * See
1206
+ * developers.google.com/maps/documentation/javascript/reference/info-window
1207
+ * #InfoWindow.getPosition
1208
+ */
1209
+ getPosition() {
1210
+ this._assertInitialized();
1211
+ return this.infoWindow.getPosition() || null;
1212
+ }
1213
+ /**
1214
+ * See
1215
+ * developers.google.com/maps/documentation/javascript/reference/info-window#InfoWindow.getZIndex
1216
+ */
1217
+ getZIndex() {
1218
+ this._assertInitialized();
1219
+ return this.infoWindow.getZIndex();
1220
+ }
1221
+ /**
1222
+ * Opens the MapInfoWindow using the provided anchor. If the anchor is not set,
1223
+ * then the position property of the options input is used instead.
1224
+ */
1225
+ open(anchor) {
1226
+ this._assertInitialized();
1227
+ const anchorObject = anchor ? anchor.getAnchor() : undefined;
1228
+ // Prevent the info window from initializing when trying to reopen on the same anchor.
1229
+ // Note that when the window is opened for the first time, the anchor will always be
1230
+ // undefined. If that's the case, we have to allow it to open in order to handle the
1231
+ // case where the window doesn't have an anchor, but is placed at a particular position.
1232
+ if (this.infoWindow.get('anchor') !== anchorObject || !anchorObject) {
1233
+ this._elementRef.nativeElement.style.display = '';
1234
+ this.infoWindow.open(this._googleMap.googleMap, anchorObject);
1235
+ }
1236
+ }
1237
+ _combineOptions() {
1238
+ return combineLatest([this._options, this._position]).pipe(map(([options, position]) => {
1239
+ const combinedOptions = {
1240
+ ...options,
1241
+ position: position || options.position,
1242
+ content: this._elementRef.nativeElement,
1243
+ };
1244
+ return combinedOptions;
1245
+ }));
1246
+ }
1247
+ _watchForOptionsChanges() {
1248
+ this._options.pipe(takeUntil(this._destroy)).subscribe(options => {
1249
+ this._assertInitialized();
1250
+ this.infoWindow.setOptions(options);
1251
+ });
1252
+ }
1253
+ _watchForPositionChanges() {
1254
+ this._position.pipe(takeUntil(this._destroy)).subscribe(position => {
1255
+ if (position) {
1256
+ this._assertInitialized();
1257
+ this.infoWindow.setPosition(position);
1258
+ }
1259
+ });
1260
+ }
1261
+ _assertInitialized() {
1262
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
1263
+ if (!this._googleMap.googleMap) {
1264
+ throw Error('Cannot access Google Map information before the API has been initialized. ' +
1265
+ 'Please wait for the API to load before trying to interact with it.');
1266
+ }
1267
+ if (!this.infoWindow) {
1268
+ throw Error('Cannot interact with a Google Map Info Window before it has been ' +
1269
+ 'initialized. Please wait for the Info Window to load before trying to interact with ' +
1270
+ 'it.');
1271
+ }
1272
+ }
1273
+ }
1274
+ }
1275
+ MapInfoWindow.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapInfoWindow, deps: [{ token: GoogleMap }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
1276
+ MapInfoWindow.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-next.15", type: MapInfoWindow, selector: "map-info-window", inputs: { options: "options", position: "position" }, outputs: { closeclick: "closeclick", contentChanged: "contentChanged", domready: "domready", positionChanged: "positionChanged", zindexChanged: "zindexChanged" }, host: { styleAttribute: "display: none" }, exportAs: ["mapInfoWindow"], ngImport: i0 });
1277
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapInfoWindow, decorators: [{
1278
+ type: Directive,
1279
+ args: [{
1280
+ selector: 'map-info-window',
1281
+ exportAs: 'mapInfoWindow',
1282
+ host: { 'style': 'display: none' },
1283
+ }]
1284
+ }], ctorParameters: function () { return [{ type: GoogleMap }, { type: i0.ElementRef }, { type: i0.NgZone }]; }, propDecorators: { options: [{
1285
+ type: Input
1286
+ }], position: [{
1287
+ type: Input
1288
+ }], closeclick: [{
1289
+ type: Output
1290
+ }], contentChanged: [{
1291
+ type: Output
1292
+ }], domready: [{
1293
+ type: Output
1294
+ }], positionChanged: [{
1295
+ type: Output
1296
+ }], zindexChanged: [{
1297
+ type: Output
1298
+ }] } });
1299
+
1300
+ /// <reference types="google.maps" />
1301
+ /**
1302
+ * Angular component that renders a Google Maps KML Layer via the Google Maps JavaScript API.
1303
+ *
1304
+ * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer
1305
+ */
1306
+ class MapKmlLayer {
1307
+ constructor(_map, _ngZone) {
1308
+ this._map = _map;
1309
+ this._ngZone = _ngZone;
1310
+ this._eventManager = new MapEventManager(this._ngZone);
1311
+ this._options = new BehaviorSubject({});
1312
+ this._url = new BehaviorSubject('');
1313
+ this._destroyed = new Subject();
1314
+ /**
1315
+ * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.click
1316
+ */
1317
+ this.kmlClick = this._eventManager.getLazyEmitter('click');
1318
+ /**
1319
+ * See
1320
+ * developers.google.com/maps/documentation/javascript/reference/kml
1321
+ * #KmlLayer.defaultviewport_changed
1322
+ */
1323
+ this.defaultviewportChanged = this._eventManager.getLazyEmitter('defaultviewport_changed');
1324
+ /**
1325
+ * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.status_changed
1326
+ */
1327
+ this.statusChanged = this._eventManager.getLazyEmitter('status_changed');
1328
+ }
1329
+ set options(options) {
1330
+ this._options.next(options || {});
1331
+ }
1332
+ set url(url) {
1333
+ this._url.next(url);
1334
+ }
1335
+ ngOnInit() {
1336
+ if (this._map._isBrowser) {
1337
+ this._combineOptions()
1338
+ .pipe(take(1))
1339
+ .subscribe(options => {
1340
+ // Create the object outside the zone so its events don't trigger change detection.
1341
+ // We'll bring it back in inside the `MapEventManager` only for the events that the
1342
+ // user has subscribed to.
1343
+ this._ngZone.runOutsideAngular(() => (this.kmlLayer = new google.maps.KmlLayer(options)));
1344
+ this._assertInitialized();
1345
+ this.kmlLayer.setMap(this._map.googleMap);
1346
+ this._eventManager.setTarget(this.kmlLayer);
1347
+ });
1348
+ this._watchForOptionsChanges();
1349
+ this._watchForUrlChanges();
1350
+ }
1351
+ }
1352
+ ngOnDestroy() {
1353
+ this._eventManager.destroy();
1354
+ this._destroyed.next();
1355
+ this._destroyed.complete();
1356
+ if (this.kmlLayer) {
1357
+ this.kmlLayer.setMap(null);
1358
+ }
1359
+ }
1360
+ /**
1361
+ * See
1362
+ * developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.getDefaultViewport
1363
+ */
1364
+ getDefaultViewport() {
1365
+ this._assertInitialized();
1366
+ return this.kmlLayer.getDefaultViewport();
1367
+ }
1368
+ /**
1369
+ * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.getMetadata
1370
+ */
1371
+ getMetadata() {
1372
+ this._assertInitialized();
1373
+ return this.kmlLayer.getMetadata();
1374
+ }
1375
+ /**
1376
+ * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.getStatus
1377
+ */
1378
+ getStatus() {
1379
+ this._assertInitialized();
1380
+ return this.kmlLayer.getStatus();
1381
+ }
1382
+ /**
1383
+ * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.getUrl
1384
+ */
1385
+ getUrl() {
1386
+ this._assertInitialized();
1387
+ return this.kmlLayer.getUrl();
1388
+ }
1389
+ /**
1390
+ * See developers.google.com/maps/documentation/javascript/reference/kml#KmlLayer.getZIndex
1391
+ */
1392
+ getZIndex() {
1393
+ this._assertInitialized();
1394
+ return this.kmlLayer.getZIndex();
1395
+ }
1396
+ _combineOptions() {
1397
+ return combineLatest([this._options, this._url]).pipe(map(([options, url]) => {
1398
+ const combinedOptions = {
1399
+ ...options,
1400
+ url: url || options.url,
1401
+ };
1402
+ return combinedOptions;
1403
+ }));
1404
+ }
1405
+ _watchForOptionsChanges() {
1406
+ this._options.pipe(takeUntil(this._destroyed)).subscribe(options => {
1407
+ if (this.kmlLayer) {
1408
+ this._assertInitialized();
1409
+ this.kmlLayer.setOptions(options);
1410
+ }
1411
+ });
1412
+ }
1413
+ _watchForUrlChanges() {
1414
+ this._url.pipe(takeUntil(this._destroyed)).subscribe(url => {
1415
+ if (url && this.kmlLayer) {
1416
+ this._assertInitialized();
1417
+ this.kmlLayer.setUrl(url);
1418
+ }
1419
+ });
1420
+ }
1421
+ _assertInitialized() {
1422
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
1423
+ if (!this._map.googleMap) {
1424
+ throw Error('Cannot access Google Map information before the API has been initialized. ' +
1425
+ 'Please wait for the API to load before trying to interact with it.');
1426
+ }
1427
+ if (!this.kmlLayer) {
1428
+ throw Error('Cannot interact with a Google Map KmlLayer before it has been ' +
1429
+ 'initialized. Please wait for the KmlLayer to load before trying to interact with it.');
1430
+ }
1431
+ }
1432
+ }
1433
+ }
1434
+ MapKmlLayer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapKmlLayer, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
1435
+ MapKmlLayer.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-next.15", type: MapKmlLayer, selector: "map-kml-layer", inputs: { options: "options", url: "url" }, outputs: { kmlClick: "kmlClick", defaultviewportChanged: "defaultviewportChanged", statusChanged: "statusChanged" }, exportAs: ["mapKmlLayer"], ngImport: i0 });
1436
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapKmlLayer, decorators: [{
1437
+ type: Directive,
1438
+ args: [{
1439
+ selector: 'map-kml-layer',
1440
+ exportAs: 'mapKmlLayer',
1441
+ }]
1442
+ }], ctorParameters: function () { return [{ type: GoogleMap }, { type: i0.NgZone }]; }, propDecorators: { options: [{
1443
+ type: Input
1444
+ }], url: [{
1445
+ type: Input
1446
+ }], kmlClick: [{
1447
+ type: Output
1448
+ }], defaultviewportChanged: [{
1449
+ type: Output
1450
+ }], statusChanged: [{
1451
+ type: Output
1452
+ }] } });
1453
+
1454
+ /// <reference types="google.maps" />
1455
+ /**
1456
+ * Default options for the Google Maps marker component. Displays a marker
1457
+ * at the Googleplex.
1458
+ */
1459
+ const DEFAULT_MARKER_OPTIONS = {
1460
+ position: { lat: 37.421995, lng: -122.084092 },
1461
+ };
1462
+ /**
1463
+ * Angular component that renders a Google Maps marker via the Google Maps JavaScript API.
1464
+ *
1465
+ * See developers.google.com/maps/documentation/javascript/reference/marker
1466
+ */
1467
+ class MapMarker {
1468
+ constructor(_googleMap, _ngZone) {
1469
+ this._googleMap = _googleMap;
1470
+ this._ngZone = _ngZone;
1471
+ this._eventManager = new MapEventManager(this._ngZone);
1472
+ /**
1473
+ * See
1474
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.animation_changed
1475
+ */
1476
+ this.animationChanged = this._eventManager.getLazyEmitter('animation_changed');
1477
+ /**
1478
+ * See
1479
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.click
1480
+ */
1481
+ this.mapClick = this._eventManager.getLazyEmitter('click');
1482
+ /**
1483
+ * See
1484
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.clickable_changed
1485
+ */
1486
+ this.clickableChanged = this._eventManager.getLazyEmitter('clickable_changed');
1487
+ /**
1488
+ * See
1489
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.cursor_changed
1490
+ */
1491
+ this.cursorChanged = this._eventManager.getLazyEmitter('cursor_changed');
1492
+ /**
1493
+ * See
1494
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.dblclick
1495
+ */
1496
+ this.mapDblclick = this._eventManager.getLazyEmitter('dblclick');
1497
+ /**
1498
+ * See
1499
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.drag
1500
+ */
1501
+ this.mapDrag = this._eventManager.getLazyEmitter('drag');
1502
+ /**
1503
+ * See
1504
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.dragend
1505
+ */
1506
+ this.mapDragend = this._eventManager.getLazyEmitter('dragend');
1507
+ /**
1508
+ * See
1509
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.draggable_changed
1510
+ */
1511
+ this.draggableChanged = this._eventManager.getLazyEmitter('draggable_changed');
1512
+ /**
1513
+ * See
1514
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.dragstart
1515
+ */
1516
+ this.mapDragstart = this._eventManager.getLazyEmitter('dragstart');
1517
+ /**
1518
+ * See
1519
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.flat_changed
1520
+ */
1521
+ this.flatChanged = this._eventManager.getLazyEmitter('flat_changed');
1522
+ /**
1523
+ * See
1524
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.icon_changed
1525
+ */
1526
+ this.iconChanged = this._eventManager.getLazyEmitter('icon_changed');
1527
+ /**
1528
+ * See
1529
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.mousedown
1530
+ */
1531
+ this.mapMousedown = this._eventManager.getLazyEmitter('mousedown');
1532
+ /**
1533
+ * See
1534
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.mouseout
1535
+ */
1536
+ this.mapMouseout = this._eventManager.getLazyEmitter('mouseout');
1537
+ /**
1538
+ * See
1539
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.mouseover
1540
+ */
1541
+ this.mapMouseover = this._eventManager.getLazyEmitter('mouseover');
1542
+ /**
1543
+ * See
1544
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.mouseup
1545
+ */
1546
+ this.mapMouseup = this._eventManager.getLazyEmitter('mouseup');
1547
+ /**
1548
+ * See
1549
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.position_changed
1550
+ */
1551
+ this.positionChanged = this._eventManager.getLazyEmitter('position_changed');
1552
+ /**
1553
+ * See
1554
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.rightclick
1555
+ */
1556
+ this.mapRightclick = this._eventManager.getLazyEmitter('rightclick');
1557
+ /**
1558
+ * See
1559
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.shape_changed
1560
+ */
1561
+ this.shapeChanged = this._eventManager.getLazyEmitter('shape_changed');
1562
+ /**
1563
+ * See
1564
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.title_changed
1565
+ */
1566
+ this.titleChanged = this._eventManager.getLazyEmitter('title_changed');
1567
+ /**
1568
+ * See
1569
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.visible_changed
1570
+ */
1571
+ this.visibleChanged = this._eventManager.getLazyEmitter('visible_changed');
1572
+ /**
1573
+ * See
1574
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.zindex_changed
1575
+ */
1576
+ this.zindexChanged = this._eventManager.getLazyEmitter('zindex_changed');
1577
+ }
1578
+ /**
1579
+ * Title of the marker.
1580
+ * See: developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions.title
1581
+ */
1582
+ set title(title) {
1583
+ this._title = title;
1584
+ }
1585
+ /**
1586
+ * Position of the marker. See:
1587
+ * developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions.position
1588
+ */
1589
+ set position(position) {
1590
+ this._position = position;
1591
+ }
1592
+ /**
1593
+ * Label for the marker.
1594
+ * See: developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions.label
1595
+ */
1596
+ set label(label) {
1597
+ this._label = label;
1598
+ }
1599
+ /**
1600
+ * Whether the marker is clickable. See:
1601
+ * developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions.clickable
1602
+ */
1603
+ set clickable(clickable) {
1604
+ this._clickable = clickable;
1605
+ }
1606
+ /**
1607
+ * Options used to configure the marker.
1608
+ * See: developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions
1609
+ */
1610
+ set options(options) {
1611
+ this._options = options;
1612
+ }
1613
+ /**
1614
+ * Icon to be used for the marker.
1615
+ * See: https://developers.google.com/maps/documentation/javascript/reference/marker#Icon
1616
+ */
1617
+ set icon(icon) {
1618
+ this._icon = icon;
1619
+ }
1620
+ /**
1621
+ * Whether the marker is visible.
1622
+ * See: developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions.visible
1623
+ */
1624
+ set visible(value) {
1625
+ this._visible = value;
1626
+ }
1627
+ ngOnInit() {
1628
+ if (this._googleMap._isBrowser) {
1629
+ // Create the object outside the zone so its events don't trigger change detection.
1630
+ // We'll bring it back in inside the `MapEventManager` only for the events that the
1631
+ // user has subscribed to.
1632
+ this._ngZone.runOutsideAngular(() => {
1633
+ this.marker = new google.maps.Marker(this._combineOptions());
1634
+ });
1635
+ this._assertInitialized();
1636
+ this.marker.setMap(this._googleMap.googleMap);
1637
+ this._eventManager.setTarget(this.marker);
1638
+ }
1639
+ }
1640
+ ngOnChanges(changes) {
1641
+ const { marker, _title, _position, _label, _clickable, _icon, _visible } = this;
1642
+ if (marker) {
1643
+ if (changes['options']) {
1644
+ marker.setOptions(this._combineOptions());
1645
+ }
1646
+ if (changes['title'] && _title !== undefined) {
1647
+ marker.setTitle(_title);
1648
+ }
1649
+ if (changes['position'] && _position) {
1650
+ marker.setPosition(_position);
1651
+ }
1652
+ if (changes['label'] && _label !== undefined) {
1653
+ marker.setLabel(_label);
1654
+ }
1655
+ if (changes['clickable'] && _clickable !== undefined) {
1656
+ marker.setClickable(_clickable);
1657
+ }
1658
+ if (changes['icon'] && _icon) {
1659
+ marker.setIcon(_icon);
1660
+ }
1661
+ if (changes['visible'] && _visible !== undefined) {
1662
+ marker.setVisible(_visible);
1663
+ }
1664
+ }
1665
+ }
1666
+ ngOnDestroy() {
1667
+ this._eventManager.destroy();
1668
+ if (this.marker) {
1669
+ this.marker.setMap(null);
1670
+ }
1671
+ }
1672
+ /**
1673
+ * See
1674
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getAnimation
1675
+ */
1676
+ getAnimation() {
1677
+ this._assertInitialized();
1678
+ return this.marker.getAnimation() || null;
1679
+ }
1680
+ /**
1681
+ * See
1682
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getClickable
1683
+ */
1684
+ getClickable() {
1685
+ this._assertInitialized();
1686
+ return this.marker.getClickable();
1687
+ }
1688
+ /**
1689
+ * See
1690
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getCursor
1691
+ */
1692
+ getCursor() {
1693
+ this._assertInitialized();
1694
+ return this.marker.getCursor() || null;
1695
+ }
1696
+ /**
1697
+ * See
1698
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getDraggable
1699
+ */
1700
+ getDraggable() {
1701
+ this._assertInitialized();
1702
+ return !!this.marker.getDraggable();
1703
+ }
1704
+ /**
1705
+ * See
1706
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getIcon
1707
+ */
1708
+ getIcon() {
1709
+ this._assertInitialized();
1710
+ return this.marker.getIcon() || null;
1711
+ }
1712
+ /**
1713
+ * See
1714
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getLabel
1715
+ */
1716
+ getLabel() {
1717
+ this._assertInitialized();
1718
+ return this.marker.getLabel() || null;
1719
+ }
1720
+ /**
1721
+ * See
1722
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getOpacity
1723
+ */
1724
+ getOpacity() {
1725
+ this._assertInitialized();
1726
+ return this.marker.getOpacity() || null;
1727
+ }
1728
+ /**
1729
+ * See
1730
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getPosition
1731
+ */
1732
+ getPosition() {
1733
+ this._assertInitialized();
1734
+ return this.marker.getPosition() || null;
1735
+ }
1736
+ /**
1737
+ * See
1738
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getShape
1739
+ */
1740
+ getShape() {
1741
+ this._assertInitialized();
1742
+ return this.marker.getShape() || null;
1743
+ }
1744
+ /**
1745
+ * See
1746
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getTitle
1747
+ */
1748
+ getTitle() {
1749
+ this._assertInitialized();
1750
+ return this.marker.getTitle() || null;
1751
+ }
1752
+ /**
1753
+ * See
1754
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getVisible
1755
+ */
1756
+ getVisible() {
1757
+ this._assertInitialized();
1758
+ return this.marker.getVisible();
1759
+ }
1760
+ /**
1761
+ * See
1762
+ * developers.google.com/maps/documentation/javascript/reference/marker#Marker.getZIndex
1763
+ */
1764
+ getZIndex() {
1765
+ this._assertInitialized();
1766
+ return this.marker.getZIndex() || null;
1767
+ }
1768
+ /** Gets the anchor point that can be used to attach other Google Maps objects. */
1769
+ getAnchor() {
1770
+ this._assertInitialized();
1771
+ return this.marker;
1772
+ }
1773
+ /** Creates a combined options object using the passed-in options and the individual inputs. */
1774
+ _combineOptions() {
1775
+ const options = this._options || DEFAULT_MARKER_OPTIONS;
1776
+ return {
1777
+ ...options,
1778
+ title: this._title || options.title,
1779
+ position: this._position || options.position,
1780
+ label: this._label || options.label,
1781
+ clickable: this._clickable ?? options.clickable,
1782
+ map: this._googleMap.googleMap,
1783
+ icon: this._icon || options.icon,
1784
+ visible: this._visible ?? options.visible,
1785
+ };
1786
+ }
1787
+ _assertInitialized() {
1788
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
1789
+ if (!this._googleMap.googleMap) {
1790
+ throw Error('Cannot access Google Map information before the API has been initialized. ' +
1791
+ 'Please wait for the API to load before trying to interact with it.');
1792
+ }
1793
+ if (!this.marker) {
1794
+ throw Error('Cannot interact with a Google Map Marker before it has been ' +
1795
+ 'initialized. Please wait for the Marker to load before trying to interact with it.');
1796
+ }
1797
+ }
1798
+ }
1799
+ }
1800
+ MapMarker.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapMarker, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
1801
+ MapMarker.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-next.15", type: MapMarker, selector: "map-marker", inputs: { title: "title", position: "position", label: "label", clickable: "clickable", options: "options", icon: "icon", visible: "visible" }, outputs: { animationChanged: "animationChanged", mapClick: "mapClick", clickableChanged: "clickableChanged", cursorChanged: "cursorChanged", mapDblclick: "mapDblclick", mapDrag: "mapDrag", mapDragend: "mapDragend", draggableChanged: "draggableChanged", mapDragstart: "mapDragstart", flatChanged: "flatChanged", iconChanged: "iconChanged", mapMousedown: "mapMousedown", mapMouseout: "mapMouseout", mapMouseover: "mapMouseover", mapMouseup: "mapMouseup", positionChanged: "positionChanged", mapRightclick: "mapRightclick", shapeChanged: "shapeChanged", titleChanged: "titleChanged", visibleChanged: "visibleChanged", zindexChanged: "zindexChanged" }, exportAs: ["mapMarker"], usesOnChanges: true, ngImport: i0 });
1802
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapMarker, decorators: [{
1803
+ type: Directive,
1804
+ args: [{
1805
+ selector: 'map-marker',
1806
+ exportAs: 'mapMarker',
1807
+ }]
1808
+ }], ctorParameters: function () { return [{ type: GoogleMap }, { type: i0.NgZone }]; }, propDecorators: { title: [{
1809
+ type: Input
1810
+ }], position: [{
1811
+ type: Input
1812
+ }], label: [{
1813
+ type: Input
1814
+ }], clickable: [{
1815
+ type: Input
1816
+ }], options: [{
1817
+ type: Input
1818
+ }], icon: [{
1819
+ type: Input
1820
+ }], visible: [{
1821
+ type: Input
1822
+ }], animationChanged: [{
1823
+ type: Output
1824
+ }], mapClick: [{
1825
+ type: Output
1826
+ }], clickableChanged: [{
1827
+ type: Output
1828
+ }], cursorChanged: [{
1829
+ type: Output
1830
+ }], mapDblclick: [{
1831
+ type: Output
1832
+ }], mapDrag: [{
1833
+ type: Output
1834
+ }], mapDragend: [{
1835
+ type: Output
1836
+ }], draggableChanged: [{
1837
+ type: Output
1838
+ }], mapDragstart: [{
1839
+ type: Output
1840
+ }], flatChanged: [{
1841
+ type: Output
1842
+ }], iconChanged: [{
1843
+ type: Output
1844
+ }], mapMousedown: [{
1845
+ type: Output
1846
+ }], mapMouseout: [{
1847
+ type: Output
1848
+ }], mapMouseover: [{
1849
+ type: Output
1850
+ }], mapMouseup: [{
1851
+ type: Output
1852
+ }], positionChanged: [{
1853
+ type: Output
1854
+ }], mapRightclick: [{
1855
+ type: Output
1856
+ }], shapeChanged: [{
1857
+ type: Output
1858
+ }], titleChanged: [{
1859
+ type: Output
1860
+ }], visibleChanged: [{
1861
+ type: Output
1862
+ }], zindexChanged: [{
1863
+ type: Output
1864
+ }] } });
1865
+
1866
+ /// <reference types="google.maps" />
1867
+ /** Default options for a clusterer. */
1868
+ const DEFAULT_CLUSTERER_OPTIONS = {};
1869
+ /**
1870
+ * Angular component for implementing a Google Maps Marker Clusterer.
1871
+ *
1872
+ * See https://developers.google.com/maps/documentation/javascript/marker-clustering
1873
+ */
1874
+ class MapMarkerClusterer {
1875
+ constructor(_googleMap, _ngZone) {
1876
+ this._googleMap = _googleMap;
1877
+ this._ngZone = _ngZone;
1878
+ this._currentMarkers = new Set();
1879
+ this._eventManager = new MapEventManager(this._ngZone);
1880
+ this._destroy = new Subject();
1881
+ this.ariaLabelFn = () => '';
1882
+ /**
1883
+ * See
1884
+ * googlemaps.github.io/v3-utility-library/modules/
1885
+ * _google_markerclustererplus.html#clusteringbegin
1886
+ */
1887
+ this.clusteringbegin = this._eventManager.getLazyEmitter('clusteringbegin');
1888
+ /**
1889
+ * See
1890
+ * googlemaps.github.io/v3-utility-library/modules/_google_markerclustererplus.html#clusteringend
1891
+ */
1892
+ this.clusteringend = this._eventManager.getLazyEmitter('clusteringend');
1893
+ /** Emits when a cluster has been clicked. */
1894
+ this.clusterClick = this._eventManager.getLazyEmitter('click');
1895
+ this._canInitialize = this._googleMap._isBrowser;
1896
+ }
1897
+ set averageCenter(averageCenter) {
1898
+ this._averageCenter = averageCenter;
1899
+ }
1900
+ set batchSizeIE(batchSizeIE) {
1901
+ this._batchSizeIE = batchSizeIE;
1902
+ }
1903
+ set calculator(calculator) {
1904
+ this._calculator = calculator;
1905
+ }
1906
+ set clusterClass(clusterClass) {
1907
+ this._clusterClass = clusterClass;
1908
+ }
1909
+ set enableRetinaIcons(enableRetinaIcons) {
1910
+ this._enableRetinaIcons = enableRetinaIcons;
1911
+ }
1912
+ set gridSize(gridSize) {
1913
+ this._gridSize = gridSize;
1914
+ }
1915
+ set ignoreHidden(ignoreHidden) {
1916
+ this._ignoreHidden = ignoreHidden;
1917
+ }
1918
+ set imageExtension(imageExtension) {
1919
+ this._imageExtension = imageExtension;
1920
+ }
1921
+ set imagePath(imagePath) {
1922
+ this._imagePath = imagePath;
1923
+ }
1924
+ set imageSizes(imageSizes) {
1925
+ this._imageSizes = imageSizes;
1926
+ }
1927
+ set maxZoom(maxZoom) {
1928
+ this._maxZoom = maxZoom;
1929
+ }
1930
+ set minimumClusterSize(minimumClusterSize) {
1931
+ this._minimumClusterSize = minimumClusterSize;
1932
+ }
1933
+ set styles(styles) {
1934
+ this._styles = styles;
1935
+ }
1936
+ set title(title) {
1937
+ this._title = title;
1938
+ }
1939
+ set zIndex(zIndex) {
1940
+ this._zIndex = zIndex;
1941
+ }
1942
+ set zoomOnClick(zoomOnClick) {
1943
+ this._zoomOnClick = zoomOnClick;
1944
+ }
1945
+ set options(options) {
1946
+ this._options = options;
1947
+ }
1948
+ ngOnInit() {
1949
+ if (this._canInitialize) {
1950
+ const clustererWindow = window;
1951
+ if (!clustererWindow.MarkerClusterer && (typeof ngDevMode === 'undefined' || ngDevMode)) {
1952
+ throw Error('MarkerClusterer class not found, cannot construct a marker cluster. ' +
1953
+ 'Please install the MarkerClustererPlus library: ' +
1954
+ 'https://github.com/googlemaps/js-markerclustererplus');
1955
+ }
1956
+ // Create the object outside the zone so its events don't trigger change detection.
1957
+ // We'll bring it back in inside the `MapEventManager` only for the events that the
1958
+ // user has subscribed to.
1959
+ this._ngZone.runOutsideAngular(() => {
1960
+ this.markerClusterer = new MarkerClusterer(this._googleMap.googleMap, [], this._combineOptions());
1961
+ });
1962
+ this._assertInitialized();
1963
+ this._eventManager.setTarget(this.markerClusterer);
1964
+ }
1965
+ }
1966
+ ngAfterContentInit() {
1967
+ if (this._canInitialize) {
1968
+ this._watchForMarkerChanges();
1969
+ }
1970
+ }
1971
+ ngOnChanges(changes) {
1972
+ const { markerClusterer: clusterer, ariaLabelFn, _averageCenter, _batchSizeIE, _calculator, _styles, _clusterClass, _enableRetinaIcons, _gridSize, _ignoreHidden, _imageExtension, _imagePath, _imageSizes, _maxZoom, _minimumClusterSize, _title, _zIndex, _zoomOnClick, } = this;
1973
+ if (clusterer) {
1974
+ if (changes['options']) {
1975
+ clusterer.setOptions(this._combineOptions());
1976
+ }
1977
+ if (changes['ariaLabelFn']) {
1978
+ clusterer.ariaLabelFn = ariaLabelFn;
1979
+ }
1980
+ if (changes['averageCenter'] && _averageCenter !== undefined) {
1981
+ clusterer.setAverageCenter(_averageCenter);
1982
+ }
1983
+ if (changes['batchSizeIE'] && _batchSizeIE !== undefined) {
1984
+ clusterer.setBatchSizeIE(_batchSizeIE);
1985
+ }
1986
+ if (changes['calculator'] && !!_calculator) {
1987
+ clusterer.setCalculator(_calculator);
1988
+ }
1989
+ if (changes['clusterClass'] && _clusterClass !== undefined) {
1990
+ clusterer.setClusterClass(_clusterClass);
1991
+ }
1992
+ if (changes['enableRetinaIcons'] && _enableRetinaIcons !== undefined) {
1993
+ clusterer.setEnableRetinaIcons(_enableRetinaIcons);
1994
+ }
1995
+ if (changes['gridSize'] && _gridSize !== undefined) {
1996
+ clusterer.setGridSize(_gridSize);
1997
+ }
1998
+ if (changes['ignoreHidden'] && _ignoreHidden !== undefined) {
1999
+ clusterer.setIgnoreHidden(_ignoreHidden);
2000
+ }
2001
+ if (changes['imageExtension'] && _imageExtension !== undefined) {
2002
+ clusterer.setImageExtension(_imageExtension);
2003
+ }
2004
+ if (changes['imagePath'] && _imagePath !== undefined) {
2005
+ clusterer.setImagePath(_imagePath);
2006
+ }
2007
+ if (changes['imageSizes'] && _imageSizes) {
2008
+ clusterer.setImageSizes(_imageSizes);
2009
+ }
2010
+ if (changes['maxZoom'] && _maxZoom !== undefined) {
2011
+ clusterer.setMaxZoom(_maxZoom);
2012
+ }
2013
+ if (changes['minimumClusterSize'] && _minimumClusterSize !== undefined) {
2014
+ clusterer.setMinimumClusterSize(_minimumClusterSize);
2015
+ }
2016
+ if (changes['styles'] && _styles) {
2017
+ clusterer.setStyles(_styles);
2018
+ }
2019
+ if (changes['title'] && _title !== undefined) {
2020
+ clusterer.setTitle(_title);
2021
+ }
2022
+ if (changes['zIndex'] && _zIndex !== undefined) {
2023
+ clusterer.setZIndex(_zIndex);
2024
+ }
2025
+ if (changes['zoomOnClick'] && _zoomOnClick !== undefined) {
2026
+ clusterer.setZoomOnClick(_zoomOnClick);
2027
+ }
2028
+ }
2029
+ }
2030
+ ngOnDestroy() {
2031
+ this._destroy.next();
2032
+ this._destroy.complete();
2033
+ this._eventManager.destroy();
2034
+ if (this.markerClusterer) {
2035
+ this.markerClusterer.setMap(null);
2036
+ }
2037
+ }
2038
+ fitMapToMarkers(padding) {
2039
+ this._assertInitialized();
2040
+ this.markerClusterer.fitMapToMarkers(padding);
2041
+ }
2042
+ getAverageCenter() {
2043
+ this._assertInitialized();
2044
+ return this.markerClusterer.getAverageCenter();
2045
+ }
2046
+ getBatchSizeIE() {
2047
+ this._assertInitialized();
2048
+ return this.markerClusterer.getBatchSizeIE();
2049
+ }
2050
+ getCalculator() {
2051
+ this._assertInitialized();
2052
+ return this.markerClusterer.getCalculator();
2053
+ }
2054
+ getClusterClass() {
2055
+ this._assertInitialized();
2056
+ return this.markerClusterer.getClusterClass();
2057
+ }
2058
+ getClusters() {
2059
+ this._assertInitialized();
2060
+ return this.markerClusterer.getClusters();
2061
+ }
2062
+ getEnableRetinaIcons() {
2063
+ this._assertInitialized();
2064
+ return this.markerClusterer.getEnableRetinaIcons();
2065
+ }
2066
+ getGridSize() {
2067
+ this._assertInitialized();
2068
+ return this.markerClusterer.getGridSize();
2069
+ }
2070
+ getIgnoreHidden() {
2071
+ this._assertInitialized();
2072
+ return this.markerClusterer.getIgnoreHidden();
2073
+ }
2074
+ getImageExtension() {
2075
+ this._assertInitialized();
2076
+ return this.markerClusterer.getImageExtension();
2077
+ }
2078
+ getImagePath() {
2079
+ this._assertInitialized();
2080
+ return this.markerClusterer.getImagePath();
2081
+ }
2082
+ getImageSizes() {
2083
+ this._assertInitialized();
2084
+ return this.markerClusterer.getImageSizes();
2085
+ }
2086
+ getMaxZoom() {
2087
+ this._assertInitialized();
2088
+ return this.markerClusterer.getMaxZoom();
2089
+ }
2090
+ getMinimumClusterSize() {
2091
+ this._assertInitialized();
2092
+ return this.markerClusterer.getMinimumClusterSize();
2093
+ }
2094
+ getStyles() {
2095
+ this._assertInitialized();
2096
+ return this.markerClusterer.getStyles();
2097
+ }
2098
+ getTitle() {
2099
+ this._assertInitialized();
2100
+ return this.markerClusterer.getTitle();
2101
+ }
2102
+ getTotalClusters() {
2103
+ this._assertInitialized();
2104
+ return this.markerClusterer.getTotalClusters();
2105
+ }
2106
+ getTotalMarkers() {
2107
+ this._assertInitialized();
2108
+ return this.markerClusterer.getTotalMarkers();
2109
+ }
2110
+ getZIndex() {
2111
+ this._assertInitialized();
2112
+ return this.markerClusterer.getZIndex();
2113
+ }
2114
+ getZoomOnClick() {
2115
+ this._assertInitialized();
2116
+ return this.markerClusterer.getZoomOnClick();
2117
+ }
2118
+ _combineOptions() {
2119
+ const options = this._options || DEFAULT_CLUSTERER_OPTIONS;
2120
+ return {
2121
+ ...options,
2122
+ ariaLabelFn: this.ariaLabelFn ?? options.ariaLabelFn,
2123
+ averageCenter: this._averageCenter ?? options.averageCenter,
2124
+ batchSize: this.batchSize ?? options.batchSize,
2125
+ batchSizeIE: this._batchSizeIE ?? options.batchSizeIE,
2126
+ calculator: this._calculator ?? options.calculator,
2127
+ clusterClass: this._clusterClass ?? options.clusterClass,
2128
+ enableRetinaIcons: this._enableRetinaIcons ?? options.enableRetinaIcons,
2129
+ gridSize: this._gridSize ?? options.gridSize,
2130
+ ignoreHidden: this._ignoreHidden ?? options.ignoreHidden,
2131
+ imageExtension: this._imageExtension ?? options.imageExtension,
2132
+ imagePath: this._imagePath ?? options.imagePath,
2133
+ imageSizes: this._imageSizes ?? options.imageSizes,
2134
+ maxZoom: this._maxZoom ?? options.maxZoom,
2135
+ minimumClusterSize: this._minimumClusterSize ?? options.minimumClusterSize,
2136
+ styles: this._styles ?? options.styles,
2137
+ title: this._title ?? options.title,
2138
+ zIndex: this._zIndex ?? options.zIndex,
2139
+ zoomOnClick: this._zoomOnClick ?? options.zoomOnClick,
2140
+ };
2141
+ }
2142
+ _watchForMarkerChanges() {
2143
+ this._assertInitialized();
2144
+ const initialMarkers = [];
2145
+ for (const marker of this._getInternalMarkers(this._markers.toArray())) {
2146
+ this._currentMarkers.add(marker);
2147
+ initialMarkers.push(marker);
2148
+ }
2149
+ this.markerClusterer.addMarkers(initialMarkers);
2150
+ this._markers.changes
2151
+ .pipe(takeUntil(this._destroy))
2152
+ .subscribe((markerComponents) => {
2153
+ this._assertInitialized();
2154
+ const newMarkers = new Set(this._getInternalMarkers(markerComponents));
2155
+ const markersToAdd = [];
2156
+ const markersToRemove = [];
2157
+ for (const marker of Array.from(newMarkers)) {
2158
+ if (!this._currentMarkers.has(marker)) {
2159
+ this._currentMarkers.add(marker);
2160
+ markersToAdd.push(marker);
2161
+ }
2162
+ }
2163
+ for (const marker of Array.from(this._currentMarkers)) {
2164
+ if (!newMarkers.has(marker)) {
2165
+ markersToRemove.push(marker);
2166
+ }
2167
+ }
2168
+ this.markerClusterer.addMarkers(markersToAdd, true);
2169
+ this.markerClusterer.removeMarkers(markersToRemove, true);
2170
+ this.markerClusterer.repaint();
2171
+ for (const marker of markersToRemove) {
2172
+ this._currentMarkers.delete(marker);
2173
+ }
2174
+ });
2175
+ }
2176
+ _getInternalMarkers(markers) {
2177
+ return markers
2178
+ .filter(markerComponent => !!markerComponent.marker)
2179
+ .map(markerComponent => markerComponent.marker);
2180
+ }
2181
+ _assertInitialized() {
2182
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
2183
+ if (!this._googleMap.googleMap) {
2184
+ throw Error('Cannot access Google Map information before the API has been initialized. ' +
2185
+ 'Please wait for the API to load before trying to interact with it.');
2186
+ }
2187
+ if (!this.markerClusterer) {
2188
+ throw Error('Cannot interact with a MarkerClusterer before it has been initialized. ' +
2189
+ 'Please wait for the MarkerClusterer to load before trying to interact with it.');
2190
+ }
2191
+ }
2192
+ }
2193
+ }
2194
+ MapMarkerClusterer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapMarkerClusterer, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component });
2195
+ MapMarkerClusterer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.0-next.15", type: MapMarkerClusterer, selector: "map-marker-clusterer", inputs: { ariaLabelFn: "ariaLabelFn", averageCenter: "averageCenter", batchSize: "batchSize", batchSizeIE: "batchSizeIE", calculator: "calculator", clusterClass: "clusterClass", enableRetinaIcons: "enableRetinaIcons", gridSize: "gridSize", ignoreHidden: "ignoreHidden", imageExtension: "imageExtension", imagePath: "imagePath", imageSizes: "imageSizes", maxZoom: "maxZoom", minimumClusterSize: "minimumClusterSize", styles: "styles", title: "title", zIndex: "zIndex", zoomOnClick: "zoomOnClick", options: "options" }, outputs: { clusteringbegin: "clusteringbegin", clusteringend: "clusteringend", clusterClick: "clusterClick" }, queries: [{ propertyName: "_markers", predicate: MapMarker, descendants: true }], exportAs: ["mapMarkerClusterer"], usesOnChanges: true, ngImport: i0, template: '<ng-content></ng-content>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
2196
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapMarkerClusterer, decorators: [{
2197
+ type: Component,
2198
+ args: [{
2199
+ selector: 'map-marker-clusterer',
2200
+ exportAs: 'mapMarkerClusterer',
2201
+ changeDetection: ChangeDetectionStrategy.OnPush,
2202
+ template: '<ng-content></ng-content>',
2203
+ encapsulation: ViewEncapsulation.None,
2204
+ }]
2205
+ }], ctorParameters: function () { return [{ type: GoogleMap }, { type: i0.NgZone }]; }, propDecorators: { ariaLabelFn: [{
2206
+ type: Input
2207
+ }], averageCenter: [{
2208
+ type: Input
2209
+ }], batchSize: [{
2210
+ type: Input
2211
+ }], batchSizeIE: [{
2212
+ type: Input
2213
+ }], calculator: [{
2214
+ type: Input
2215
+ }], clusterClass: [{
2216
+ type: Input
2217
+ }], enableRetinaIcons: [{
2218
+ type: Input
2219
+ }], gridSize: [{
2220
+ type: Input
2221
+ }], ignoreHidden: [{
2222
+ type: Input
2223
+ }], imageExtension: [{
2224
+ type: Input
2225
+ }], imagePath: [{
2226
+ type: Input
2227
+ }], imageSizes: [{
2228
+ type: Input
2229
+ }], maxZoom: [{
2230
+ type: Input
2231
+ }], minimumClusterSize: [{
2232
+ type: Input
2233
+ }], styles: [{
2234
+ type: Input
2235
+ }], title: [{
2236
+ type: Input
2237
+ }], zIndex: [{
2238
+ type: Input
2239
+ }], zoomOnClick: [{
2240
+ type: Input
2241
+ }], options: [{
2242
+ type: Input
2243
+ }], clusteringbegin: [{
2244
+ type: Output
2245
+ }], clusteringend: [{
2246
+ type: Output
2247
+ }], clusterClick: [{
2248
+ type: Output
2249
+ }], _markers: [{
2250
+ type: ContentChildren,
2251
+ args: [MapMarker, { descendants: true }]
2252
+ }] } });
2253
+
2254
+ /// <reference types="google.maps" />
2255
+ /**
2256
+ * Angular component that renders a Google Maps Polygon via the Google Maps JavaScript API.
2257
+ *
2258
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon
2259
+ */
2260
+ class MapPolygon {
2261
+ constructor(_map, _ngZone) {
2262
+ this._map = _map;
2263
+ this._ngZone = _ngZone;
2264
+ this._eventManager = new MapEventManager(this._ngZone);
2265
+ this._options = new BehaviorSubject({});
2266
+ this._paths = new BehaviorSubject(undefined);
2267
+ this._destroyed = new Subject();
2268
+ /**
2269
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.click
2270
+ */
2271
+ this.polygonClick = this._eventManager.getLazyEmitter('click');
2272
+ /**
2273
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.dblclick
2274
+ */
2275
+ this.polygonDblclick = this._eventManager.getLazyEmitter('dblclick');
2276
+ /**
2277
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.drag
2278
+ */
2279
+ this.polygonDrag = this._eventManager.getLazyEmitter('drag');
2280
+ /**
2281
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.dragend
2282
+ */
2283
+ this.polygonDragend = this._eventManager.getLazyEmitter('dragend');
2284
+ /**
2285
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.dragstart
2286
+ */
2287
+ this.polygonDragstart = this._eventManager.getLazyEmitter('dragstart');
2288
+ /**
2289
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.mousedown
2290
+ */
2291
+ this.polygonMousedown = this._eventManager.getLazyEmitter('mousedown');
2292
+ /**
2293
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.mousemove
2294
+ */
2295
+ this.polygonMousemove = this._eventManager.getLazyEmitter('mousemove');
2296
+ /**
2297
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.mouseout
2298
+ */
2299
+ this.polygonMouseout = this._eventManager.getLazyEmitter('mouseout');
2300
+ /**
2301
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.mouseover
2302
+ */
2303
+ this.polygonMouseover = this._eventManager.getLazyEmitter('mouseover');
2304
+ /**
2305
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.mouseup
2306
+ */
2307
+ this.polygonMouseup = this._eventManager.getLazyEmitter('mouseup');
2308
+ /**
2309
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.rightclick
2310
+ */
2311
+ this.polygonRightclick = this._eventManager.getLazyEmitter('rightclick');
2312
+ }
2313
+ set options(options) {
2314
+ this._options.next(options || {});
2315
+ }
2316
+ set paths(paths) {
2317
+ this._paths.next(paths);
2318
+ }
2319
+ ngOnInit() {
2320
+ if (this._map._isBrowser) {
2321
+ this._combineOptions()
2322
+ .pipe(take(1))
2323
+ .subscribe(options => {
2324
+ // Create the object outside the zone so its events don't trigger change detection.
2325
+ // We'll bring it back in inside the `MapEventManager` only for the events that the
2326
+ // user has subscribed to.
2327
+ this._ngZone.runOutsideAngular(() => {
2328
+ this.polygon = new google.maps.Polygon(options);
2329
+ });
2330
+ this._assertInitialized();
2331
+ this.polygon.setMap(this._map.googleMap);
2332
+ this._eventManager.setTarget(this.polygon);
2333
+ });
2334
+ this._watchForOptionsChanges();
2335
+ this._watchForPathChanges();
2336
+ }
2337
+ }
2338
+ ngOnDestroy() {
2339
+ this._eventManager.destroy();
2340
+ this._destroyed.next();
2341
+ this._destroyed.complete();
2342
+ if (this.polygon) {
2343
+ this.polygon.setMap(null);
2344
+ }
2345
+ }
2346
+ /**
2347
+ * See
2348
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.getDraggable
2349
+ */
2350
+ getDraggable() {
2351
+ this._assertInitialized();
2352
+ return this.polygon.getDraggable();
2353
+ }
2354
+ /**
2355
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.getEditable
2356
+ */
2357
+ getEditable() {
2358
+ this._assertInitialized();
2359
+ return this.polygon.getEditable();
2360
+ }
2361
+ /**
2362
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.getPath
2363
+ */
2364
+ getPath() {
2365
+ this._assertInitialized();
2366
+ return this.polygon.getPath();
2367
+ }
2368
+ /**
2369
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.getPaths
2370
+ */
2371
+ getPaths() {
2372
+ this._assertInitialized();
2373
+ return this.polygon.getPaths();
2374
+ }
2375
+ /**
2376
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polygon.getVisible
2377
+ */
2378
+ getVisible() {
2379
+ this._assertInitialized();
2380
+ return this.polygon.getVisible();
2381
+ }
2382
+ _combineOptions() {
2383
+ return combineLatest([this._options, this._paths]).pipe(map(([options, paths]) => {
2384
+ const combinedOptions = {
2385
+ ...options,
2386
+ paths: paths || options.paths,
2387
+ };
2388
+ return combinedOptions;
2389
+ }));
2390
+ }
2391
+ _watchForOptionsChanges() {
2392
+ this._options.pipe(takeUntil(this._destroyed)).subscribe(options => {
2393
+ this._assertInitialized();
2394
+ this.polygon.setOptions(options);
2395
+ });
2396
+ }
2397
+ _watchForPathChanges() {
2398
+ this._paths.pipe(takeUntil(this._destroyed)).subscribe(paths => {
2399
+ if (paths) {
2400
+ this._assertInitialized();
2401
+ this.polygon.setPaths(paths);
2402
+ }
2403
+ });
2404
+ }
2405
+ _assertInitialized() {
2406
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
2407
+ if (!this._map.googleMap) {
2408
+ throw Error('Cannot access Google Map information before the API has been initialized. ' +
2409
+ 'Please wait for the API to load before trying to interact with it.');
2410
+ }
2411
+ if (!this.polygon) {
2412
+ throw Error('Cannot interact with a Google Map Polygon before it has been ' +
2413
+ 'initialized. Please wait for the Polygon to load before trying to interact with it.');
2414
+ }
2415
+ }
2416
+ }
2417
+ }
2418
+ MapPolygon.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapPolygon, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
2419
+ MapPolygon.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-next.15", type: MapPolygon, selector: "map-polygon", inputs: { options: "options", paths: "paths" }, outputs: { polygonClick: "polygonClick", polygonDblclick: "polygonDblclick", polygonDrag: "polygonDrag", polygonDragend: "polygonDragend", polygonDragstart: "polygonDragstart", polygonMousedown: "polygonMousedown", polygonMousemove: "polygonMousemove", polygonMouseout: "polygonMouseout", polygonMouseover: "polygonMouseover", polygonMouseup: "polygonMouseup", polygonRightclick: "polygonRightclick" }, exportAs: ["mapPolygon"], ngImport: i0 });
2420
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapPolygon, decorators: [{
2421
+ type: Directive,
2422
+ args: [{
2423
+ selector: 'map-polygon',
2424
+ exportAs: 'mapPolygon',
2425
+ }]
2426
+ }], ctorParameters: function () { return [{ type: GoogleMap }, { type: i0.NgZone }]; }, propDecorators: { options: [{
2427
+ type: Input
2428
+ }], paths: [{
2429
+ type: Input
2430
+ }], polygonClick: [{
2431
+ type: Output
2432
+ }], polygonDblclick: [{
2433
+ type: Output
2434
+ }], polygonDrag: [{
2435
+ type: Output
2436
+ }], polygonDragend: [{
2437
+ type: Output
2438
+ }], polygonDragstart: [{
2439
+ type: Output
2440
+ }], polygonMousedown: [{
2441
+ type: Output
2442
+ }], polygonMousemove: [{
2443
+ type: Output
2444
+ }], polygonMouseout: [{
2445
+ type: Output
2446
+ }], polygonMouseover: [{
2447
+ type: Output
2448
+ }], polygonMouseup: [{
2449
+ type: Output
2450
+ }], polygonRightclick: [{
2451
+ type: Output
2452
+ }] } });
2453
+
2454
+ /// <reference types="google.maps" />
2455
+ /**
2456
+ * Angular component that renders a Google Maps Polyline via the Google Maps JavaScript API.
2457
+ *
2458
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline
2459
+ */
2460
+ class MapPolyline {
2461
+ constructor(_map, _ngZone) {
2462
+ this._map = _map;
2463
+ this._ngZone = _ngZone;
2464
+ this._eventManager = new MapEventManager(this._ngZone);
2465
+ this._options = new BehaviorSubject({});
2466
+ this._path = new BehaviorSubject(undefined);
2467
+ this._destroyed = new Subject();
2468
+ /**
2469
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.click
2470
+ */
2471
+ this.polylineClick = this._eventManager.getLazyEmitter('click');
2472
+ /**
2473
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.dblclick
2474
+ */
2475
+ this.polylineDblclick = this._eventManager.getLazyEmitter('dblclick');
2476
+ /**
2477
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.drag
2478
+ */
2479
+ this.polylineDrag = this._eventManager.getLazyEmitter('drag');
2480
+ /**
2481
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.dragend
2482
+ */
2483
+ this.polylineDragend = this._eventManager.getLazyEmitter('dragend');
2484
+ /**
2485
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.dragstart
2486
+ */
2487
+ this.polylineDragstart = this._eventManager.getLazyEmitter('dragstart');
2488
+ /**
2489
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.mousedown
2490
+ */
2491
+ this.polylineMousedown = this._eventManager.getLazyEmitter('mousedown');
2492
+ /**
2493
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.mousemove
2494
+ */
2495
+ this.polylineMousemove = this._eventManager.getLazyEmitter('mousemove');
2496
+ /**
2497
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.mouseout
2498
+ */
2499
+ this.polylineMouseout = this._eventManager.getLazyEmitter('mouseout');
2500
+ /**
2501
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.mouseover
2502
+ */
2503
+ this.polylineMouseover = this._eventManager.getLazyEmitter('mouseover');
2504
+ /**
2505
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.mouseup
2506
+ */
2507
+ this.polylineMouseup = this._eventManager.getLazyEmitter('mouseup');
2508
+ /**
2509
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.rightclick
2510
+ */
2511
+ this.polylineRightclick = this._eventManager.getLazyEmitter('rightclick');
2512
+ }
2513
+ set options(options) {
2514
+ this._options.next(options || {});
2515
+ }
2516
+ set path(path) {
2517
+ this._path.next(path);
2518
+ }
2519
+ ngOnInit() {
2520
+ if (this._map._isBrowser) {
2521
+ this._combineOptions()
2522
+ .pipe(take(1))
2523
+ .subscribe(options => {
2524
+ // Create the object outside the zone so its events don't trigger change detection.
2525
+ // We'll bring it back in inside the `MapEventManager` only for the events that the
2526
+ // user has subscribed to.
2527
+ this._ngZone.runOutsideAngular(() => (this.polyline = new google.maps.Polyline(options)));
2528
+ this._assertInitialized();
2529
+ this.polyline.setMap(this._map.googleMap);
2530
+ this._eventManager.setTarget(this.polyline);
2531
+ });
2532
+ this._watchForOptionsChanges();
2533
+ this._watchForPathChanges();
2534
+ }
2535
+ }
2536
+ ngOnDestroy() {
2537
+ this._eventManager.destroy();
2538
+ this._destroyed.next();
2539
+ this._destroyed.complete();
2540
+ if (this.polyline) {
2541
+ this.polyline.setMap(null);
2542
+ }
2543
+ }
2544
+ /**
2545
+ * See
2546
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.getDraggable
2547
+ */
2548
+ getDraggable() {
2549
+ this._assertInitialized();
2550
+ return this.polyline.getDraggable();
2551
+ }
2552
+ /**
2553
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.getEditable
2554
+ */
2555
+ getEditable() {
2556
+ this._assertInitialized();
2557
+ return this.polyline.getEditable();
2558
+ }
2559
+ /**
2560
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.getPath
2561
+ */
2562
+ getPath() {
2563
+ this._assertInitialized();
2564
+ return this.polyline.getPath();
2565
+ }
2566
+ /**
2567
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Polyline.getVisible
2568
+ */
2569
+ getVisible() {
2570
+ this._assertInitialized();
2571
+ return this.polyline.getVisible();
2572
+ }
2573
+ _combineOptions() {
2574
+ return combineLatest([this._options, this._path]).pipe(map(([options, path]) => {
2575
+ const combinedOptions = {
2576
+ ...options,
2577
+ path: path || options.path,
2578
+ };
2579
+ return combinedOptions;
2580
+ }));
2581
+ }
2582
+ _watchForOptionsChanges() {
2583
+ this._options.pipe(takeUntil(this._destroyed)).subscribe(options => {
2584
+ this._assertInitialized();
2585
+ this.polyline.setOptions(options);
2586
+ });
2587
+ }
2588
+ _watchForPathChanges() {
2589
+ this._path.pipe(takeUntil(this._destroyed)).subscribe(path => {
2590
+ if (path) {
2591
+ this._assertInitialized();
2592
+ this.polyline.setPath(path);
2593
+ }
2594
+ });
2595
+ }
2596
+ _assertInitialized() {
2597
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
2598
+ if (!this._map.googleMap) {
2599
+ throw Error('Cannot access Google Map information before the API has been initialized. ' +
2600
+ 'Please wait for the API to load before trying to interact with it.');
2601
+ }
2602
+ if (!this.polyline) {
2603
+ throw Error('Cannot interact with a Google Map Polyline before it has been ' +
2604
+ 'initialized. Please wait for the Polyline to load before trying to interact with it.');
2605
+ }
2606
+ }
2607
+ }
2608
+ }
2609
+ MapPolyline.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapPolyline, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
2610
+ MapPolyline.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-next.15", type: MapPolyline, selector: "map-polyline", inputs: { options: "options", path: "path" }, outputs: { polylineClick: "polylineClick", polylineDblclick: "polylineDblclick", polylineDrag: "polylineDrag", polylineDragend: "polylineDragend", polylineDragstart: "polylineDragstart", polylineMousedown: "polylineMousedown", polylineMousemove: "polylineMousemove", polylineMouseout: "polylineMouseout", polylineMouseover: "polylineMouseover", polylineMouseup: "polylineMouseup", polylineRightclick: "polylineRightclick" }, exportAs: ["mapPolyline"], ngImport: i0 });
2611
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapPolyline, decorators: [{
2612
+ type: Directive,
2613
+ args: [{
2614
+ selector: 'map-polyline',
2615
+ exportAs: 'mapPolyline',
2616
+ }]
2617
+ }], ctorParameters: function () { return [{ type: GoogleMap }, { type: i0.NgZone }]; }, propDecorators: { options: [{
2618
+ type: Input
2619
+ }], path: [{
2620
+ type: Input
2621
+ }], polylineClick: [{
2622
+ type: Output
2623
+ }], polylineDblclick: [{
2624
+ type: Output
2625
+ }], polylineDrag: [{
2626
+ type: Output
2627
+ }], polylineDragend: [{
2628
+ type: Output
2629
+ }], polylineDragstart: [{
2630
+ type: Output
2631
+ }], polylineMousedown: [{
2632
+ type: Output
2633
+ }], polylineMousemove: [{
2634
+ type: Output
2635
+ }], polylineMouseout: [{
2636
+ type: Output
2637
+ }], polylineMouseover: [{
2638
+ type: Output
2639
+ }], polylineMouseup: [{
2640
+ type: Output
2641
+ }], polylineRightclick: [{
2642
+ type: Output
2643
+ }] } });
2644
+
2645
+ /// <reference types="google.maps" />
2646
+ /**
2647
+ * Angular component that renders a Google Maps Rectangle via the Google Maps JavaScript API.
2648
+ *
2649
+ * See developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle
2650
+ */
2651
+ class MapRectangle {
2652
+ constructor(_map, _ngZone) {
2653
+ this._map = _map;
2654
+ this._ngZone = _ngZone;
2655
+ this._eventManager = new MapEventManager(this._ngZone);
2656
+ this._options = new BehaviorSubject({});
2657
+ this._bounds = new BehaviorSubject(undefined);
2658
+ this._destroyed = new Subject();
2659
+ /**
2660
+ * See
2661
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.boundsChanged
2662
+ */ this.boundsChanged = this._eventManager.getLazyEmitter('bounds_changed');
2663
+ /**
2664
+ * See
2665
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.click
2666
+ */
2667
+ this.rectangleClick = this._eventManager.getLazyEmitter('click');
2668
+ /**
2669
+ * See
2670
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.dblclick
2671
+ */
2672
+ this.rectangleDblclick = this._eventManager.getLazyEmitter('dblclick');
2673
+ /**
2674
+ * See
2675
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.drag
2676
+ */
2677
+ this.rectangleDrag = this._eventManager.getLazyEmitter('drag');
2678
+ /**
2679
+ * See
2680
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.dragend
2681
+ */
2682
+ this.rectangleDragend = this._eventManager.getLazyEmitter('dragend');
2683
+ /**
2684
+ * See
2685
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.dragstart
2686
+ */
2687
+ this.rectangleDragstart = this._eventManager.getLazyEmitter('dragstart');
2688
+ /**
2689
+ * See
2690
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.mousedown
2691
+ */
2692
+ this.rectangleMousedown = this._eventManager.getLazyEmitter('mousedown');
2693
+ /**
2694
+ * See
2695
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.mousemove
2696
+ */
2697
+ this.rectangleMousemove = this._eventManager.getLazyEmitter('mousemove');
2698
+ /**
2699
+ * See
2700
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.mouseout
2701
+ */
2702
+ this.rectangleMouseout = this._eventManager.getLazyEmitter('mouseout');
2703
+ /**
2704
+ * See
2705
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.mouseover
2706
+ */
2707
+ this.rectangleMouseover = this._eventManager.getLazyEmitter('mouseover');
2708
+ /**
2709
+ * See
2710
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.mouseup
2711
+ */
2712
+ this.rectangleMouseup = this._eventManager.getLazyEmitter('mouseup');
2713
+ /**
2714
+ * See
2715
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.rightclick
2716
+ */
2717
+ this.rectangleRightclick = this._eventManager.getLazyEmitter('rightclick');
2718
+ }
2719
+ set options(options) {
2720
+ this._options.next(options || {});
2721
+ }
2722
+ set bounds(bounds) {
2723
+ this._bounds.next(bounds);
2724
+ }
2725
+ ngOnInit() {
2726
+ if (this._map._isBrowser) {
2727
+ this._combineOptions()
2728
+ .pipe(take(1))
2729
+ .subscribe(options => {
2730
+ // Create the object outside the zone so its events don't trigger change detection.
2731
+ // We'll bring it back in inside the `MapEventManager` only for the events that the
2732
+ // user has subscribed to.
2733
+ this._ngZone.runOutsideAngular(() => {
2734
+ this.rectangle = new google.maps.Rectangle(options);
2735
+ });
2736
+ this._assertInitialized();
2737
+ this.rectangle.setMap(this._map.googleMap);
2738
+ this._eventManager.setTarget(this.rectangle);
2739
+ });
2740
+ this._watchForOptionsChanges();
2741
+ this._watchForBoundsChanges();
2742
+ }
2743
+ }
2744
+ ngOnDestroy() {
2745
+ this._eventManager.destroy();
2746
+ this._destroyed.next();
2747
+ this._destroyed.complete();
2748
+ if (this.rectangle) {
2749
+ this.rectangle.setMap(null);
2750
+ }
2751
+ }
2752
+ /**
2753
+ * See
2754
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.getBounds
2755
+ */
2756
+ getBounds() {
2757
+ this._assertInitialized();
2758
+ return this.rectangle.getBounds();
2759
+ }
2760
+ /**
2761
+ * See
2762
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.getDraggable
2763
+ */
2764
+ getDraggable() {
2765
+ this._assertInitialized();
2766
+ return this.rectangle.getDraggable();
2767
+ }
2768
+ /**
2769
+ * See
2770
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.getEditable
2771
+ */
2772
+ getEditable() {
2773
+ this._assertInitialized();
2774
+ return this.rectangle.getEditable();
2775
+ }
2776
+ /**
2777
+ * See
2778
+ * developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.getVisible
2779
+ */
2780
+ getVisible() {
2781
+ this._assertInitialized();
2782
+ return this.rectangle.getVisible();
2783
+ }
2784
+ _combineOptions() {
2785
+ return combineLatest([this._options, this._bounds]).pipe(map(([options, bounds]) => {
2786
+ const combinedOptions = {
2787
+ ...options,
2788
+ bounds: bounds || options.bounds,
2789
+ };
2790
+ return combinedOptions;
2791
+ }));
2792
+ }
2793
+ _watchForOptionsChanges() {
2794
+ this._options.pipe(takeUntil(this._destroyed)).subscribe(options => {
2795
+ this._assertInitialized();
2796
+ this.rectangle.setOptions(options);
2797
+ });
2798
+ }
2799
+ _watchForBoundsChanges() {
2800
+ this._bounds.pipe(takeUntil(this._destroyed)).subscribe(bounds => {
2801
+ if (bounds) {
2802
+ this._assertInitialized();
2803
+ this.rectangle.setBounds(bounds);
2804
+ }
2805
+ });
2806
+ }
2807
+ _assertInitialized() {
2808
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
2809
+ if (!this._map.googleMap) {
2810
+ throw Error('Cannot access Google Map information before the API has been initialized. ' +
2811
+ 'Please wait for the API to load before trying to interact with it.');
2812
+ }
2813
+ if (!this.rectangle) {
2814
+ throw Error('Cannot interact with a Google Map Rectangle before it has been initialized. ' +
2815
+ 'Please wait for the Rectangle to load before trying to interact with it.');
2816
+ }
2817
+ }
2818
+ }
2819
+ }
2820
+ MapRectangle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapRectangle, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
2821
+ MapRectangle.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-next.15", type: MapRectangle, selector: "map-rectangle", inputs: { options: "options", bounds: "bounds" }, outputs: { boundsChanged: "boundsChanged", rectangleClick: "rectangleClick", rectangleDblclick: "rectangleDblclick", rectangleDrag: "rectangleDrag", rectangleDragend: "rectangleDragend", rectangleDragstart: "rectangleDragstart", rectangleMousedown: "rectangleMousedown", rectangleMousemove: "rectangleMousemove", rectangleMouseout: "rectangleMouseout", rectangleMouseover: "rectangleMouseover", rectangleMouseup: "rectangleMouseup", rectangleRightclick: "rectangleRightclick" }, exportAs: ["mapRectangle"], ngImport: i0 });
2822
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapRectangle, decorators: [{
2823
+ type: Directive,
2824
+ args: [{
2825
+ selector: 'map-rectangle',
2826
+ exportAs: 'mapRectangle',
2827
+ }]
2828
+ }], ctorParameters: function () { return [{ type: GoogleMap }, { type: i0.NgZone }]; }, propDecorators: { options: [{
2829
+ type: Input
2830
+ }], bounds: [{
2831
+ type: Input
2832
+ }], boundsChanged: [{
2833
+ type: Output
2834
+ }], rectangleClick: [{
2835
+ type: Output
2836
+ }], rectangleDblclick: [{
2837
+ type: Output
2838
+ }], rectangleDrag: [{
2839
+ type: Output
2840
+ }], rectangleDragend: [{
2841
+ type: Output
2842
+ }], rectangleDragstart: [{
2843
+ type: Output
2844
+ }], rectangleMousedown: [{
2845
+ type: Output
2846
+ }], rectangleMousemove: [{
2847
+ type: Output
2848
+ }], rectangleMouseout: [{
2849
+ type: Output
2850
+ }], rectangleMouseover: [{
2851
+ type: Output
2852
+ }], rectangleMouseup: [{
2853
+ type: Output
2854
+ }], rectangleRightclick: [{
2855
+ type: Output
2856
+ }] } });
2857
+
2858
+ /// <reference types="google.maps" />
2859
+ /**
2860
+ * Angular component that renders a Google Maps Traffic Layer via the Google Maps JavaScript API.
2861
+ *
2862
+ * See developers.google.com/maps/documentation/javascript/reference/map#TrafficLayer
2863
+ */
2864
+ class MapTrafficLayer {
2865
+ constructor(_map, _ngZone) {
2866
+ this._map = _map;
2867
+ this._ngZone = _ngZone;
2868
+ this._autoRefresh = new BehaviorSubject(true);
2869
+ this._destroyed = new Subject();
2870
+ }
2871
+ /**
2872
+ * Whether the traffic layer refreshes with updated information automatically.
2873
+ */
2874
+ set autoRefresh(autoRefresh) {
2875
+ this._autoRefresh.next(autoRefresh);
2876
+ }
2877
+ ngOnInit() {
2878
+ if (this._map._isBrowser) {
2879
+ this._combineOptions()
2880
+ .pipe(take(1))
2881
+ .subscribe(options => {
2882
+ // Create the object outside the zone so its events don't trigger change detection.
2883
+ this._ngZone.runOutsideAngular(() => {
2884
+ this.trafficLayer = new google.maps.TrafficLayer(options);
2885
+ });
2886
+ this._assertInitialized();
2887
+ this.trafficLayer.setMap(this._map.googleMap);
2888
+ });
2889
+ this._watchForAutoRefreshChanges();
2890
+ }
2891
+ }
2892
+ ngOnDestroy() {
2893
+ this._destroyed.next();
2894
+ this._destroyed.complete();
2895
+ if (this.trafficLayer) {
2896
+ this.trafficLayer.setMap(null);
2897
+ }
2898
+ }
2899
+ _combineOptions() {
2900
+ return this._autoRefresh.pipe(map(autoRefresh => {
2901
+ const combinedOptions = { autoRefresh };
2902
+ return combinedOptions;
2903
+ }));
2904
+ }
2905
+ _watchForAutoRefreshChanges() {
2906
+ this._combineOptions()
2907
+ .pipe(takeUntil(this._destroyed))
2908
+ .subscribe(options => {
2909
+ this._assertInitialized();
2910
+ this.trafficLayer.setOptions(options);
2911
+ });
2912
+ }
2913
+ _assertInitialized() {
2914
+ if (!this._map.googleMap) {
2915
+ throw Error('Cannot access Google Map information before the API has been initialized. ' +
2916
+ 'Please wait for the API to load before trying to interact with it.');
2917
+ }
2918
+ if (!this.trafficLayer) {
2919
+ throw Error('Cannot interact with a Google Map Traffic Layer before it has been initialized. ' +
2920
+ 'Please wait for the Traffic Layer to load before trying to interact with it.');
2921
+ }
2922
+ }
2923
+ }
2924
+ MapTrafficLayer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapTrafficLayer, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
2925
+ MapTrafficLayer.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-next.15", type: MapTrafficLayer, selector: "map-traffic-layer", inputs: { autoRefresh: "autoRefresh" }, exportAs: ["mapTrafficLayer"], ngImport: i0 });
2926
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapTrafficLayer, decorators: [{
2927
+ type: Directive,
2928
+ args: [{
2929
+ selector: 'map-traffic-layer',
2930
+ exportAs: 'mapTrafficLayer',
2931
+ }]
2932
+ }], ctorParameters: function () { return [{ type: GoogleMap }, { type: i0.NgZone }]; }, propDecorators: { autoRefresh: [{
2933
+ type: Input
2934
+ }] } });
2935
+
2936
+ /// <reference types="google.maps" />
2937
+ /**
2938
+ * Angular component that renders a Google Maps Transit Layer via the Google Maps JavaScript API.
2939
+ *
2940
+ * See developers.google.com/maps/documentation/javascript/reference/map#TransitLayer
2941
+ */
2942
+ class MapTransitLayer extends MapBaseLayer {
2943
+ _initializeObject() {
2944
+ this.transitLayer = new google.maps.TransitLayer();
2945
+ }
2946
+ _setMap() {
2947
+ this._assertLayerInitialized();
2948
+ this.transitLayer.setMap(this._map.googleMap);
2949
+ }
2950
+ _unsetMap() {
2951
+ if (this.transitLayer) {
2952
+ this.transitLayer.setMap(null);
2953
+ }
2954
+ }
2955
+ _assertLayerInitialized() {
2956
+ if (!this.transitLayer) {
2957
+ throw Error('Cannot interact with a Google Map Transit Layer before it has been initialized. ' +
2958
+ 'Please wait for the Transit Layer to load before trying to interact with it.');
2959
+ }
2960
+ }
2961
+ }
2962
+ MapTransitLayer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapTransitLayer, deps: null, target: i0.ɵɵFactoryTarget.Directive });
2963
+ MapTransitLayer.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-next.15", type: MapTransitLayer, selector: "map-transit-layer", exportAs: ["mapTransitLayer"], usesInheritance: true, ngImport: i0 });
2964
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapTransitLayer, decorators: [{
2965
+ type: Directive,
2966
+ args: [{
2967
+ selector: 'map-transit-layer',
2968
+ exportAs: 'mapTransitLayer',
2969
+ }]
2970
+ }] });
2971
+
2972
+ /// <reference types="google.maps" />
2973
+ /**
2974
+ * Angular directive that renders a Google Maps heatmap via the Google Maps JavaScript API.
2975
+ *
2976
+ * See: https://developers.google.com/maps/documentation/javascript/reference/visualization
2977
+ */
2978
+ class MapHeatmapLayer {
2979
+ constructor(_googleMap, _ngZone) {
2980
+ this._googleMap = _googleMap;
2981
+ this._ngZone = _ngZone;
2982
+ }
2983
+ /**
2984
+ * Data shown on the heatmap.
2985
+ * See: https://developers.google.com/maps/documentation/javascript/reference/visualization
2986
+ */
2987
+ set data(data) {
2988
+ this._data = data;
2989
+ }
2990
+ /**
2991
+ * Options used to configure the heatmap. See:
2992
+ * developers.google.com/maps/documentation/javascript/reference/visualization#HeatmapLayerOptions
2993
+ */
2994
+ set options(options) {
2995
+ this._options = options;
2996
+ }
2997
+ ngOnInit() {
2998
+ if (this._googleMap._isBrowser) {
2999
+ if (!window.google?.maps?.visualization && (typeof ngDevMode === 'undefined' || ngDevMode)) {
3000
+ throw Error('Namespace `google.maps.visualization` not found, cannot construct heatmap. ' +
3001
+ 'Please install the Google Maps JavaScript API with the "visualization" library: ' +
3002
+ 'https://developers.google.com/maps/documentation/javascript/visualization');
3003
+ }
3004
+ // Create the object outside the zone so its events don't trigger change detection.
3005
+ // We'll bring it back in inside the `MapEventManager` only for the events that the
3006
+ // user has subscribed to.
3007
+ this._ngZone.runOutsideAngular(() => {
3008
+ this.heatmap = new google.maps.visualization.HeatmapLayer(this._combineOptions());
3009
+ });
3010
+ this._assertInitialized();
3011
+ this.heatmap.setMap(this._googleMap.googleMap);
3012
+ }
3013
+ }
3014
+ ngOnChanges(changes) {
3015
+ const { _data, heatmap } = this;
3016
+ if (heatmap) {
3017
+ if (changes['options']) {
3018
+ heatmap.setOptions(this._combineOptions());
3019
+ }
3020
+ if (changes['data'] && _data !== undefined) {
3021
+ heatmap.setData(this._normalizeData(_data));
3022
+ }
3023
+ }
3024
+ }
3025
+ ngOnDestroy() {
3026
+ if (this.heatmap) {
3027
+ this.heatmap.setMap(null);
3028
+ }
3029
+ }
3030
+ /**
3031
+ * Gets the data that is currently shown on the heatmap.
3032
+ * See: developers.google.com/maps/documentation/javascript/reference/visualization#HeatmapLayer
3033
+ */
3034
+ getData() {
3035
+ this._assertInitialized();
3036
+ return this.heatmap.getData();
3037
+ }
3038
+ /** Creates a combined options object using the passed-in options and the individual inputs. */
3039
+ _combineOptions() {
3040
+ const options = this._options || {};
3041
+ return {
3042
+ ...options,
3043
+ data: this._normalizeData(this._data || options.data || []),
3044
+ map: this._googleMap.googleMap,
3045
+ };
3046
+ }
3047
+ /**
3048
+ * Most Google Maps APIs support both `LatLng` objects and `LatLngLiteral`. The latter is more
3049
+ * convenient to write out, because the Google Maps API doesn't have to have been loaded in order
3050
+ * to construct them. The `HeatmapLayer` appears to be an exception that only allows a `LatLng`
3051
+ * object, or it throws a runtime error. Since it's more convenient and we expect that Angular
3052
+ * users will load the API asynchronously, we allow them to pass in a `LatLngLiteral` and we
3053
+ * convert it to a `LatLng` object before passing it off to Google Maps.
3054
+ */
3055
+ _normalizeData(data) {
3056
+ const result = [];
3057
+ data.forEach(item => {
3058
+ result.push(isLatLngLiteral(item) ? new google.maps.LatLng(item.lat, item.lng) : item);
3059
+ });
3060
+ return result;
3061
+ }
3062
+ /** Asserts that the heatmap object has been initialized. */
3063
+ _assertInitialized() {
3064
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
3065
+ if (!this._googleMap.googleMap) {
3066
+ throw Error('Cannot access Google Map information before the API has been initialized. ' +
3067
+ 'Please wait for the API to load before trying to interact with it.');
3068
+ }
3069
+ if (!this.heatmap) {
3070
+ throw Error('Cannot interact with a Google Map HeatmapLayer before it has been ' +
3071
+ 'initialized. Please wait for the heatmap to load before trying to interact with it.');
3072
+ }
3073
+ }
3074
+ }
3075
+ }
3076
+ MapHeatmapLayer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapHeatmapLayer, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive });
3077
+ MapHeatmapLayer.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.0-next.15", type: MapHeatmapLayer, selector: "map-heatmap-layer", inputs: { data: "data", options: "options" }, exportAs: ["mapHeatmapLayer"], usesOnChanges: true, ngImport: i0 });
3078
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapHeatmapLayer, decorators: [{
3079
+ type: Directive,
3080
+ args: [{
3081
+ selector: 'map-heatmap-layer',
3082
+ exportAs: 'mapHeatmapLayer',
3083
+ }]
3084
+ }], ctorParameters: function () { return [{ type: GoogleMap }, { type: i0.NgZone }]; }, propDecorators: { data: [{
3085
+ type: Input
3086
+ }], options: [{
3087
+ type: Input
3088
+ }] } });
3089
+ /** Asserts that an object is a `LatLngLiteral`. */
3090
+ function isLatLngLiteral(value) {
3091
+ return value && typeof value.lat === 'number' && typeof value.lng === 'number';
3092
+ }
3093
+
3094
+ /**
3095
+ * @license
3096
+ * Copyright Google LLC All Rights Reserved.
3097
+ *
3098
+ * Use of this source code is governed by an MIT-style license that can be
3099
+ * found in the LICENSE file at https://angular.io/license
3100
+ */
3101
+ const COMPONENTS = [
3102
+ GoogleMap,
3103
+ MapBaseLayer,
3104
+ MapBicyclingLayer,
3105
+ MapCircle,
3106
+ MapDirectionsRenderer,
3107
+ MapGroundOverlay,
3108
+ MapInfoWindow,
3109
+ MapKmlLayer,
3110
+ MapMarker,
3111
+ MapMarkerClusterer,
3112
+ MapPolygon,
3113
+ MapPolyline,
3114
+ MapRectangle,
3115
+ MapTrafficLayer,
3116
+ MapTransitLayer,
3117
+ MapHeatmapLayer,
3118
+ ];
3119
+ class GoogleMapsModule {
3120
+ }
3121
+ GoogleMapsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: GoogleMapsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
3122
+ GoogleMapsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: GoogleMapsModule, declarations: [GoogleMap,
3123
+ MapBaseLayer,
3124
+ MapBicyclingLayer,
3125
+ MapCircle,
3126
+ MapDirectionsRenderer,
3127
+ MapGroundOverlay,
3128
+ MapInfoWindow,
3129
+ MapKmlLayer,
3130
+ MapMarker,
3131
+ MapMarkerClusterer,
3132
+ MapPolygon,
3133
+ MapPolyline,
3134
+ MapRectangle,
3135
+ MapTrafficLayer,
3136
+ MapTransitLayer,
3137
+ MapHeatmapLayer], exports: [GoogleMap,
3138
+ MapBaseLayer,
3139
+ MapBicyclingLayer,
3140
+ MapCircle,
3141
+ MapDirectionsRenderer,
3142
+ MapGroundOverlay,
3143
+ MapInfoWindow,
3144
+ MapKmlLayer,
3145
+ MapMarker,
3146
+ MapMarkerClusterer,
3147
+ MapPolygon,
3148
+ MapPolyline,
3149
+ MapRectangle,
3150
+ MapTrafficLayer,
3151
+ MapTransitLayer,
3152
+ MapHeatmapLayer] });
3153
+ GoogleMapsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: GoogleMapsModule });
3154
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: GoogleMapsModule, decorators: [{
3155
+ type: NgModule,
3156
+ args: [{
3157
+ declarations: COMPONENTS,
3158
+ exports: COMPONENTS,
3159
+ }]
3160
+ }] });
3161
+
3162
+ /// <reference types="google.maps" />
3163
+ /**
3164
+ * Angular service that wraps the Google Maps DirectionsService from the Google Maps JavaScript
3165
+ * API.
3166
+ *
3167
+ * See developers.google.com/maps/documentation/javascript/reference/directions#DirectionsService
3168
+ */
3169
+ class MapDirectionsService {
3170
+ constructor(_ngZone) {
3171
+ this._ngZone = _ngZone;
3172
+ }
3173
+ /**
3174
+ * See
3175
+ * developers.google.com/maps/documentation/javascript/reference/directions
3176
+ * #DirectionsService.route
3177
+ */
3178
+ route(request) {
3179
+ return new Observable(observer => {
3180
+ // Initialize the `DirectionsService` lazily since the Google Maps API may
3181
+ // not have been loaded when the provider is instantiated.
3182
+ if (!this._directionsService) {
3183
+ this._directionsService = new google.maps.DirectionsService();
3184
+ }
3185
+ this._directionsService.route(request, (result, status) => {
3186
+ this._ngZone.run(() => {
3187
+ observer.next({ result: result || undefined, status });
3188
+ observer.complete();
3189
+ });
3190
+ });
3191
+ });
3192
+ }
3193
+ }
3194
+ MapDirectionsService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapDirectionsService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
3195
+ MapDirectionsService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapDirectionsService, providedIn: 'root' });
3196
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapDirectionsService, decorators: [{
3197
+ type: Injectable,
3198
+ args: [{ providedIn: 'root' }]
3199
+ }], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
3200
+
3201
+ /// <reference types="google.maps" />
3202
+ /**
3203
+ * Angular service that wraps the Google Maps Geocoder from the Google Maps JavaScript API.
3204
+ * See developers.google.com/maps/documentation/javascript/reference/geocoder#Geocoder
3205
+ */
3206
+ class MapGeocoder {
3207
+ constructor(_ngZone) {
3208
+ this._ngZone = _ngZone;
3209
+ }
3210
+ /**
3211
+ * See developers.google.com/maps/documentation/javascript/reference/geocoder#Geocoder.geocode
3212
+ */
3213
+ geocode(request) {
3214
+ return new Observable(observer => {
3215
+ // Initialize the `Geocoder` lazily since the Google Maps API may
3216
+ // not have been loaded when the provider is instantiated.
3217
+ if (!this._geocoder) {
3218
+ this._geocoder = new google.maps.Geocoder();
3219
+ }
3220
+ this._geocoder.geocode(request, (results, status) => {
3221
+ this._ngZone.run(() => {
3222
+ observer.next({ results: results || [], status });
3223
+ observer.complete();
3224
+ });
3225
+ });
3226
+ });
3227
+ }
3228
+ }
3229
+ MapGeocoder.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapGeocoder, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
3230
+ MapGeocoder.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapGeocoder, providedIn: 'root' });
3231
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-next.15", ngImport: i0, type: MapGeocoder, decorators: [{
3232
+ type: Injectable,
3233
+ args: [{ providedIn: 'root' }]
3234
+ }], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
3235
+
3236
+ /**
3237
+ * @license
3238
+ * Copyright Google LLC All Rights Reserved.
3239
+ *
3240
+ * Use of this source code is governed by an MIT-style license that can be
3241
+ * found in the LICENSE file at https://angular.io/license
3242
+ */
3243
+
3244
+ /**
3245
+ * @license
3246
+ * Copyright Google LLC All Rights Reserved.
3247
+ *
3248
+ * Use of this source code is governed by an MIT-style license that can be
3249
+ * found in the LICENSE file at https://angular.io/license
3250
+ */
3251
+
3252
+ /**
3253
+ * Generated bundle index. Do not edit.
3254
+ */
3255
+
3256
+ export { GoogleMap, GoogleMapsModule, MapBaseLayer, MapBicyclingLayer, MapCircle, MapDirectionsRenderer, MapDirectionsService, MapGeocoder, MapGroundOverlay, MapHeatmapLayer, MapInfoWindow, MapKmlLayer, MapMarker, MapMarkerClusterer, MapPolygon, MapPolyline, MapRectangle, MapTrafficLayer, MapTransitLayer };
3257
+ //# sourceMappingURL=google-maps.mjs.map