@angular/google-maps 17.2.0 → 17.3.0-next.0
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.
- package/esm2022/google-map/google-map.mjs +5 -2
- package/esm2022/google-maps-module.mjs +5 -1
- package/esm2022/map-advanced-marker/map-advanced-marker.mjs +214 -0
- package/esm2022/map-info-window/map-info-window.mjs +15 -1
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/google-maps.mjs +223 -4
- package/fesm2022/google-maps.mjs.map +1 -1
- package/index.d.ts +123 -7
- package/package.json +3 -3
package/esm2022/public-api.mjs
CHANGED
|
@@ -16,6 +16,7 @@ export { MapGroundOverlay } from './map-ground-overlay/map-ground-overlay';
|
|
|
16
16
|
export { MapInfoWindow } from './map-info-window/map-info-window';
|
|
17
17
|
export { MapKmlLayer } from './map-kml-layer/map-kml-layer';
|
|
18
18
|
export { MapMarker } from './map-marker/map-marker';
|
|
19
|
+
export { MapAdvancedMarker } from './map-advanced-marker/map-advanced-marker';
|
|
19
20
|
export { MapMarkerClusterer } from './map-marker-clusterer/map-marker-clusterer';
|
|
20
21
|
export { MapPolygon } from './map-polygon/map-polygon';
|
|
21
22
|
export { MapPolyline } from './map-polyline/map-polyline';
|
|
@@ -25,4 +26,4 @@ export { MapTransitLayer } from './map-transit-layer/map-transit-layer';
|
|
|
25
26
|
export { MapHeatmapLayer } from './map-heatmap-layer/map-heatmap-layer';
|
|
26
27
|
export { MapGeocoder } from './map-geocoder/map-geocoder';
|
|
27
28
|
export { MapEventManager } from './map-event-manager';
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9nb29nbGUtbWFwcy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjp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MtbGF5ZXInO1xuZXhwb3J0IHtNYXBUcmFuc2l0TGF5ZXJ9IGZyb20gJy4vbWFwLXRyYW5zaXQtbGF5ZXIvbWFwLXRyYW5zaXQtbGF5ZXInO1xuZXhwb3J0IHtNYXBIZWF0bWFwTGF5ZXIsIEhlYXRtYXBEYXRhfSBmcm9tICcuL21hcC1oZWF0bWFwLWxheWVyL21hcC1oZWF0bWFwLWxheWVyJztcbmV4cG9ydCB7TWFwR2VvY29kZXIsIE1hcEdlb2NvZGVyUmVzcG9uc2V9IGZyb20gJy4vbWFwLWdlb2NvZGVyL21hcC1nZW9jb2Rlcic7XG5leHBvcnQge1xuICBNYXJrZXJDbHVzdGVyZXJPcHRpb25zLFxuICBDbHVzdGVySWNvblN0eWxlLFxuICBBcmlhTGFiZWxGbixcbiAgQ2FsY3VsYXRvcixcbn0gZnJvbSAnLi9tYXAtbWFya2VyLWNsdXN0ZXJlci9tYXJrZXItY2x1c3RlcmVyLXR5cGVzJztcbmV4cG9ydCB7TWFwRXZlbnRNYW5hZ2VyfSBmcm9tICcuL21hcC1ldmVudC1tYW5hZ2VyJztcbiJdfQ==
|
package/fesm2022/google-maps.mjs
CHANGED
|
@@ -437,6 +437,7 @@ class GoogleMap {
|
|
|
437
437
|
// Passing in an undefined `mapTypeId` seems to break tile loading
|
|
438
438
|
// so make sure that we have some kind of default (see #22082).
|
|
439
439
|
mapTypeId: this.mapTypeId || options.mapTypeId || DEFAULT_OPTIONS.mapTypeId,
|
|
440
|
+
mapId: this.mapId || options.mapId,
|
|
440
441
|
};
|
|
441
442
|
}
|
|
442
443
|
/** Asserts that the map has been initialized. */
|
|
@@ -447,7 +448,7 @@ class GoogleMap {
|
|
|
447
448
|
}
|
|
448
449
|
}
|
|
449
450
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: GoogleMap, deps: [{ token: i0.ElementRef }, { token: i0.NgZone }, { token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
450
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.0", type: GoogleMap, isStandalone: true, selector: "google-map", inputs: { height: "height", width: "width", 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.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.2.0", 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
452
|
}
|
|
452
453
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: GoogleMap, decorators: [{
|
|
453
454
|
type: Component,
|
|
@@ -466,6 +467,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImpor
|
|
|
466
467
|
type: Input
|
|
467
468
|
}], width: [{
|
|
468
469
|
type: Input
|
|
470
|
+
}], mapId: [{
|
|
471
|
+
type: Input
|
|
469
472
|
}], mapTypeId: [{
|
|
470
473
|
type: Input
|
|
471
474
|
}], center: [{
|
|
@@ -1323,6 +1326,20 @@ class MapInfoWindow {
|
|
|
1323
1326
|
this._assertInitialized();
|
|
1324
1327
|
return this.infoWindow.getZIndex();
|
|
1325
1328
|
}
|
|
1329
|
+
/**
|
|
1330
|
+
* Opens the MapInfoWindow using the provided AdvancedMarkerElement.
|
|
1331
|
+
*/
|
|
1332
|
+
openAdvancedMarkerElement(advancedMarkerElement, content) {
|
|
1333
|
+
this._assertInitialized();
|
|
1334
|
+
if (!advancedMarkerElement) {
|
|
1335
|
+
return;
|
|
1336
|
+
}
|
|
1337
|
+
this.infoWindow.close();
|
|
1338
|
+
if (content) {
|
|
1339
|
+
this.infoWindow.setContent(content);
|
|
1340
|
+
}
|
|
1341
|
+
this.infoWindow.open(this._googleMap.googleMap, advancedMarkerElement);
|
|
1342
|
+
}
|
|
1326
1343
|
/**
|
|
1327
1344
|
* Opens the MapInfoWindow using the provided anchor. If the anchor is not set,
|
|
1328
1345
|
* then the position property of the options input is used instead.
|
|
@@ -1578,7 +1595,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImpor
|
|
|
1578
1595
|
* Default options for the Google Maps marker component. Displays a marker
|
|
1579
1596
|
* at the Googleplex.
|
|
1580
1597
|
*/
|
|
1581
|
-
const DEFAULT_MARKER_OPTIONS = {
|
|
1598
|
+
const DEFAULT_MARKER_OPTIONS$1 = {
|
|
1582
1599
|
position: { lat: 37.421995, lng: -122.084092 },
|
|
1583
1600
|
};
|
|
1584
1601
|
/**
|
|
@@ -1915,7 +1932,7 @@ class MapMarker {
|
|
|
1915
1932
|
}
|
|
1916
1933
|
/** Creates a combined options object using the passed-in options and the individual inputs. */
|
|
1917
1934
|
_combineOptions() {
|
|
1918
|
-
const options = this._options || DEFAULT_MARKER_OPTIONS;
|
|
1935
|
+
const options = this._options || DEFAULT_MARKER_OPTIONS$1;
|
|
1919
1936
|
return {
|
|
1920
1937
|
...options,
|
|
1921
1938
|
title: this._title || options.title,
|
|
@@ -3338,6 +3355,205 @@ function isLatLngLiteral(value) {
|
|
|
3338
3355
|
return value && typeof value.lat === 'number' && typeof value.lng === 'number';
|
|
3339
3356
|
}
|
|
3340
3357
|
|
|
3358
|
+
/// <reference types="google.maps" />
|
|
3359
|
+
/**
|
|
3360
|
+
* Default options for the Google Maps marker component. Displays a marker
|
|
3361
|
+
* at the Googleplex.
|
|
3362
|
+
*/
|
|
3363
|
+
const DEFAULT_MARKER_OPTIONS = {
|
|
3364
|
+
position: { lat: 37.221995, lng: -122.184092 },
|
|
3365
|
+
};
|
|
3366
|
+
/**
|
|
3367
|
+
* Angular component that renders a Google Maps marker via the Google Maps JavaScript API.
|
|
3368
|
+
*
|
|
3369
|
+
* See developers.google.com/maps/documentation/javascript/reference/marker
|
|
3370
|
+
*/
|
|
3371
|
+
class MapAdvancedMarker {
|
|
3372
|
+
/**
|
|
3373
|
+
* Rollover text. If provided, an accessibility text (e.g. for use with screen readers) will be added to the AdvancedMarkerElement with the provided value.
|
|
3374
|
+
* See: https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions.title
|
|
3375
|
+
*/
|
|
3376
|
+
set title(title) {
|
|
3377
|
+
this._title = title;
|
|
3378
|
+
}
|
|
3379
|
+
/**
|
|
3380
|
+
* Sets the AdvancedMarkerElement's position. An AdvancedMarkerElement may be constructed without a position, but will not be displayed until its position is provided - for example, by a user's actions or choices. An AdvancedMarkerElement's position can be provided by setting AdvancedMarkerElement.position if not provided at the construction.
|
|
3381
|
+
* Note: AdvancedMarkerElement with altitude is only supported on vector maps.
|
|
3382
|
+
* https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions.position
|
|
3383
|
+
*/
|
|
3384
|
+
set position(position) {
|
|
3385
|
+
this._position = position;
|
|
3386
|
+
}
|
|
3387
|
+
/**
|
|
3388
|
+
* The DOM Element backing the visual of an AdvancedMarkerElement.
|
|
3389
|
+
* Note: AdvancedMarkerElement does not clone the passed-in DOM element. Once the DOM element is passed to an AdvancedMarkerElement, passing the same DOM element to another AdvancedMarkerElement will move the DOM element and cause the previous AdvancedMarkerElement to look empty.
|
|
3390
|
+
* See: https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions.content
|
|
3391
|
+
*/
|
|
3392
|
+
set content(content) {
|
|
3393
|
+
this._content = content;
|
|
3394
|
+
}
|
|
3395
|
+
/**
|
|
3396
|
+
* If true, the AdvancedMarkerElement can be dragged.
|
|
3397
|
+
* Note: AdvancedMarkerElement with altitude is not draggable.
|
|
3398
|
+
* https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions.gmpDraggable
|
|
3399
|
+
*/
|
|
3400
|
+
set gmpDraggable(draggable) {
|
|
3401
|
+
this._draggable = draggable;
|
|
3402
|
+
}
|
|
3403
|
+
/**
|
|
3404
|
+
* Options for constructing an AdvancedMarkerElement.
|
|
3405
|
+
* https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions
|
|
3406
|
+
*/
|
|
3407
|
+
set options(options) {
|
|
3408
|
+
this._options = options;
|
|
3409
|
+
}
|
|
3410
|
+
/**
|
|
3411
|
+
* AdvancedMarkerElements on the map are prioritized by zIndex, with higher values indicating higher display.
|
|
3412
|
+
* https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElementOptions.zIndex
|
|
3413
|
+
*/
|
|
3414
|
+
set zIndex(zIndex) {
|
|
3415
|
+
this._zIndex = zIndex;
|
|
3416
|
+
}
|
|
3417
|
+
constructor(_googleMap, _ngZone) {
|
|
3418
|
+
this._googleMap = _googleMap;
|
|
3419
|
+
this._ngZone = _ngZone;
|
|
3420
|
+
this._eventManager = new MapEventManager(inject(NgZone));
|
|
3421
|
+
/**
|
|
3422
|
+
* This event is fired when the AdvancedMarkerElement element is clicked.
|
|
3423
|
+
* https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElement.click
|
|
3424
|
+
*/
|
|
3425
|
+
this.mapClick = this._eventManager.getLazyEmitter('click');
|
|
3426
|
+
/**
|
|
3427
|
+
* This event is repeatedly fired while the user drags the AdvancedMarkerElement.
|
|
3428
|
+
* https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElement.drag
|
|
3429
|
+
*/
|
|
3430
|
+
this.mapDrag = this._eventManager.getLazyEmitter('drag');
|
|
3431
|
+
/**
|
|
3432
|
+
* This event is fired when the user stops dragging the AdvancedMarkerElement.
|
|
3433
|
+
* https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElement.dragend
|
|
3434
|
+
*/
|
|
3435
|
+
this.mapDragend = this._eventManager.getLazyEmitter('dragend');
|
|
3436
|
+
/**
|
|
3437
|
+
* This event is fired when the user starts dragging the AdvancedMarkerElement.
|
|
3438
|
+
* https://developers.google.com/maps/documentation/javascript/reference/advanced-markers#AdvancedMarkerElement.dragstart
|
|
3439
|
+
*/
|
|
3440
|
+
this.mapDragstart = this._eventManager.getLazyEmitter('dragstart');
|
|
3441
|
+
/** Event emitted when the marker is initialized. */
|
|
3442
|
+
this.markerInitialized = new EventEmitter();
|
|
3443
|
+
}
|
|
3444
|
+
ngOnInit() {
|
|
3445
|
+
if (!this._googleMap._isBrowser) {
|
|
3446
|
+
return;
|
|
3447
|
+
}
|
|
3448
|
+
if (google.maps.marker?.AdvancedMarkerElement && this._googleMap.googleMap) {
|
|
3449
|
+
this._initialize(this._googleMap.googleMap, google.maps.marker.AdvancedMarkerElement);
|
|
3450
|
+
}
|
|
3451
|
+
else {
|
|
3452
|
+
this._ngZone.runOutsideAngular(() => {
|
|
3453
|
+
Promise.all([this._googleMap._resolveMap(), google.maps.importLibrary('marker')]).then(([map, lib]) => {
|
|
3454
|
+
this._initialize(map, lib.AdvancedMarkerElement);
|
|
3455
|
+
});
|
|
3456
|
+
});
|
|
3457
|
+
}
|
|
3458
|
+
}
|
|
3459
|
+
_initialize(map, advancedMarkerConstructor) {
|
|
3460
|
+
// Create the object outside the zone so its events don't trigger change detection.
|
|
3461
|
+
// We'll bring it back in inside the `MapEventManager` only for the events that the
|
|
3462
|
+
// user has subscribed to.
|
|
3463
|
+
this._ngZone.runOutsideAngular(() => {
|
|
3464
|
+
this.advancedMarker = new advancedMarkerConstructor(this._combineOptions());
|
|
3465
|
+
this._assertInitialized();
|
|
3466
|
+
this.advancedMarker.map = map;
|
|
3467
|
+
this._eventManager.setTarget(this.advancedMarker);
|
|
3468
|
+
this.markerInitialized.next(this.advancedMarker);
|
|
3469
|
+
});
|
|
3470
|
+
}
|
|
3471
|
+
ngOnChanges(changes) {
|
|
3472
|
+
const { advancedMarker, _content, _position, _title, _draggable, _zIndex } = this;
|
|
3473
|
+
if (advancedMarker) {
|
|
3474
|
+
if (changes['title']) {
|
|
3475
|
+
advancedMarker.title = _title;
|
|
3476
|
+
}
|
|
3477
|
+
if (changes['content']) {
|
|
3478
|
+
advancedMarker.content = _content;
|
|
3479
|
+
}
|
|
3480
|
+
if (changes['gmpDraggable']) {
|
|
3481
|
+
advancedMarker.gmpDraggable = _draggable;
|
|
3482
|
+
}
|
|
3483
|
+
if (changes['content']) {
|
|
3484
|
+
advancedMarker.content = _content;
|
|
3485
|
+
}
|
|
3486
|
+
if (changes['position']) {
|
|
3487
|
+
advancedMarker.position = _position;
|
|
3488
|
+
}
|
|
3489
|
+
if (changes['zIndex']) {
|
|
3490
|
+
advancedMarker.zIndex = _zIndex;
|
|
3491
|
+
}
|
|
3492
|
+
}
|
|
3493
|
+
}
|
|
3494
|
+
ngOnDestroy() {
|
|
3495
|
+
this.markerInitialized.complete();
|
|
3496
|
+
this._eventManager.destroy();
|
|
3497
|
+
if (this.advancedMarker) {
|
|
3498
|
+
this.advancedMarker.map = null;
|
|
3499
|
+
}
|
|
3500
|
+
}
|
|
3501
|
+
/** Creates a combined options object using the passed-in options and the individual inputs. */
|
|
3502
|
+
_combineOptions() {
|
|
3503
|
+
const options = this._options || DEFAULT_MARKER_OPTIONS;
|
|
3504
|
+
return {
|
|
3505
|
+
...options,
|
|
3506
|
+
title: this._title || options.title,
|
|
3507
|
+
position: this._position || options.position,
|
|
3508
|
+
content: this._content || options.content,
|
|
3509
|
+
zIndex: this._zIndex ?? options.zIndex,
|
|
3510
|
+
gmpDraggable: this._draggable ?? options.gmpDraggable,
|
|
3511
|
+
map: this._googleMap.googleMap,
|
|
3512
|
+
};
|
|
3513
|
+
}
|
|
3514
|
+
/** Asserts that the map has been initialized. */
|
|
3515
|
+
_assertInitialized() {
|
|
3516
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
3517
|
+
if (!this.advancedMarker) {
|
|
3518
|
+
throw Error('Cannot interact with a Google Map Marker before it has been ' +
|
|
3519
|
+
'initialized. Please wait for the Marker to load before trying to interact with it.');
|
|
3520
|
+
}
|
|
3521
|
+
}
|
|
3522
|
+
}
|
|
3523
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: MapAdvancedMarker, deps: [{ token: GoogleMap }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3524
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.2.0", 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 }); }
|
|
3525
|
+
}
|
|
3526
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImport: i0, type: MapAdvancedMarker, decorators: [{
|
|
3527
|
+
type: Directive,
|
|
3528
|
+
args: [{
|
|
3529
|
+
selector: 'map-advanced-marker',
|
|
3530
|
+
exportAs: 'mapAdvancedMarker',
|
|
3531
|
+
standalone: true,
|
|
3532
|
+
}]
|
|
3533
|
+
}], ctorParameters: () => [{ type: GoogleMap }, { type: i0.NgZone }], propDecorators: { title: [{
|
|
3534
|
+
type: Input
|
|
3535
|
+
}], position: [{
|
|
3536
|
+
type: Input
|
|
3537
|
+
}], content: [{
|
|
3538
|
+
type: Input
|
|
3539
|
+
}], gmpDraggable: [{
|
|
3540
|
+
type: Input
|
|
3541
|
+
}], options: [{
|
|
3542
|
+
type: Input
|
|
3543
|
+
}], zIndex: [{
|
|
3544
|
+
type: Input
|
|
3545
|
+
}], mapClick: [{
|
|
3546
|
+
type: Output
|
|
3547
|
+
}], mapDrag: [{
|
|
3548
|
+
type: Output
|
|
3549
|
+
}], mapDragend: [{
|
|
3550
|
+
type: Output
|
|
3551
|
+
}], mapDragstart: [{
|
|
3552
|
+
type: Output
|
|
3553
|
+
}], markerInitialized: [{
|
|
3554
|
+
type: Output
|
|
3555
|
+
}] } });
|
|
3556
|
+
|
|
3341
3557
|
const COMPONENTS = [
|
|
3342
3558
|
GoogleMap,
|
|
3343
3559
|
MapBaseLayer,
|
|
@@ -3349,6 +3565,7 @@ const COMPONENTS = [
|
|
|
3349
3565
|
MapInfoWindow,
|
|
3350
3566
|
MapKmlLayer,
|
|
3351
3567
|
MapMarker,
|
|
3568
|
+
MapAdvancedMarker,
|
|
3352
3569
|
MapMarkerClusterer,
|
|
3353
3570
|
MapPolygon,
|
|
3354
3571
|
MapPolyline,
|
|
@@ -3368,6 +3585,7 @@ class GoogleMapsModule {
|
|
|
3368
3585
|
MapInfoWindow,
|
|
3369
3586
|
MapKmlLayer,
|
|
3370
3587
|
MapMarker,
|
|
3588
|
+
MapAdvancedMarker,
|
|
3371
3589
|
MapMarkerClusterer,
|
|
3372
3590
|
MapPolygon,
|
|
3373
3591
|
MapPolyline,
|
|
@@ -3383,6 +3601,7 @@ class GoogleMapsModule {
|
|
|
3383
3601
|
MapInfoWindow,
|
|
3384
3602
|
MapKmlLayer,
|
|
3385
3603
|
MapMarker,
|
|
3604
|
+
MapAdvancedMarker,
|
|
3386
3605
|
MapMarkerClusterer,
|
|
3387
3606
|
MapPolygon,
|
|
3388
3607
|
MapPolyline,
|
|
@@ -3499,5 +3718,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.0", ngImpor
|
|
|
3499
3718
|
* Generated bundle index. Do not edit.
|
|
3500
3719
|
*/
|
|
3501
3720
|
|
|
3502
|
-
export { GoogleMap, GoogleMapsModule, MapBaseLayer, MapBicyclingLayer, MapCircle, MapDirectionsRenderer, MapDirectionsService, MapEventManager, MapGeocoder, MapGroundOverlay, MapHeatmapLayer, MapInfoWindow, MapKmlLayer, MapMarker, MapMarkerClusterer, MapPolygon, MapPolyline, MapRectangle, MapTrafficLayer, MapTransitLayer };
|
|
3721
|
+
export { GoogleMap, GoogleMapsModule, MapAdvancedMarker, MapBaseLayer, MapBicyclingLayer, MapCircle, MapDirectionsRenderer, MapDirectionsService, MapEventManager, MapGeocoder, MapGroundOverlay, MapHeatmapLayer, MapInfoWindow, MapKmlLayer, MapMarker, MapMarkerClusterer, MapPolygon, MapPolyline, MapRectangle, MapTrafficLayer, MapTransitLayer };
|
|
3503
3722
|
//# sourceMappingURL=google-maps.mjs.map
|