UNPKG

3.69 kBTypeScriptView Raw
1import { ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChange } from '@angular/core';
2import { InfoWindowManager } from '../services/managers/info-window-manager';
3import { SebmGoogleMapMarker } from './google-map-marker';
4/**
5 * SebmGoogleMapInfoWindow renders a info window inside a {@link SebmGoogleMapMarker} or standalone.
6 *
7 * ### Example
8 * ```typescript
9 * import { Component } from 'angular2/core';
10 * import { SebmGoogleMap, SebmGoogleMapMarker, SebmGoogleMapInfoWindow } from
11 * 'angular2-google-maps/core';
12 *
13 * @Component({
14 * selector: 'my-map-cmp',
15 * directives: [SebmGoogleMap, SebmGoogleMapMarker, SebmGoogleMapInfoWindow],
16 * styles: [`
17 * .sebm-google-map-container {
18 * height: 300px;
19 * }
20 * `],
21 * template: `
22 * <sebm-google-map [latitude]="lat" [longitude]="lng" [zoom]="zoom">
23 * <sebm-google-map-marker [latitude]="lat" [longitude]="lng" [label]="'M'">
24 * <sebm-google-map-info-window [disableAutoPan]="true">
25 * Hi, this is the content of the <strong>info window</strong>
26 * </sebm-google-map-info-window>
27 * </sebm-google-map-marker>
28 * </sebm-google-map>
29 * `
30 * })
31 * ```
32 */
33export declare class SebmGoogleMapInfoWindow implements OnDestroy, OnChanges, OnInit {
34 private _infoWindowManager;
35 private _el;
36 /**
37 * The latitude position of the info window (only usefull if you use it ouside of a {@link
38 * SebmGoogleMapMarker}).
39 */
40 latitude: number;
41 /**
42 * The longitude position of the info window (only usefull if you use it ouside of a {@link
43 * SebmGoogleMapMarker}).
44 */
45 longitude: number;
46 /**
47 * Disable auto-pan on open. By default, the info window will pan the map so that it is fully
48 * visible when it opens.
49 */
50 disableAutoPan: boolean;
51 /**
52 * All InfoWindows are displayed on the map in order of their zIndex, with higher values
53 * displaying in front of InfoWindows with lower values. By default, InfoWindows are displayed
54 * according to their latitude, with InfoWindows of lower latitudes appearing in front of
55 * InfoWindows at higher latitudes. InfoWindows are always displayed in front of markers.
56 */
57 zIndex: number;
58 /**
59 * Maximum width of the infowindow, regardless of content's width. This value is only considered
60 * if it is set before a call to open. To change the maximum width when changing content, call
61 * close, update maxWidth, and then open.
62 */
63 maxWidth: number;
64 /**
65 * Holds the marker that is the host of the info window (if available)
66 */
67 hostMarker: SebmGoogleMapMarker;
68 /**
69 * Holds the native element that is used for the info window content.
70 */
71 content: Node;
72 /**
73 * Sets the open state for the InfoWindow. You can also call the open() and close() methods.
74 */
75 isOpen: boolean;
76 /**
77 * Emits an event when the info window is closed.
78 */
79 infoWindowClose: EventEmitter<void>;
80 private static _infoWindowOptionsInputs;
81 private _infoWindowAddedToManager;
82 private _id;
83 constructor(_infoWindowManager: InfoWindowManager, _el: ElementRef);
84 ngOnInit(): void;
85 /** @internal */
86 ngOnChanges(changes: {
87 [key: string]: SimpleChange;
88 }): void;
89 private _registerEventListeners();
90 private _updateOpenState();
91 private _setInfoWindowOptions(changes);
92 /**
93 * Opens the info window.
94 */
95 open(): Promise<void>;
96 /**
97 * Closes the info window.
98 */
99 close(): Promise<void>;
100 /** @internal */
101 id(): string;
102 /** @internal */
103 toString(): string;
104 /** @internal */
105 ngOnDestroy(): void;
106}