1 | declare namespace google.maps {
|
2 | |
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | class LatLng {
|
22 | |
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 | constructor(lat: number, lng: number, noWrap?: boolean);
|
31 |
|
32 | /**
|
33 | * Creates a LatLng object representing a geographic point.
|
34 | * @param literal Object literal.
|
35 | * @param noWrap Set noWrap to true to enable values outside of this range.
|
36 | */
|
37 | constructor(literal: LatLngLiteral, noWrap?: boolean);
|
38 |
|
39 | /** Comparison function. */
|
40 | equals(other: LatLng): boolean;
|
41 |
|
42 | /** Returns the latitude in degrees. */
|
43 | lat(): number;
|
44 |
|
45 | /** Returns the longitude in degrees. */
|
46 | lng(): number;
|
47 |
|
48 | /** Converts to string representation. */
|
49 | toString(): string;
|
50 |
|
51 | /**
|
52 | * Returns a string of the form "lat,lng". We round the lat/lng values to 6
|
53 | * decimal places by default.
|
54 | */
|
55 | toUrlValue(precision?: number): string;
|
56 |
|
57 | /**
|
58 | * Converts to JSON representation. This function is intended to be used
|
59 | * via JSON.stringify.
|
60 | */
|
61 | toJSON(): LatLngLiteral;
|
62 | }
|
63 |
|
64 | /**
|
65 | * Object literals are accepted in place of {@link LatLng} objects, as a
|
66 | * convenience, in many places. These are converted to {@link LatLng} objects
|
67 | * when the Maps API encounters them.
|
68 | * @see {@link https:
|
69 | */
|
70 | interface LatLngLiteral {
|
71 | |
72 |
|
73 |
|
74 |
|
75 |
|
76 | lat: number;
|
77 |
|
78 | |
79 |
|
80 |
|
81 |
|
82 |
|
83 |
|
84 | lng: number;
|
85 | }
|
86 |
|
87 |
|
88 | interface ReadonlyLatLngLiteral {
|
89 |
|
90 | readonly lat: number;
|
91 |
|
92 |
|
93 | readonly lng: number;
|
94 | }
|
95 |
|
96 | |
97 |
|
98 |
|
99 |
|
100 | class LatLngBounds {
|
101 | |
102 |
|
103 |
|
104 |
|
105 | constructor(sw?: LatLng | LatLngLiteral, ne?: LatLng | LatLngLiteral);
|
106 |
|
107 | /** Returns true if the given lat/lng is in this bounds. */
|
108 | contains(latLng: LatLng | LatLngLiteral): boolean;
|
109 |
|
110 | /** Returns true if this bounds approximately equals the given bounds. */
|
111 | equals(other: LatLngBounds | LatLngBoundsLiteral): boolean;
|
112 |
|
113 | /** Extends this bounds to contain the given point. */
|
114 | extend(point: LatLng | LatLngLiteral): LatLngBounds;
|
115 |
|
116 | /** Computes the center of this LatLngBounds */
|
117 | getCenter(): LatLng;
|
118 |
|
119 | /** Returns the north-east corner of this bounds. */
|
120 | getNorthEast(): LatLng;
|
121 |
|
122 | /** Returns the south-west corner of this bounds. */
|
123 | getSouthWest(): LatLng;
|
124 |
|
125 | /** Returns true if this bounds shares any points with the other bounds. */
|
126 | intersects(other: LatLngBounds | LatLngBoundsLiteral): boolean;
|
127 |
|
128 | /** Returns if the bounds are empty. */
|
129 | isEmpty(): boolean;
|
130 |
|
131 | /**
|
132 | * Converts to JSON representation. This function is intended to be used
|
133 | * via JSON.stringify.
|
134 | */
|
135 | toJSON(): LatLngBoundsLiteral;
|
136 |
|
137 | /** Converts the given map bounds to a lat/lng span. */
|
138 | toSpan(): LatLng;
|
139 |
|
140 | /** Converts to string. */
|
141 | toString(): string;
|
142 |
|
143 | /**
|
144 | * Returns a string of the form "lat_lo,lng_lo,lat_hi,lng_hi" for this
|
145 | * bounds, where "lo" corresponds to the southwest corner of the bounding
|
146 | * box, while "hi" corresponds to the northeast corner of that box.
|
147 | */
|
148 | toUrlValue(precision?: number): string;
|
149 |
|
150 | /**
|
151 | * Extends this bounds to contain the union of this and the given bounds.
|
152 | */
|
153 | union(other: LatLngBounds | LatLngBoundsLiteral): LatLngBounds;
|
154 | }
|
155 |
|
156 | interface LatLngBoundsLiteral {
|
157 | east: number;
|
158 |
|
159 | north: number;
|
160 |
|
161 | south: number;
|
162 |
|
163 | west: number;
|
164 | }
|
165 |
|
166 | class Point {
|
167 |
|
168 | constructor(x: number, y: number);
|
169 |
|
170 | /** The X coordinate */
|
171 | x: number;
|
172 |
|
173 | /** The Y coordinate */
|
174 | y: number;
|
175 |
|
176 | /** Compares two Points */
|
177 | equals(other: Point): boolean;
|
178 |
|
179 | /** Returns a string representation of this Point. */
|
180 | toString(): string;
|
181 | }
|
182 |
|
183 | class Size {
|
184 | constructor(width: number, height: number, widthUnit?: string, heightUnit?: string);
|
185 |
|
186 | height: number;
|
187 |
|
188 | width: number;
|
189 |
|
190 | equals(other: Size): boolean;
|
191 |
|
192 | toString(): string;
|
193 | }
|
194 |
|
195 | interface Padding {
|
196 | bottom: number;
|
197 |
|
198 | left: number;
|
199 |
|
200 | right: number;
|
201 |
|
202 | top: number;
|
203 | }
|
204 |
|
205 | interface CircleLiteral extends CircleOptions {
|
206 |
|
207 | center?: LatLng | LatLngLiteral;
|
208 |
|
209 |
|
210 | radius?: number;
|
211 | }
|
212 | }
|