1 | /// <reference types="googlemaps" />
|
2 | import { AfterContentInit, EventEmitter, OnChanges, OnDestroy, QueryList, SimpleChange } from '@angular/core';
|
3 | import { Observable, ReplaySubject } from 'rxjs';
|
4 | import { FitBoundsAccessor, FitBoundsDetails } from '../services/fit-bounds';
|
5 | import { MarkerManager } from '../services/managers/marker-manager';
|
6 | import { AgmInfoWindow } from './info-window';
|
7 | /**
|
8 | * AgmMarker renders a map marker inside a {@link AgmMap}.
|
9 | *
|
10 | * ### Example
|
11 | * ```typescript
|
12 | * import { Component } from '@angular/core';
|
13 | *
|
14 | * @Component({
|
15 | * selector: 'my-map-cmp',
|
16 | * styles: [`
|
17 | * .agm-map-container {
|
18 | * height: 300px;
|
19 | * }
|
20 | * `],
|
21 | * template: `
|
22 | * <agm-map [latitude]="lat" [longitude]="lng" [zoom]="zoom">
|
23 | * <agm-marker [latitude]="lat" [longitude]="lng" [label]="'M'">
|
24 | * </agm-marker>
|
25 | * </agm-map>
|
26 | * `
|
27 | * })
|
28 | * ```
|
29 | */
|
30 | export declare class AgmMarker implements OnDestroy, OnChanges, AfterContentInit, FitBoundsAccessor {
|
31 | private _markerManager;
|
32 | /**
|
33 | * The latitude position of the marker.
|
34 | */
|
35 | latitude: number;
|
36 | /**
|
37 | * The longitude position of the marker.
|
38 | */
|
39 | longitude: number;
|
40 | /**
|
41 | * The title of the marker.
|
42 | */
|
43 | title: string;
|
44 | /**
|
45 | * The label (a single uppercase character) for the marker.
|
46 | */
|
47 | label: string | google.maps.MarkerLabel;
|
48 | /**
|
49 | * If true, the marker can be dragged. Default value is false.
|
50 | */
|
51 | draggable: boolean;
|
52 | /**
|
53 | * Icon (the URL of the image) for the foreground.
|
54 | */
|
55 | iconUrl: string | google.maps.Icon | google.maps.Symbol;
|
56 | /**
|
57 | * If true, the marker is visible
|
58 | */
|
59 | visible: boolean;
|
60 | /**
|
61 | * Whether to automatically open the child info window when the marker is clicked.
|
62 | */
|
63 | openInfoWindow: boolean;
|
64 | /**
|
65 | * The marker's opacity between 0.0 and 1.0.
|
66 | */
|
67 | opacity: number;
|
68 | /**
|
69 | * All markers are displayed on the map in order of their zIndex, with higher values displaying in
|
70 | * front of markers with lower values. By default, markers are displayed according to their
|
71 | * vertical position on screen, with lower markers appearing in front of markers further up the
|
72 | * screen.
|
73 | */
|
74 | zIndex: number;
|
75 | /**
|
76 | * If true, the marker can be clicked. Default value is true.
|
77 | */
|
78 | clickable: boolean;
|
79 | /**
|
80 | * Which animation to play when marker is added to a map.
|
81 | * This can be 'BOUNCE' or 'DROP'
|
82 | */
|
83 | animation: keyof typeof google.maps.Animation;
|
84 | /**
|
85 | * This event is fired when the marker's animation property changes.
|
86 | */
|
87 | animationChange: EventEmitter<"BOUNCE" | "DROP">;
|
88 | /**
|
89 | * This event emitter gets emitted when the user clicks on the marker.
|
90 | */
|
91 | markerClick: EventEmitter<AgmMarker>;
|
92 | /**
|
93 | * This event emitter gets emitted when the user clicks twice on the marker.
|
94 | */
|
95 | markerDblClick: EventEmitter<AgmMarker>;
|
96 | /**
|
97 | * This event is fired when the user rightclicks on the marker.
|
98 | */
|
99 | markerRightClick: EventEmitter<void>;
|
100 | /**
|
101 | * This event is fired when the user starts dragging the marker.
|
102 | */
|
103 | dragStart: EventEmitter<google.maps.MouseEvent>;
|
104 | /**
|
105 | * This event is repeatedly fired while the user drags the marker.
|
106 | */
|
107 | drag: EventEmitter<google.maps.MouseEvent>;
|
108 | /**
|
109 | * This event is fired when the user stops dragging the marker.
|
110 | */
|
111 | dragEnd: EventEmitter<google.maps.MouseEvent>;
|
112 | /**
|
113 | * This event is fired when the user mouses over the marker.
|
114 | */
|
115 | mouseOver: EventEmitter<google.maps.MouseEvent>;
|
116 | /**
|
117 | * This event is fired when the user mouses outside the marker.
|
118 | */
|
119 | mouseOut: EventEmitter<google.maps.MouseEvent>;
|
120 | /** @internal */
|
121 | infoWindow: QueryList<AgmInfoWindow>;
|
122 | private _markerAddedToManger;
|
123 | private _id;
|
124 | private _observableSubscriptions;
|
125 | protected readonly _fitBoundsDetails$: ReplaySubject<FitBoundsDetails>;
|
126 | constructor(_markerManager: MarkerManager);
|
127 | ngAfterContentInit(): void;
|
128 | private handleInfoWindowUpdate;
|
129 | /** @internal */
|
130 | ngOnChanges(changes: {
|
131 | [key: string]: SimpleChange;
|
132 | }): void;
|
133 | /** @internal */
|
134 | getFitBoundsDetails$(): Observable<FitBoundsDetails>;
|
135 | protected _updateFitBoundsDetails(): void;
|
136 | private _addEventListeners;
|
137 | /** @internal */
|
138 | id(): string;
|
139 | /** @internal */
|
140 | toString(): string;
|
141 | /** @internal */
|
142 | ngOnDestroy(): void;
|
143 | }
|