@angular/google-maps 19.0.0-next.0 → 19.0.0-next.10

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 (36) hide show
  1. package/fesm2022/google-maps.mjs +369 -164
  2. package/fesm2022/google-maps.mjs.map +1 -1
  3. package/index.d.ts +344 -109
  4. package/package.json +7 -4
  5. package/schematics/migration.json +9 -0
  6. package/schematics/ng-add/index.d.ts +1 -1
  7. package/schematics/ng-add/index.js +2 -2
  8. package/schematics/ng-add/index.mjs +2 -2
  9. package/schematics/ng-update/index_bundled.js +115 -0
  10. package/schematics/ng-update/index_bundled.js.map +7 -0
  11. package/esm2022/google-map/google-map.mjs +0 -473
  12. package/esm2022/google-maps-module.mjs +0 -90
  13. package/esm2022/google-maps_public_index.mjs +0 -5
  14. package/esm2022/index.mjs +0 -9
  15. package/esm2022/map-advanced-marker/map-advanced-marker.mjs +0 -217
  16. package/esm2022/map-anchor-point.mjs +0 -10
  17. package/esm2022/map-base-layer.mjs +0 -51
  18. package/esm2022/map-bicycling-layer/map-bicycling-layer.mjs +0 -69
  19. package/esm2022/map-circle/map-circle.mjs +0 -280
  20. package/esm2022/map-directions-renderer/map-directions-renderer.mjs +0 -149
  21. package/esm2022/map-directions-renderer/map-directions-service.mjs +0 -61
  22. package/esm2022/map-event-manager.mjs +0 -73
  23. package/esm2022/map-geocoder/map-geocoder.mjs +0 -57
  24. package/esm2022/map-ground-overlay/map-ground-overlay.mjs +0 -193
  25. package/esm2022/map-heatmap-layer/map-heatmap-layer.mjs +0 -151
  26. package/esm2022/map-info-window/map-info-window.mjs +0 -238
  27. package/esm2022/map-kml-layer/map-kml-layer.mjs +0 -183
  28. package/esm2022/map-marker/map-marker.mjs +0 -447
  29. package/esm2022/map-marker-clusterer/map-marker-clusterer.mjs +0 -421
  30. package/esm2022/map-marker-clusterer/marker-clusterer-types.mjs +0 -10
  31. package/esm2022/map-polygon/map-polygon.mjs +0 -227
  32. package/esm2022/map-polyline/map-polyline.mjs +0 -220
  33. package/esm2022/map-rectangle/map-rectangle.mjs +0 -240
  34. package/esm2022/map-traffic-layer/map-traffic-layer.mjs +0 -103
  35. package/esm2022/map-transit-layer/map-transit-layer.mjs +0 -69
  36. package/esm2022/public-api.mjs +0 -29
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, NgZone, EventEmitter, PLATFORM_ID, Component, ChangeDetectionStrategy, ViewEncapsulation, Inject, Input, Output, Directive, ContentChildren, NgModule, Injectable } from '@angular/core';
2
+ import { inject, ElementRef, NgZone, EventEmitter, PLATFORM_ID, Component, ChangeDetectionStrategy, ViewEncapsulation, Input, Output, Directive, InjectionToken, ContentChildren, NgModule, Injectable } from '@angular/core';
3
3
  import { isPlatformBrowser } from '@angular/common';
4
- import { BehaviorSubject, Observable, Subject, combineLatest } from 'rxjs';
4
+ import { BehaviorSubject, Observable, Subject, combineLatest, Subscription } from 'rxjs';
5
5
  import { switchMap, take, map, takeUntil } from 'rxjs/operators';
6
6
 
7
7
  /** Manages event on a Google Maps object, ensuring that events are added only when necessary. */
@@ -95,9 +95,9 @@ class GoogleMap {
95
95
  set options(options) {
96
96
  this._options = options || DEFAULT_OPTIONS;
97
97
  }
98
- constructor(_elementRef, _ngZone, platformId) {
99
- this._elementRef = _elementRef;
100
- this._ngZone = _ngZone;
98
+ constructor() {
99
+ this._elementRef = inject(ElementRef);
100
+ this._ngZone = inject(NgZone);
101
101
  this._eventManager = new MapEventManager(inject(NgZone));
102
102
  /** Height of the map. Set this to `null` if you'd like to control the height through CSS. */
103
103
  this.height = DEFAULT_HEIGHT;
@@ -201,6 +201,7 @@ class GoogleMap {
201
201
  * https://developers.google.com/maps/documentation/javascript/reference/map#Map.zoom_changed
202
202
  */
203
203
  this.zoomChanged = this._eventManager.getLazyEmitter('zoom_changed');
204
+ const platformId = inject(PLATFORM_ID);
204
205
  this._isBrowser = isPlatformBrowser(platformId);
205
206
  if (this._isBrowser) {
206
207
  const googleMapsWindow = window;
@@ -447,23 +448,19 @@ class GoogleMap {
447
448
  'Please wait for the API to load before trying to interact with it.');
448
449
  }
449
450
  }
450
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: GoogleMap, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component }); }
451
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0-next.2", type: GoogleMap, isStandalone: true, selector: "google-map", inputs: { height: "height", width: "width", mapId: "mapId", mapTypeId: "mapTypeId", center: "center", zoom: "zoom", options: "options" }, outputs: { mapInitialized: "mapInitialized", 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 />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
451
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: GoogleMap, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
452
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0-next.10", type: GoogleMap, isStandalone: true, selector: "google-map", inputs: { height: "height", width: "width", mapId: "mapId", mapTypeId: "mapTypeId", center: "center", zoom: "zoom", options: "options" }, outputs: { mapInitialized: "mapInitialized", 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 />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
452
453
  }
453
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: GoogleMap, decorators: [{
454
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: GoogleMap, decorators: [{
454
455
  type: Component,
455
456
  args: [{
456
457
  selector: 'google-map',
457
458
  exportAs: 'googleMap',
458
- standalone: true,
459
459
  changeDetection: ChangeDetectionStrategy.OnPush,
460
460
  template: '<div class="map-container"></div><ng-content />',
461
461
  encapsulation: ViewEncapsulation.None,
462
462
  }]
463
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.NgZone }, { type: Object, decorators: [{
464
- type: Inject,
465
- args: [PLATFORM_ID]
466
- }] }], propDecorators: { height: [{
463
+ }], ctorParameters: () => [], propDecorators: { height: [{
467
464
  type: Input
468
465
  }], width: [{
469
466
  type: Input
@@ -529,9 +526,9 @@ function coerceCssPixelValue(value) {
529
526
 
530
527
  // Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265
531
528
  class MapBaseLayer {
532
- constructor(_map, _ngZone) {
533
- this._map = _map;
534
- this._ngZone = _ngZone;
529
+ constructor() {
530
+ this._map = inject(GoogleMap);
531
+ this._ngZone = inject(NgZone);
535
532
  }
536
533
  ngOnInit() {
537
534
  if (this._map._isBrowser) {
@@ -554,17 +551,16 @@ class MapBaseLayer {
554
551
  _initializeObject() { }
555
552
  _setMap() { }
556
553
  _unsetMap() { }
557
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapBaseLayer, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
558
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0-next.2", type: MapBaseLayer, isStandalone: true, selector: "map-base-layer", exportAs: ["mapBaseLayer"], ngImport: i0 }); }
554
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapBaseLayer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
555
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MapBaseLayer, isStandalone: true, selector: "map-base-layer", exportAs: ["mapBaseLayer"], ngImport: i0 }); }
559
556
  }
560
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapBaseLayer, decorators: [{
557
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapBaseLayer, decorators: [{
561
558
  type: Directive,
562
559
  args: [{
563
560
  selector: 'map-base-layer',
564
561
  exportAs: 'mapBaseLayer',
565
- standalone: true,
566
562
  }]
567
- }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }] });
563
+ }], ctorParameters: () => [] });
568
564
 
569
565
  // Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265
570
566
  /**
@@ -610,15 +606,14 @@ class MapBicyclingLayer {
610
606
  'Please wait for the Transit Layer to load before trying to interact with it.');
611
607
  }
612
608
  }
613
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapBicyclingLayer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
614
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0-next.2", type: MapBicyclingLayer, isStandalone: true, selector: "map-bicycling-layer", outputs: { bicyclingLayerInitialized: "bicyclingLayerInitialized" }, exportAs: ["mapBicyclingLayer"], ngImport: i0 }); }
609
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapBicyclingLayer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
610
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MapBicyclingLayer, isStandalone: true, selector: "map-bicycling-layer", outputs: { bicyclingLayerInitialized: "bicyclingLayerInitialized" }, exportAs: ["mapBicyclingLayer"], ngImport: i0 }); }
615
611
  }
616
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapBicyclingLayer, decorators: [{
612
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapBicyclingLayer, decorators: [{
617
613
  type: Directive,
618
614
  args: [{
619
615
  selector: 'map-bicycling-layer',
620
616
  exportAs: 'mapBicyclingLayer',
621
- standalone: true,
622
617
  }]
623
618
  }], propDecorators: { bicyclingLayerInitialized: [{
624
619
  type: Output
@@ -639,9 +634,9 @@ class MapCircle {
639
634
  set radius(radius) {
640
635
  this._radius.next(radius);
641
636
  }
642
- constructor(_map, _ngZone) {
643
- this._map = _map;
644
- this._ngZone = _ngZone;
637
+ constructor() {
638
+ this._map = inject(GoogleMap);
639
+ this._ngZone = inject(NgZone);
645
640
  this._eventManager = new MapEventManager(inject(NgZone));
646
641
  this._options = new BehaviorSubject({});
647
642
  this._center = new BehaviorSubject(undefined);
@@ -843,17 +838,16 @@ class MapCircle {
843
838
  }
844
839
  }
845
840
  }
846
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapCircle, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
847
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0-next.2", type: MapCircle, isStandalone: true, 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", circleInitialized: "circleInitialized" }, exportAs: ["mapCircle"], ngImport: i0 }); }
841
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapCircle, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
842
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MapCircle, isStandalone: true, 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", circleInitialized: "circleInitialized" }, exportAs: ["mapCircle"], ngImport: i0 }); }
848
843
  }
849
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapCircle, decorators: [{
844
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapCircle, decorators: [{
850
845
  type: Directive,
851
846
  args: [{
852
847
  selector: 'map-circle',
853
848
  exportAs: 'mapCircle',
854
- standalone: true,
855
849
  }]
856
- }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { options: [{
850
+ }], ctorParameters: () => [], propDecorators: { options: [{
857
851
  type: Input
858
852
  }], center: [{
859
853
  type: Input
@@ -911,9 +905,9 @@ class MapDirectionsRenderer {
911
905
  set options(options) {
912
906
  this._options = options;
913
907
  }
914
- constructor(_googleMap, _ngZone) {
915
- this._googleMap = _googleMap;
916
- this._ngZone = _ngZone;
908
+ constructor() {
909
+ this._googleMap = inject(GoogleMap);
910
+ this._ngZone = inject(NgZone);
917
911
  this._eventManager = new MapEventManager(inject(NgZone));
918
912
  /**
919
913
  * See developers.google.com/maps/documentation/javascript/reference/directions
@@ -1004,17 +998,16 @@ class MapDirectionsRenderer {
1004
998
  }
1005
999
  }
1006
1000
  }
1007
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapDirectionsRenderer, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
1008
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0-next.2", type: MapDirectionsRenderer, isStandalone: true, selector: "map-directions-renderer", inputs: { directions: "directions", options: "options" }, outputs: { directionsChanged: "directionsChanged", directionsRendererInitialized: "directionsRendererInitialized" }, exportAs: ["mapDirectionsRenderer"], usesOnChanges: true, ngImport: i0 }); }
1001
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapDirectionsRenderer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1002
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MapDirectionsRenderer, isStandalone: true, selector: "map-directions-renderer", inputs: { directions: "directions", options: "options" }, outputs: { directionsChanged: "directionsChanged", directionsRendererInitialized: "directionsRendererInitialized" }, exportAs: ["mapDirectionsRenderer"], usesOnChanges: true, ngImport: i0 }); }
1009
1003
  }
1010
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapDirectionsRenderer, decorators: [{
1004
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapDirectionsRenderer, decorators: [{
1011
1005
  type: Directive,
1012
1006
  args: [{
1013
1007
  selector: 'map-directions-renderer',
1014
1008
  exportAs: 'mapDirectionsRenderer',
1015
- standalone: true,
1016
1009
  }]
1017
- }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { directions: [{
1010
+ }], ctorParameters: () => [], propDecorators: { directions: [{
1018
1011
  type: Input
1019
1012
  }], options: [{
1020
1013
  type: Input
@@ -1046,9 +1039,9 @@ class MapGroundOverlay {
1046
1039
  set opacity(opacity) {
1047
1040
  this._opacity.next(opacity);
1048
1041
  }
1049
- constructor(_map, _ngZone) {
1050
- this._map = _map;
1051
- this._ngZone = _ngZone;
1042
+ constructor() {
1043
+ this._map = inject(GoogleMap);
1044
+ this._ngZone = inject(NgZone);
1052
1045
  this._eventManager = new MapEventManager(inject(NgZone));
1053
1046
  this._opacity = new BehaviorSubject(1);
1054
1047
  this._url = new BehaviorSubject('');
@@ -1176,17 +1169,16 @@ class MapGroundOverlay {
1176
1169
  }
1177
1170
  }
1178
1171
  }
1179
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapGroundOverlay, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
1180
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0-next.2", type: MapGroundOverlay, isStandalone: true, selector: "map-ground-overlay", inputs: { url: "url", bounds: "bounds", clickable: "clickable", opacity: "opacity" }, outputs: { mapClick: "mapClick", mapDblclick: "mapDblclick", groundOverlayInitialized: "groundOverlayInitialized" }, exportAs: ["mapGroundOverlay"], ngImport: i0 }); }
1172
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapGroundOverlay, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1173
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MapGroundOverlay, isStandalone: true, selector: "map-ground-overlay", inputs: { url: "url", bounds: "bounds", clickable: "clickable", opacity: "opacity" }, outputs: { mapClick: "mapClick", mapDblclick: "mapDblclick", groundOverlayInitialized: "groundOverlayInitialized" }, exportAs: ["mapGroundOverlay"], ngImport: i0 }); }
1181
1174
  }
1182
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapGroundOverlay, decorators: [{
1175
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapGroundOverlay, decorators: [{
1183
1176
  type: Directive,
1184
1177
  args: [{
1185
1178
  selector: 'map-ground-overlay',
1186
1179
  exportAs: 'mapGroundOverlay',
1187
- standalone: true,
1188
1180
  }]
1189
- }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { url: [{
1181
+ }], ctorParameters: () => [], propDecorators: { url: [{
1190
1182
  type: Input
1191
1183
  }], bounds: [{
1192
1184
  type: Input
@@ -1215,10 +1207,10 @@ class MapInfoWindow {
1215
1207
  set position(position) {
1216
1208
  this._position.next(position);
1217
1209
  }
1218
- constructor(_googleMap, _elementRef, _ngZone) {
1219
- this._googleMap = _googleMap;
1220
- this._elementRef = _elementRef;
1221
- this._ngZone = _ngZone;
1210
+ constructor() {
1211
+ this._googleMap = inject(GoogleMap);
1212
+ this._elementRef = inject(ElementRef);
1213
+ this._ngZone = inject(NgZone);
1222
1214
  this._eventManager = new MapEventManager(inject(NgZone));
1223
1215
  this._options = new BehaviorSubject({});
1224
1216
  this._position = new BehaviorSubject(undefined);
@@ -1396,18 +1388,17 @@ class MapInfoWindow {
1396
1388
  }
1397
1389
  }
1398
1390
  }
1399
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapInfoWindow, deps: [{ token: GoogleMap }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
1400
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0-next.2", type: MapInfoWindow, isStandalone: true, selector: "map-info-window", inputs: { options: "options", position: "position" }, outputs: { closeclick: "closeclick", contentChanged: "contentChanged", domready: "domready", positionChanged: "positionChanged", zindexChanged: "zindexChanged", infoWindowInitialized: "infoWindowInitialized" }, host: { styleAttribute: "display: none" }, exportAs: ["mapInfoWindow"], ngImport: i0 }); }
1391
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapInfoWindow, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1392
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MapInfoWindow, isStandalone: true, selector: "map-info-window", inputs: { options: "options", position: "position" }, outputs: { closeclick: "closeclick", contentChanged: "contentChanged", domready: "domready", positionChanged: "positionChanged", zindexChanged: "zindexChanged", infoWindowInitialized: "infoWindowInitialized" }, host: { styleAttribute: "display: none" }, exportAs: ["mapInfoWindow"], ngImport: i0 }); }
1401
1393
  }
1402
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapInfoWindow, decorators: [{
1394
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapInfoWindow, decorators: [{
1403
1395
  type: Directive,
1404
1396
  args: [{
1405
1397
  selector: 'map-info-window',
1406
1398
  exportAs: 'mapInfoWindow',
1407
- standalone: true,
1408
1399
  host: { 'style': 'display: none' },
1409
1400
  }]
1410
- }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.ElementRef }, { type: i0.NgZone }], propDecorators: { options: [{
1401
+ }], ctorParameters: () => [], propDecorators: { options: [{
1411
1402
  type: Input
1412
1403
  }], position: [{
1413
1404
  type: Input
@@ -1438,9 +1429,9 @@ class MapKmlLayer {
1438
1429
  set url(url) {
1439
1430
  this._url.next(url);
1440
1431
  }
1441
- constructor(_map, _ngZone) {
1442
- this._map = _map;
1443
- this._ngZone = _ngZone;
1432
+ constructor() {
1433
+ this._map = inject(GoogleMap);
1434
+ this._ngZone = inject(NgZone);
1444
1435
  this._eventManager = new MapEventManager(inject(NgZone));
1445
1436
  this._options = new BehaviorSubject({});
1446
1437
  this._url = new BehaviorSubject('');
@@ -1569,17 +1560,16 @@ class MapKmlLayer {
1569
1560
  }
1570
1561
  }
1571
1562
  }
1572
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapKmlLayer, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
1573
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0-next.2", type: MapKmlLayer, isStandalone: true, selector: "map-kml-layer", inputs: { options: "options", url: "url" }, outputs: { kmlClick: "kmlClick", defaultviewportChanged: "defaultviewportChanged", statusChanged: "statusChanged", kmlLayerInitialized: "kmlLayerInitialized" }, exportAs: ["mapKmlLayer"], ngImport: i0 }); }
1563
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapKmlLayer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1564
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MapKmlLayer, isStandalone: true, selector: "map-kml-layer", inputs: { options: "options", url: "url" }, outputs: { kmlClick: "kmlClick", defaultviewportChanged: "defaultviewportChanged", statusChanged: "statusChanged", kmlLayerInitialized: "kmlLayerInitialized" }, exportAs: ["mapKmlLayer"], ngImport: i0 }); }
1574
1565
  }
1575
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapKmlLayer, decorators: [{
1566
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapKmlLayer, decorators: [{
1576
1567
  type: Directive,
1577
1568
  args: [{
1578
1569
  selector: 'map-kml-layer',
1579
1570
  exportAs: 'mapKmlLayer',
1580
- standalone: true,
1581
1571
  }]
1582
- }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { options: [{
1572
+ }], ctorParameters: () => [], propDecorators: { options: [{
1583
1573
  type: Input
1584
1574
  }], url: [{
1585
1575
  type: Input
@@ -1593,6 +1583,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2",
1593
1583
  type: Output
1594
1584
  }] } });
1595
1585
 
1586
+ /** Token that marker directives can use to expose themselves to the clusterer. */
1587
+ const MAP_MARKER = new InjectionToken('MAP_MARKER');
1588
+
1596
1589
  // Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265
1597
1590
  /**
1598
1591
  * Default options for the Google Maps marker component. Displays a marker
@@ -1656,9 +1649,9 @@ class MapMarker {
1656
1649
  set visible(value) {
1657
1650
  this._visible = value;
1658
1651
  }
1659
- constructor(_googleMap, _ngZone) {
1660
- this._googleMap = _googleMap;
1661
- this._ngZone = _ngZone;
1652
+ constructor() {
1653
+ this._googleMap = inject(GoogleMap);
1654
+ this._ngZone = inject(NgZone);
1662
1655
  this._eventManager = new MapEventManager(inject(NgZone));
1663
1656
  /**
1664
1657
  * See
@@ -1955,17 +1948,27 @@ class MapMarker {
1955
1948
  }
1956
1949
  }
1957
1950
  }
1958
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapMarker, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
1959
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0-next.2", type: MapMarker, isStandalone: true, 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", markerInitialized: "markerInitialized" }, exportAs: ["mapMarker"], usesOnChanges: true, ngImport: i0 }); }
1951
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapMarker, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1952
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MapMarker, isStandalone: true, 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", markerInitialized: "markerInitialized" }, providers: [
1953
+ {
1954
+ provide: MAP_MARKER,
1955
+ useExisting: MapMarker,
1956
+ },
1957
+ ], exportAs: ["mapMarker"], usesOnChanges: true, ngImport: i0 }); }
1960
1958
  }
1961
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapMarker, decorators: [{
1959
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapMarker, decorators: [{
1962
1960
  type: Directive,
1963
1961
  args: [{
1964
1962
  selector: 'map-marker',
1965
1963
  exportAs: 'mapMarker',
1966
- standalone: true,
1964
+ providers: [
1965
+ {
1966
+ provide: MAP_MARKER,
1967
+ useExisting: MapMarker,
1968
+ },
1969
+ ],
1967
1970
  }]
1968
- }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { title: [{
1971
+ }], ctorParameters: () => [], propDecorators: { title: [{
1969
1972
  type: Input
1970
1973
  }], position: [{
1971
1974
  type: Input
@@ -2030,10 +2033,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2",
2030
2033
  const DEFAULT_CLUSTERER_OPTIONS = {};
2031
2034
  /**
2032
2035
  * Angular component for implementing a Google Maps Marker Clusterer.
2033
- *
2034
2036
  * See https://developers.google.com/maps/documentation/javascript/marker-clustering
2037
+ *
2038
+ * @deprecated This component is using a deprecated clustering implementation. Use the
2039
+ * `map-marker-clusterer` component instead.
2040
+ * @breaking-change 21.0.0
2041
+ *
2035
2042
  */
2036
- class MapMarkerClusterer {
2043
+ class DeprecatedMapMarkerClusterer {
2037
2044
  set averageCenter(averageCenter) {
2038
2045
  this._averageCenter = averageCenter;
2039
2046
  }
@@ -2085,12 +2092,14 @@ class MapMarkerClusterer {
2085
2092
  set options(options) {
2086
2093
  this._options = options;
2087
2094
  }
2088
- constructor(_googleMap, _ngZone) {
2089
- this._googleMap = _googleMap;
2090
- this._ngZone = _ngZone;
2095
+ constructor() {
2096
+ this._googleMap = inject(GoogleMap);
2097
+ this._ngZone = inject(NgZone);
2091
2098
  this._currentMarkers = new Set();
2092
2099
  this._eventManager = new MapEventManager(inject(NgZone));
2093
2100
  this._destroy = new Subject();
2101
+ /** Whether the clusterer is allowed to be initialized. */
2102
+ this._canInitialize = this._googleMap._isBrowser;
2094
2103
  this.ariaLabelFn = () => '';
2095
2104
  /**
2096
2105
  * See
@@ -2107,7 +2116,6 @@ class MapMarkerClusterer {
2107
2116
  this.clusterClick = this._eventManager.getLazyEmitter('click');
2108
2117
  /** Event emitted when the clusterer is initialized. */
2109
2118
  this.markerClustererInitialized = new EventEmitter();
2110
- this._canInitialize = _googleMap._isBrowser;
2111
2119
  }
2112
2120
  ngOnInit() {
2113
2121
  if (this._canInitialize) {
@@ -2366,20 +2374,19 @@ class MapMarkerClusterer {
2366
2374
  }
2367
2375
  }
2368
2376
  }
2369
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapMarkerClusterer, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Component }); }
2370
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0-next.2", type: MapMarkerClusterer, isStandalone: true, 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", markerClustererInitialized: "markerClustererInitialized" }, queries: [{ propertyName: "_markers", predicate: MapMarker, descendants: true }], exportAs: ["mapMarkerClusterer"], usesOnChanges: true, ngImport: i0, template: '<ng-content />', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
2377
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: DeprecatedMapMarkerClusterer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
2378
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0-next.10", type: DeprecatedMapMarkerClusterer, isStandalone: true, selector: "deprecated-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", markerClustererInitialized: "markerClustererInitialized" }, queries: [{ propertyName: "_markers", predicate: MapMarker, descendants: true }], exportAs: ["mapMarkerClusterer"], usesOnChanges: true, ngImport: i0, template: '<ng-content/>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
2371
2379
  }
2372
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapMarkerClusterer, decorators: [{
2380
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: DeprecatedMapMarkerClusterer, decorators: [{
2373
2381
  type: Component,
2374
2382
  args: [{
2375
- selector: 'map-marker-clusterer',
2383
+ selector: 'deprecated-map-marker-clusterer',
2376
2384
  exportAs: 'mapMarkerClusterer',
2377
2385
  changeDetection: ChangeDetectionStrategy.OnPush,
2378
- standalone: true,
2379
- template: '<ng-content />',
2386
+ template: '<ng-content/>',
2380
2387
  encapsulation: ViewEncapsulation.None,
2381
2388
  }]
2382
- }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { ariaLabelFn: [{
2389
+ }], ctorParameters: () => [], propDecorators: { ariaLabelFn: [{
2383
2390
  type: Input
2384
2391
  }], averageCenter: [{
2385
2392
  type: Input
@@ -2443,9 +2450,9 @@ class MapPolygon {
2443
2450
  set paths(paths) {
2444
2451
  this._paths.next(paths);
2445
2452
  }
2446
- constructor(_map, _ngZone) {
2447
- this._map = _map;
2448
- this._ngZone = _ngZone;
2453
+ constructor() {
2454
+ this._map = inject(GoogleMap);
2455
+ this._ngZone = inject(NgZone);
2449
2456
  this._eventManager = new MapEventManager(inject(NgZone));
2450
2457
  this._options = new BehaviorSubject({});
2451
2458
  this._paths = new BehaviorSubject(undefined);
@@ -2602,17 +2609,16 @@ class MapPolygon {
2602
2609
  }
2603
2610
  }
2604
2611
  }
2605
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapPolygon, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
2606
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0-next.2", type: MapPolygon, isStandalone: true, 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", polygonInitialized: "polygonInitialized" }, exportAs: ["mapPolygon"], ngImport: i0 }); }
2612
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapPolygon, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2613
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MapPolygon, isStandalone: true, 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", polygonInitialized: "polygonInitialized" }, exportAs: ["mapPolygon"], ngImport: i0 }); }
2607
2614
  }
2608
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapPolygon, decorators: [{
2615
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapPolygon, decorators: [{
2609
2616
  type: Directive,
2610
2617
  args: [{
2611
2618
  selector: 'map-polygon',
2612
2619
  exportAs: 'mapPolygon',
2613
- standalone: true,
2614
2620
  }]
2615
- }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { options: [{
2621
+ }], ctorParameters: () => [], propDecorators: { options: [{
2616
2622
  type: Input
2617
2623
  }], paths: [{
2618
2624
  type: Input
@@ -2655,9 +2661,9 @@ class MapPolyline {
2655
2661
  set path(path) {
2656
2662
  this._path.next(path);
2657
2663
  }
2658
- constructor(_map, _ngZone) {
2659
- this._map = _map;
2660
- this._ngZone = _ngZone;
2664
+ constructor() {
2665
+ this._map = inject(GoogleMap);
2666
+ this._ngZone = inject(NgZone);
2661
2667
  this._eventManager = new MapEventManager(inject(NgZone));
2662
2668
  this._options = new BehaviorSubject({});
2663
2669
  this._path = new BehaviorSubject(undefined);
@@ -2807,17 +2813,16 @@ class MapPolyline {
2807
2813
  }
2808
2814
  }
2809
2815
  }
2810
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapPolyline, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
2811
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0-next.2", type: MapPolyline, isStandalone: true, 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", polylineInitialized: "polylineInitialized" }, exportAs: ["mapPolyline"], ngImport: i0 }); }
2816
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapPolyline, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
2817
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MapPolyline, isStandalone: true, 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", polylineInitialized: "polylineInitialized" }, exportAs: ["mapPolyline"], ngImport: i0 }); }
2812
2818
  }
2813
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapPolyline, decorators: [{
2819
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapPolyline, decorators: [{
2814
2820
  type: Directive,
2815
2821
  args: [{
2816
2822
  selector: 'map-polyline',
2817
2823
  exportAs: 'mapPolyline',
2818
- standalone: true,
2819
2824
  }]
2820
- }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { options: [{
2825
+ }], ctorParameters: () => [], propDecorators: { options: [{
2821
2826
  type: Input
2822
2827
  }], path: [{
2823
2828
  type: Input
@@ -2860,9 +2865,9 @@ class MapRectangle {
2860
2865
  set bounds(bounds) {
2861
2866
  this._bounds.next(bounds);
2862
2867
  }
2863
- constructor(_map, _ngZone) {
2864
- this._map = _map;
2865
- this._ngZone = _ngZone;
2868
+ constructor() {
2869
+ this._map = inject(GoogleMap);
2870
+ this._ngZone = inject(NgZone);
2866
2871
  this._eventManager = new MapEventManager(inject(NgZone));
2867
2872
  this._options = new BehaviorSubject({});
2868
2873
  this._bounds = new BehaviorSubject(undefined);
@@ -3030,17 +3035,16 @@ class MapRectangle {
3030
3035
  }
3031
3036
  }
3032
3037
  }
3033
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapRectangle, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
3034
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0-next.2", type: MapRectangle, isStandalone: true, 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", rectangleInitialized: "rectangleInitialized" }, exportAs: ["mapRectangle"], ngImport: i0 }); }
3038
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapRectangle, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
3039
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MapRectangle, isStandalone: true, 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", rectangleInitialized: "rectangleInitialized" }, exportAs: ["mapRectangle"], ngImport: i0 }); }
3035
3040
  }
3036
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapRectangle, decorators: [{
3041
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapRectangle, decorators: [{
3037
3042
  type: Directive,
3038
3043
  args: [{
3039
3044
  selector: 'map-rectangle',
3040
3045
  exportAs: 'mapRectangle',
3041
- standalone: true,
3042
3046
  }]
3043
- }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { options: [{
3047
+ }], ctorParameters: () => [], propDecorators: { options: [{
3044
3048
  type: Input
3045
3049
  }], bounds: [{
3046
3050
  type: Input
@@ -3085,9 +3089,9 @@ class MapTrafficLayer {
3085
3089
  set autoRefresh(autoRefresh) {
3086
3090
  this._autoRefresh.next(autoRefresh);
3087
3091
  }
3088
- constructor(_map, _ngZone) {
3089
- this._map = _map;
3090
- this._ngZone = _ngZone;
3092
+ constructor() {
3093
+ this._map = inject(GoogleMap);
3094
+ this._ngZone = inject(NgZone);
3091
3095
  this._autoRefresh = new BehaviorSubject(true);
3092
3096
  this._destroyed = new Subject();
3093
3097
  /** Event emitted when the traffic layer is initialized. */
@@ -3145,17 +3149,16 @@ class MapTrafficLayer {
3145
3149
  'Please wait for the Traffic Layer to load before trying to interact with it.');
3146
3150
  }
3147
3151
  }
3148
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapTrafficLayer, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
3149
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0-next.2", type: MapTrafficLayer, isStandalone: true, selector: "map-traffic-layer", inputs: { autoRefresh: "autoRefresh" }, outputs: { trafficLayerInitialized: "trafficLayerInitialized" }, exportAs: ["mapTrafficLayer"], ngImport: i0 }); }
3152
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapTrafficLayer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
3153
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MapTrafficLayer, isStandalone: true, selector: "map-traffic-layer", inputs: { autoRefresh: "autoRefresh" }, outputs: { trafficLayerInitialized: "trafficLayerInitialized" }, exportAs: ["mapTrafficLayer"], ngImport: i0 }); }
3150
3154
  }
3151
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapTrafficLayer, decorators: [{
3155
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapTrafficLayer, decorators: [{
3152
3156
  type: Directive,
3153
3157
  args: [{
3154
3158
  selector: 'map-traffic-layer',
3155
3159
  exportAs: 'mapTrafficLayer',
3156
- standalone: true,
3157
3160
  }]
3158
- }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { autoRefresh: [{
3161
+ }], ctorParameters: () => [], propDecorators: { autoRefresh: [{
3159
3162
  type: Input
3160
3163
  }], trafficLayerInitialized: [{
3161
3164
  type: Output
@@ -3205,15 +3208,14 @@ class MapTransitLayer {
3205
3208
  'Please wait for the Transit Layer to load before trying to interact with it.');
3206
3209
  }
3207
3210
  }
3208
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapTransitLayer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
3209
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0-next.2", type: MapTransitLayer, isStandalone: true, selector: "map-transit-layer", outputs: { transitLayerInitialized: "transitLayerInitialized" }, exportAs: ["mapTransitLayer"], ngImport: i0 }); }
3211
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapTransitLayer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
3212
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MapTransitLayer, isStandalone: true, selector: "map-transit-layer", outputs: { transitLayerInitialized: "transitLayerInitialized" }, exportAs: ["mapTransitLayer"], ngImport: i0 }); }
3210
3213
  }
3211
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapTransitLayer, decorators: [{
3214
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapTransitLayer, decorators: [{
3212
3215
  type: Directive,
3213
3216
  args: [{
3214
3217
  selector: 'map-transit-layer',
3215
3218
  exportAs: 'mapTransitLayer',
3216
- standalone: true,
3217
3219
  }]
3218
3220
  }], propDecorators: { transitLayerInitialized: [{
3219
3221
  type: Output
@@ -3240,9 +3242,9 @@ class MapHeatmapLayer {
3240
3242
  set options(options) {
3241
3243
  this._options = options;
3242
3244
  }
3243
- constructor(_googleMap, _ngZone) {
3244
- this._googleMap = _googleMap;
3245
- this._ngZone = _ngZone;
3245
+ constructor() {
3246
+ this._googleMap = inject(GoogleMap);
3247
+ this._ngZone = inject(NgZone);
3246
3248
  /** Event emitted when the heatmap is initialized. */
3247
3249
  this.heatmapInitialized = new EventEmitter();
3248
3250
  }
@@ -3336,17 +3338,16 @@ class MapHeatmapLayer {
3336
3338
  }
3337
3339
  }
3338
3340
  }
3339
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapHeatmapLayer, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
3340
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0-next.2", type: MapHeatmapLayer, isStandalone: true, selector: "map-heatmap-layer", inputs: { data: "data", options: "options" }, outputs: { heatmapInitialized: "heatmapInitialized" }, exportAs: ["mapHeatmapLayer"], usesOnChanges: true, ngImport: i0 }); }
3341
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapHeatmapLayer, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
3342
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MapHeatmapLayer, isStandalone: true, selector: "map-heatmap-layer", inputs: { data: "data", options: "options" }, outputs: { heatmapInitialized: "heatmapInitialized" }, exportAs: ["mapHeatmapLayer"], usesOnChanges: true, ngImport: i0 }); }
3341
3343
  }
3342
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapHeatmapLayer, decorators: [{
3344
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapHeatmapLayer, decorators: [{
3343
3345
  type: Directive,
3344
3346
  args: [{
3345
3347
  selector: 'map-heatmap-layer',
3346
3348
  exportAs: 'mapHeatmapLayer',
3347
- standalone: true,
3348
3349
  }]
3349
- }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { data: [{
3350
+ }], ctorParameters: () => [], propDecorators: { data: [{
3350
3351
  type: Input
3351
3352
  }], options: [{
3352
3353
  type: Input
@@ -3417,15 +3418,35 @@ class MapAdvancedMarker {
3417
3418
  set zIndex(zIndex) {
3418
3419
  this._zIndex = zIndex;
3419
3420
  }
3420
- constructor(_googleMap, _ngZone) {
3421
- this._googleMap = _googleMap;
3422
- this._ngZone = _ngZone;
3421
+ constructor() {
3422
+ this._googleMap = inject(GoogleMap);
3423
+ this._ngZone = inject(NgZone);
3423
3424
  this._eventManager = new MapEventManager(inject(NgZone));
3424
3425
  /**
3425
3426
  * This event is fired when the AdvancedMarkerElement element is clicked.
3426
3427
  * https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElement.click
3427
3428
  */
3428
3429
  this.mapClick = this._eventManager.getLazyEmitter('click');
3430
+ /**
3431
+ * This event is fired when the AdvancedMarkerElement is double-clicked.
3432
+ */
3433
+ this.mapDblclick = this._eventManager.getLazyEmitter('dblclick');
3434
+ /**
3435
+ * This event is fired when the mouse moves out of the AdvancedMarkerElement.
3436
+ */
3437
+ this.mapMouseout = this._eventManager.getLazyEmitter('mouseout');
3438
+ /**
3439
+ * This event is fired when the mouse moves over the AdvancedMarkerElement.
3440
+ */
3441
+ this.mapMouseover = this._eventManager.getLazyEmitter('mouseover');
3442
+ /**
3443
+ * This event is fired when the mouse button is released over the AdvancedMarkerElement.
3444
+ */
3445
+ this.mapMouseup = this._eventManager.getLazyEmitter('mouseup');
3446
+ /**
3447
+ * This event is fired when the AdvancedMarkerElement is right-clicked.
3448
+ */
3449
+ this.mapRightclick = this._eventManager.getLazyEmitter('rightclick');
3429
3450
  /**
3430
3451
  * This event is repeatedly fired while the user drags the AdvancedMarkerElement.
3431
3452
  * https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElement.drag
@@ -3477,9 +3498,6 @@ class MapAdvancedMarker {
3477
3498
  if (changes['title']) {
3478
3499
  advancedMarker.title = _title;
3479
3500
  }
3480
- if (changes['content']) {
3481
- advancedMarker.content = _content;
3482
- }
3483
3501
  if (changes['gmpDraggable']) {
3484
3502
  advancedMarker.gmpDraggable = _draggable;
3485
3503
  }
@@ -3505,6 +3523,12 @@ class MapAdvancedMarker {
3505
3523
  this._assertInitialized();
3506
3524
  return this.advancedMarker;
3507
3525
  }
3526
+ /** Returns a promise that resolves when the marker has been initialized. */
3527
+ _resolveMarker() {
3528
+ return this.advancedMarker
3529
+ ? Promise.resolve(this.advancedMarker)
3530
+ : this.markerInitialized.pipe(take(1)).toPromise();
3531
+ }
3508
3532
  /** Creates a combined options object using the passed-in options and the individual inputs. */
3509
3533
  _combineOptions() {
3510
3534
  const options = this._options || DEFAULT_MARKER_OPTIONS;
@@ -3527,17 +3551,27 @@ class MapAdvancedMarker {
3527
3551
  }
3528
3552
  }
3529
3553
  }
3530
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapAdvancedMarker, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
3531
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.0-next.2", type: MapAdvancedMarker, isStandalone: true, selector: "map-advanced-marker", inputs: { title: "title", position: "position", content: "content", gmpDraggable: "gmpDraggable", options: "options", zIndex: "zIndex" }, outputs: { mapClick: "mapClick", mapDrag: "mapDrag", mapDragend: "mapDragend", mapDragstart: "mapDragstart", markerInitialized: "markerInitialized" }, exportAs: ["mapAdvancedMarker"], usesOnChanges: true, ngImport: i0 }); }
3554
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapAdvancedMarker, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
3555
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MapAdvancedMarker, isStandalone: true, selector: "map-advanced-marker", inputs: { title: "title", position: "position", content: "content", gmpDraggable: "gmpDraggable", options: "options", zIndex: "zIndex" }, outputs: { mapClick: "mapClick", mapDblclick: "mapDblclick", mapMouseout: "mapMouseout", mapMouseover: "mapMouseover", mapMouseup: "mapMouseup", mapRightclick: "mapRightclick", mapDrag: "mapDrag", mapDragend: "mapDragend", mapDragstart: "mapDragstart", markerInitialized: "markerInitialized" }, providers: [
3556
+ {
3557
+ provide: MAP_MARKER,
3558
+ useExisting: MapAdvancedMarker,
3559
+ },
3560
+ ], exportAs: ["mapAdvancedMarker"], usesOnChanges: true, ngImport: i0 }); }
3532
3561
  }
3533
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapAdvancedMarker, decorators: [{
3562
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapAdvancedMarker, decorators: [{
3534
3563
  type: Directive,
3535
3564
  args: [{
3536
3565
  selector: 'map-advanced-marker',
3537
3566
  exportAs: 'mapAdvancedMarker',
3538
- standalone: true,
3567
+ providers: [
3568
+ {
3569
+ provide: MAP_MARKER,
3570
+ useExisting: MapAdvancedMarker,
3571
+ },
3572
+ ],
3539
3573
  }]
3540
- }], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { title: [{
3574
+ }], ctorParameters: () => [], propDecorators: { title: [{
3541
3575
  type: Input
3542
3576
  }], position: [{
3543
3577
  type: Input
@@ -3551,6 +3585,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2",
3551
3585
  type: Input
3552
3586
  }], mapClick: [{
3553
3587
  type: Output
3588
+ }], mapDblclick: [{
3589
+ type: Output
3590
+ }], mapMouseout: [{
3591
+ type: Output
3592
+ }], mapMouseover: [{
3593
+ type: Output
3594
+ }], mapMouseup: [{
3595
+ type: Output
3596
+ }], mapRightclick: [{
3597
+ type: Output
3554
3598
  }], mapDrag: [{
3555
3599
  type: Output
3556
3600
  }], mapDragend: [{
@@ -3561,6 +3605,164 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2",
3561
3605
  type: Output
3562
3606
  }] } });
3563
3607
 
3608
+ // Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265
3609
+ /**
3610
+ * Angular component for implementing a Google Maps Marker Clusterer.
3611
+ *
3612
+ * See https://developers.google.com/maps/documentation/javascript/marker-clustering
3613
+ */
3614
+ class MapMarkerClusterer {
3615
+ constructor() {
3616
+ this._googleMap = inject(GoogleMap);
3617
+ this._ngZone = inject(NgZone);
3618
+ this._currentMarkers = new Set();
3619
+ this._closestMapEventManager = new MapEventManager(this._ngZone);
3620
+ this._markersSubscription = Subscription.EMPTY;
3621
+ /** Whether the clusterer is allowed to be initialized. */
3622
+ this._canInitialize = this._googleMap._isBrowser;
3623
+ /** Emits when clustering has started. */
3624
+ this.clusteringbegin = this._closestMapEventManager.getLazyEmitter('clusteringbegin');
3625
+ /** Emits when clustering is done. */
3626
+ this.clusteringend = this._closestMapEventManager.getLazyEmitter('clusteringend');
3627
+ /** Emits when a cluster has been clicked. */
3628
+ this.clusterClick = new EventEmitter();
3629
+ /** Event emitted when the marker clusterer is initialized. */
3630
+ this.markerClustererInitialized = new EventEmitter();
3631
+ }
3632
+ async ngOnInit() {
3633
+ if (this._canInitialize) {
3634
+ await this._createCluster();
3635
+ // The `clusteringbegin` and `clusteringend` events are
3636
+ // emitted on the map so that's why set it as the target.
3637
+ this._closestMapEventManager.setTarget(this._googleMap.googleMap);
3638
+ }
3639
+ }
3640
+ async ngOnChanges(changes) {
3641
+ const change = changes['renderer'] || changes['algorithm'];
3642
+ // Since the options are set in the constructor, we have to recreate the cluster if they change.
3643
+ if (this.markerClusterer && change && !change.isFirstChange()) {
3644
+ await this._createCluster();
3645
+ }
3646
+ }
3647
+ ngOnDestroy() {
3648
+ this._markersSubscription.unsubscribe();
3649
+ this._closestMapEventManager.destroy();
3650
+ this._destroyCluster();
3651
+ }
3652
+ async _createCluster() {
3653
+ if (!markerClusterer?.MarkerClusterer && (typeof ngDevMode === 'undefined' || ngDevMode)) {
3654
+ throw Error('MarkerClusterer class not found, cannot construct a marker cluster. ' +
3655
+ 'Please install the MarkerClusterer library: ' +
3656
+ 'https://github.com/googlemaps/js-markerclusterer');
3657
+ }
3658
+ const map = await this._googleMap._resolveMap();
3659
+ this._destroyCluster();
3660
+ // Create the object outside the zone so its events don't trigger change detection.
3661
+ // We'll bring it back in inside the `MapEventManager` only for the events that the
3662
+ // user has subscribed to.
3663
+ this._ngZone.runOutsideAngular(() => {
3664
+ this.markerClusterer = new markerClusterer.MarkerClusterer({
3665
+ map,
3666
+ renderer: this.renderer,
3667
+ algorithm: this.algorithm,
3668
+ onClusterClick: (event, cluster, map) => {
3669
+ if (this.clusterClick.observers.length) {
3670
+ this._ngZone.run(() => this.clusterClick.emit(cluster));
3671
+ }
3672
+ else {
3673
+ markerClusterer.defaultOnClusterClickHandler(event, cluster, map);
3674
+ }
3675
+ },
3676
+ });
3677
+ this.markerClustererInitialized.emit(this.markerClusterer);
3678
+ });
3679
+ await this._watchForMarkerChanges();
3680
+ }
3681
+ async _watchForMarkerChanges() {
3682
+ this._assertInitialized();
3683
+ const initialMarkers = [];
3684
+ const markers = await this._getInternalMarkers(this._markers.toArray());
3685
+ for (const marker of markers) {
3686
+ this._currentMarkers.add(marker);
3687
+ initialMarkers.push(marker);
3688
+ }
3689
+ this.markerClusterer.addMarkers(initialMarkers);
3690
+ this._markersSubscription.unsubscribe();
3691
+ this._markersSubscription = this._markers.changes.subscribe(async (markerComponents) => {
3692
+ this._assertInitialized();
3693
+ const newMarkers = new Set(await this._getInternalMarkers(markerComponents));
3694
+ const markersToAdd = [];
3695
+ const markersToRemove = [];
3696
+ for (const marker of Array.from(newMarkers)) {
3697
+ if (!this._currentMarkers.has(marker)) {
3698
+ this._currentMarkers.add(marker);
3699
+ markersToAdd.push(marker);
3700
+ }
3701
+ }
3702
+ for (const marker of Array.from(this._currentMarkers)) {
3703
+ if (!newMarkers.has(marker)) {
3704
+ markersToRemove.push(marker);
3705
+ }
3706
+ }
3707
+ this.markerClusterer.addMarkers(markersToAdd, true);
3708
+ this.markerClusterer.removeMarkers(markersToRemove, true);
3709
+ this.markerClusterer.render();
3710
+ for (const marker of markersToRemove) {
3711
+ this._currentMarkers.delete(marker);
3712
+ }
3713
+ });
3714
+ }
3715
+ _destroyCluster() {
3716
+ // TODO(crisbeto): the naming here seems odd, but the `MarkerCluster` method isn't
3717
+ // exposed. All this method seems to do at the time of writing is to call into `reset`.
3718
+ // See: https://github.com/googlemaps/js-markerclusterer/blob/main/src/markerclusterer.ts#L205
3719
+ this.markerClusterer?.onRemove();
3720
+ this.markerClusterer = undefined;
3721
+ }
3722
+ _getInternalMarkers(markers) {
3723
+ return Promise.all(markers.map(marker => marker._resolveMarker()));
3724
+ }
3725
+ _assertInitialized() {
3726
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
3727
+ if (!this._googleMap.googleMap) {
3728
+ throw Error('Cannot access Google Map information before the API has been initialized. ' +
3729
+ 'Please wait for the API to load before trying to interact with it.');
3730
+ }
3731
+ if (!this.markerClusterer) {
3732
+ throw Error('Cannot interact with a MarkerClusterer before it has been initialized. ' +
3733
+ 'Please wait for the MarkerClusterer to load before trying to interact with it.');
3734
+ }
3735
+ }
3736
+ }
3737
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapMarkerClusterer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
3738
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.0-next.10", type: MapMarkerClusterer, isStandalone: true, selector: "map-marker-clusterer", inputs: { renderer: "renderer", algorithm: "algorithm" }, outputs: { clusteringbegin: "clusteringbegin", clusteringend: "clusteringend", clusterClick: "clusterClick", markerClustererInitialized: "markerClustererInitialized" }, queries: [{ propertyName: "_markers", predicate: MAP_MARKER, descendants: true }], exportAs: ["mapMarkerClusterer"], usesOnChanges: true, ngImport: i0, template: '<ng-content/>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
3739
+ }
3740
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapMarkerClusterer, decorators: [{
3741
+ type: Component,
3742
+ args: [{
3743
+ selector: 'map-marker-clusterer',
3744
+ exportAs: 'mapMarkerClusterer',
3745
+ changeDetection: ChangeDetectionStrategy.OnPush,
3746
+ template: '<ng-content/>',
3747
+ encapsulation: ViewEncapsulation.None,
3748
+ }]
3749
+ }], propDecorators: { renderer: [{
3750
+ type: Input
3751
+ }], algorithm: [{
3752
+ type: Input
3753
+ }], clusteringbegin: [{
3754
+ type: Output
3755
+ }], clusteringend: [{
3756
+ type: Output
3757
+ }], clusterClick: [{
3758
+ type: Output
3759
+ }], markerClustererInitialized: [{
3760
+ type: Output
3761
+ }], _markers: [{
3762
+ type: ContentChildren,
3763
+ args: [MAP_MARKER, { descendants: true }]
3764
+ }] } });
3765
+
3564
3766
  const COMPONENTS = [
3565
3767
  GoogleMap,
3566
3768
  MapBaseLayer,
@@ -3573,16 +3775,17 @@ const COMPONENTS = [
3573
3775
  MapKmlLayer,
3574
3776
  MapMarker,
3575
3777
  MapAdvancedMarker,
3576
- MapMarkerClusterer,
3778
+ DeprecatedMapMarkerClusterer,
3577
3779
  MapPolygon,
3578
3780
  MapPolyline,
3579
3781
  MapRectangle,
3580
3782
  MapTrafficLayer,
3581
3783
  MapTransitLayer,
3784
+ MapMarkerClusterer,
3582
3785
  ];
3583
3786
  class GoogleMapsModule {
3584
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: GoogleMapsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3585
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0-next.2", ngImport: i0, type: GoogleMapsModule, imports: [GoogleMap,
3787
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: GoogleMapsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3788
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.0-next.10", ngImport: i0, type: GoogleMapsModule, imports: [GoogleMap,
3586
3789
  MapBaseLayer,
3587
3790
  MapBicyclingLayer,
3588
3791
  MapCircle,
@@ -3593,12 +3796,13 @@ class GoogleMapsModule {
3593
3796
  MapKmlLayer,
3594
3797
  MapMarker,
3595
3798
  MapAdvancedMarker,
3596
- MapMarkerClusterer,
3799
+ DeprecatedMapMarkerClusterer,
3597
3800
  MapPolygon,
3598
3801
  MapPolyline,
3599
3802
  MapRectangle,
3600
3803
  MapTrafficLayer,
3601
- MapTransitLayer], exports: [GoogleMap,
3804
+ MapTransitLayer,
3805
+ MapMarkerClusterer], exports: [GoogleMap,
3602
3806
  MapBaseLayer,
3603
3807
  MapBicyclingLayer,
3604
3808
  MapCircle,
@@ -3609,15 +3813,16 @@ class GoogleMapsModule {
3609
3813
  MapKmlLayer,
3610
3814
  MapMarker,
3611
3815
  MapAdvancedMarker,
3612
- MapMarkerClusterer,
3816
+ DeprecatedMapMarkerClusterer,
3613
3817
  MapPolygon,
3614
3818
  MapPolyline,
3615
3819
  MapRectangle,
3616
3820
  MapTrafficLayer,
3617
- MapTransitLayer] }); }
3618
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: GoogleMapsModule }); }
3821
+ MapTransitLayer,
3822
+ MapMarkerClusterer] }); }
3823
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: GoogleMapsModule }); }
3619
3824
  }
3620
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: GoogleMapsModule, decorators: [{
3825
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: GoogleMapsModule, decorators: [{
3621
3826
  type: NgModule,
3622
3827
  args: [{
3623
3828
  imports: COMPONENTS,
@@ -3633,8 +3838,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2",
3633
3838
  * See developers.google.com/maps/documentation/javascript/reference/directions#DirectionsService
3634
3839
  */
3635
3840
  class MapDirectionsService {
3636
- constructor(_ngZone) {
3637
- this._ngZone = _ngZone;
3841
+ constructor() {
3842
+ this._ngZone = inject(NgZone);
3638
3843
  }
3639
3844
  /**
3640
3845
  * See
@@ -3667,13 +3872,13 @@ class MapDirectionsService {
3667
3872
  }
3668
3873
  return Promise.resolve(this._directionsService);
3669
3874
  }
3670
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapDirectionsService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable }); }
3671
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapDirectionsService, providedIn: 'root' }); }
3875
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapDirectionsService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3876
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapDirectionsService, providedIn: 'root' }); }
3672
3877
  }
3673
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapDirectionsService, decorators: [{
3878
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapDirectionsService, decorators: [{
3674
3879
  type: Injectable,
3675
3880
  args: [{ providedIn: 'root' }]
3676
- }], ctorParameters: () => [{ type: i0.NgZone }] });
3881
+ }], ctorParameters: () => [] });
3677
3882
 
3678
3883
  // Workaround for: https://github.com/bazelbuild/rules_nodejs/issues/1265
3679
3884
  /**
@@ -3681,8 +3886,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2",
3681
3886
  * See developers.google.com/maps/documentation/javascript/reference/geocoder#Geocoder
3682
3887
  */
3683
3888
  class MapGeocoder {
3684
- constructor(_ngZone) {
3685
- this._ngZone = _ngZone;
3889
+ constructor() {
3890
+ this._ngZone = inject(NgZone);
3686
3891
  }
3687
3892
  /**
3688
3893
  * See developers.google.com/maps/documentation/javascript/reference/geocoder#Geocoder.geocode
@@ -3713,17 +3918,17 @@ class MapGeocoder {
3713
3918
  }
3714
3919
  return Promise.resolve(this._geocoder);
3715
3920
  }
3716
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapGeocoder, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable }); }
3717
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapGeocoder, providedIn: 'root' }); }
3921
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapGeocoder, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
3922
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapGeocoder, providedIn: 'root' }); }
3718
3923
  }
3719
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0-next.2", ngImport: i0, type: MapGeocoder, decorators: [{
3924
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.0-next.10", ngImport: i0, type: MapGeocoder, decorators: [{
3720
3925
  type: Injectable,
3721
3926
  args: [{ providedIn: 'root' }]
3722
- }], ctorParameters: () => [{ type: i0.NgZone }] });
3927
+ }], ctorParameters: () => [] });
3723
3928
 
3724
3929
  /**
3725
3930
  * Generated bundle index. Do not edit.
3726
3931
  */
3727
3932
 
3728
- export { GoogleMap, GoogleMapsModule, MapAdvancedMarker, MapBaseLayer, MapBicyclingLayer, MapCircle, MapDirectionsRenderer, MapDirectionsService, MapEventManager, MapGeocoder, MapGroundOverlay, MapHeatmapLayer, MapInfoWindow, MapKmlLayer, MapMarker, MapMarkerClusterer, MapPolygon, MapPolyline, MapRectangle, MapTrafficLayer, MapTransitLayer };
3933
+ export { DeprecatedMapMarkerClusterer, GoogleMap, GoogleMapsModule, MapAdvancedMarker, MapBaseLayer, MapBicyclingLayer, MapCircle, MapDirectionsRenderer, MapDirectionsService, MapEventManager, MapGeocoder, MapGroundOverlay, MapHeatmapLayer, MapInfoWindow, MapKmlLayer, MapMarker, MapMarkerClusterer, MapPolygon, MapPolyline, MapRectangle, MapTrafficLayer, MapTransitLayer };
3729
3934
  //# sourceMappingURL=google-maps.mjs.map