1 | export var google: any;
|
2 |
|
3 | export interface GoogleMap extends MVCObject {
|
4 | constructor(el: HTMLElement, opts?: MapOptions): void;
|
5 | panTo(latLng: LatLng|LatLngLiteral): void;
|
6 | setZoom(zoom: number): void;
|
7 | getCenter(): LatLng;
|
8 | setCenter(latLng: LatLng|LatLngLiteral): void;
|
9 | getBounds(): LatLngBounds;
|
10 | getZoom(): number;
|
11 | setOptions(options: MapOptions): void;
|
12 | panToBounds(latLngBounds: LatLngBounds|LatLngBoundsLiteral): void;
|
13 | fitBounds(bounds: LatLngBounds|LatLngBoundsLiteral): void;
|
14 | }
|
15 |
|
16 | export interface LatLng {
|
17 | constructor(lat: number, lng: number): void;
|
18 | lat(): number;
|
19 | lng(): number;
|
20 | }
|
21 |
|
22 | export interface Marker extends MVCObject {
|
23 | constructor(options?: MarkerOptions): void;
|
24 | setMap(map: GoogleMap): void;
|
25 | setPosition(latLng: LatLng|LatLngLiteral): void;
|
26 | setTitle(title: string): void;
|
27 | setLabel(label: string|MarkerLabel): void;
|
28 | setDraggable(draggable: boolean): void;
|
29 | setIcon(icon: string): void;
|
30 | setOpacity(opacity: number): void;
|
31 | setVisible(visible: boolean): void;
|
32 | setZIndex(zIndex: number): void;
|
33 | getLabel(): MarkerLabel;
|
34 | }
|
35 |
|
36 | export interface MarkerOptions {
|
37 | position: LatLng|LatLngLiteral;
|
38 | title?: string;
|
39 | map?: GoogleMap;
|
40 | label?: string|MarkerLabel;
|
41 | draggable?: boolean;
|
42 | icon?: string;
|
43 | opacity?: number;
|
44 | visible?: boolean;
|
45 | zIndex?: number;
|
46 | }
|
47 |
|
48 | export interface MarkerLabel {
|
49 | color: string;
|
50 | fontFamily: string;
|
51 | fontSize: string;
|
52 | fontWeight: string;
|
53 | text: string;
|
54 | }
|
55 |
|
56 | export interface Circle extends MVCObject {
|
57 | getBounds(): LatLngBounds;
|
58 | getCenter(): LatLng;
|
59 | getDraggable(): boolean;
|
60 | getEditable(): boolean;
|
61 | getMap(): GoogleMap;
|
62 | getRadius(): number;
|
63 | getVisible(): boolean;
|
64 | setCenter(center: LatLng|LatLngLiteral): void;
|
65 | setDraggable(draggable: boolean): void;
|
66 | setEditable(editable: boolean): void;
|
67 | setMap(map: GoogleMap): void;
|
68 | setOptions(options: CircleOptions): void;
|
69 | setRadius(radius: number): void;
|
70 | setVisible(visible: boolean): void;
|
71 | }
|
72 |
|
73 | export interface CircleOptions {
|
74 | center?: LatLng|LatLngLiteral;
|
75 | clickable?: boolean;
|
76 | draggable?: boolean;
|
77 | editable?: boolean;
|
78 | fillColor?: string;
|
79 | fillOpacity?: number;
|
80 | map?: GoogleMap;
|
81 | radius?: number;
|
82 | strokeColor?: string;
|
83 | strokeOpacity?: number;
|
84 | strokePosition?: 'CENTER'|'INSIDE'|'OUTSIDE';
|
85 | strokeWeight?: number;
|
86 | visible?: boolean;
|
87 | zIndex?: number;
|
88 | }
|
89 |
|
90 | export interface LatLngBounds {
|
91 | contains(latLng: LatLng): boolean;
|
92 | equals(other: LatLngBounds|LatLngBoundsLiteral): boolean;
|
93 | extend(point: LatLng): void;
|
94 | getCenter(): LatLng;
|
95 | getNorthEast(): LatLng;
|
96 | getSouthWest(): LatLng;
|
97 | intersects(other: LatLngBounds|LatLngBoundsLiteral): boolean;
|
98 | isEmpty(): boolean;
|
99 | toJSON(): LatLngBoundsLiteral;
|
100 | toSpan(): LatLng;
|
101 | toString(): string;
|
102 | toUrlValue(precision?: number): string;
|
103 | union(other: LatLngBounds|LatLngBoundsLiteral): LatLngBounds;
|
104 | }
|
105 |
|
106 | export interface LatLngBoundsLiteral {
|
107 | east: number;
|
108 | north: number;
|
109 | south: number;
|
110 | west: number;
|
111 | }
|
112 |
|
113 | export interface LatLngLiteral {
|
114 | lat: number;
|
115 | lng: number;
|
116 | }
|
117 |
|
118 | export interface MouseEvent { latLng: LatLng; }
|
119 |
|
120 | export interface MapOptions {
|
121 | center?: LatLng|LatLngLiteral;
|
122 | zoom?: number;
|
123 | minZoom?: number;
|
124 | maxZoom?: number;
|
125 | disableDoubleClickZoom?: boolean;
|
126 | disableDefaultUI?: boolean;
|
127 | backgroundColor?: string;
|
128 | draggable?: boolean;
|
129 | draggableCursor?: string;
|
130 | draggingCursor?: string;
|
131 | keyboardShortcuts?: boolean;
|
132 | zoomControl?: boolean;
|
133 | styles?: MapTypeStyle[];
|
134 | streetViewControl?: boolean;
|
135 | scaleControl?: boolean;
|
136 | mapTypeControl?: boolean;
|
137 | }
|
138 |
|
139 | export interface MapTypeStyle {
|
140 | elementType?: 'all'|'geometry'|'geometry.fill'|'geometry.stroke'|'labels'|'labels.icon'|
|
141 | 'labels.text'|'labels.text.fill'|'labels.text.stroke';
|
142 | featureType?: 'administrative'|'administrative.country'|'administrative.land_parcel'|
|
143 | 'administrative.locality'|'administrative.neighborhood'|'administrative.province'|'all'|
|
144 | 'landscape'|'landscape.man_made'|'landscape.natural'|'landscape.natural.landcover'|
|
145 | 'landscape.natural.terrain'|'poi'|'poi.attraction'|'poi.business'|'poi.government'|
|
146 | 'poi.medical'|'poi.park'|'poi.place_of_worship'|'poi.school'|'poi.sports_complex'|'road'|
|
147 | 'road.arterial'|'road.highway'|'road.highway.controlled_access'|'road.local'|'transit'|
|
148 | 'transit.line'|'transit.station'|'transit.station.airport'|'transit.station.bus'|
|
149 | 'transit.station.rail'|'water';
|
150 | stylers: MapTypeStyler[];
|
151 | }
|
152 |
|
153 |
|
154 |
|
155 |
|
156 | export interface MapTypeStyler {
|
157 | color?: string;
|
158 | gamma?: number;
|
159 | hue?: string;
|
160 | invert_lightness?: boolean;
|
161 | lightness?: number;
|
162 | saturation?: number;
|
163 | visibility?: string;
|
164 | weight?: number;
|
165 | }
|
166 |
|
167 | export interface InfoWindow extends MVCObject {
|
168 | constructor(opts?: InfoWindowOptions): void;
|
169 | close(): void;
|
170 | getContent(): string|Node;
|
171 | getPosition(): LatLng;
|
172 | getZIndex(): number;
|
173 | open(map?: GoogleMap, anchor?: MVCObject): void;
|
174 | setContent(content: string|Node): void;
|
175 | setOptions(options: InfoWindowOptions): void;
|
176 | setPosition(position: LatLng|LatLngLiteral): void;
|
177 | setZIndex(zIndex: number): void;
|
178 | }
|
179 |
|
180 | export interface MVCObject { addListener(eventName: string, handler: Function): MapsEventListener; }
|
181 |
|
182 | export interface MapsEventListener { remove(): void; }
|
183 |
|
184 | export interface Size {
|
185 | height: number;
|
186 | width: number;
|
187 | constructor(width: number, height: number, widthUnit?: string, heightUnit?: string): void;
|
188 | equals(other: Size): boolean;
|
189 | toString(): string;
|
190 | }
|
191 |
|
192 | export interface InfoWindowOptions {
|
193 | content?: string|Node;
|
194 | disableAutoPan?: boolean;
|
195 | maxWidth?: number;
|
196 | pixelOffset?: Size;
|
197 | position?: LatLng|LatLngLiteral;
|
198 | zIndex?: number;
|
199 | }
|
200 |
|
201 | export interface Point {
|
202 | x: number;
|
203 | y: number;
|
204 | equals(other: Point): boolean;
|
205 | toString(): string;
|
206 | }
|
207 |
|
208 | export interface GoogleSymbol {
|
209 | anchor?: Point;
|
210 | fillColor?: string;
|
211 | fillOpacity?: string;
|
212 | labelOrigin?: Point;
|
213 | path?: string;
|
214 | rotation?: number;
|
215 | scale?: number;
|
216 | strokeColor?: string;
|
217 | strokeOpacity?: number;
|
218 | strokeWeight?: number;
|
219 | }
|
220 |
|
221 | export interface IconSequence {
|
222 | fixedRotation?: boolean;
|
223 | icon?: GoogleSymbol;
|
224 | offset?: string;
|
225 | repeat?: string;
|
226 | }
|
227 |
|
228 | export interface PolylineOptions {
|
229 | clickable?: boolean;
|
230 | draggable?: boolean;
|
231 | editable?: boolean;
|
232 | geodesic?: boolean;
|
233 | icon?: Array<IconSequence>;
|
234 | map?: GoogleMap;
|
235 | path?: Array<LatLng>|Array<LatLng|LatLngLiteral>;
|
236 | strokeColor?: string;
|
237 | strokeOpacity?: number;
|
238 | strokeWeight?: number;
|
239 | visible?: boolean;
|
240 | zIndex?: number;
|
241 | }
|
242 |
|
243 | export interface Polyline extends MVCObject {
|
244 | getDraggable(): boolean;
|
245 | getEditable(): boolean;
|
246 | getMap(): GoogleMap;
|
247 | getPath(): Array<LatLng>;
|
248 | getVisible(): boolean;
|
249 | setDraggable(draggable: boolean): void;
|
250 | setEditable(editable: boolean): void;
|
251 | setMap(map: GoogleMap): void;
|
252 | setOptions(options: PolylineOptions): void;
|
253 | setPath(path: Array<LatLng|LatLngLiteral>): void;
|
254 | setVisible(visible: boolean): void;
|
255 | }
|
256 |
|
257 |
|
258 |
|
259 |
|
260 | export interface PolyMouseEvent extends MouseEvent {
|
261 | edge: number;
|
262 | path: number;
|
263 | vertex: number;
|
264 | }
|
265 |
|
266 | export interface PolygonOptions {
|
267 | clickable?: boolean;
|
268 | draggable?: boolean;
|
269 | editable?: boolean;
|
270 | fillColor?: string;
|
271 | fillOpacity?: number;
|
272 | geodesic?: boolean;
|
273 | icon?: Array<IconSequence>;
|
274 | map?: GoogleMap;
|
275 | paths?: Array<LatLng|LatLngLiteral>|Array<Array<LatLng|LatLngLiteral>>;
|
276 | strokeColor?: string;
|
277 | strokeOpacity?: number;
|
278 | strokeWeight?: number;
|
279 | visible?: boolean;
|
280 | zIndex?: number;
|
281 | }
|
282 |
|
283 | export interface Polygon extends MVCObject {
|
284 | getDraggable(): boolean;
|
285 | getEditable(): boolean;
|
286 | getMap(): GoogleMap;
|
287 | getPath(): Array<LatLng>;
|
288 | getPaths(): Array<Array<LatLng>>;
|
289 | getVisible(): boolean;
|
290 | setDraggable(draggable: boolean): void;
|
291 | setEditable(editable: boolean): void;
|
292 | setMap(map: GoogleMap): void;
|
293 | setPath(path: Array<LatLng>|Array<LatLng|LatLngLiteral>): void;
|
294 | setOptions(options: PolygonOptions): void;
|
295 | setPaths(paths: Array<Array<LatLng|LatLngLiteral>>|Array<LatLng|LatLngLiteral>): void;
|
296 | setVisible(visible: boolean): void;
|
297 | }
|
298 |
|
299 | export interface KmlLayer extends MVCObject {
|
300 | getDefaultViewport(): LatLngBounds;
|
301 | getMap(): GoogleMap;
|
302 | getMetadata(): KmlLayerMetadata;
|
303 | getStatus(): KmlLayerStatus;
|
304 | getUrl(): string;
|
305 | getZIndex(): number;
|
306 | setMap(map: GoogleMap): void;
|
307 | setOptions(options: KmlLayerOptions): void;
|
308 | setUrl(url: string): void;
|
309 | setZIndex(zIndex: number): void;
|
310 | }
|
311 |
|
312 |
|
313 |
|
314 |
|
315 | export type KmlLayerStatus = 'DOCUMENT_NOT_FOUND' |
|
316 | 'DOCUMENT_TOO_LARGE' | 'FETCH_ERROR' | 'INVALID_DOCUMENT' | 'INVALID_REQUEST' |
|
317 | 'LIMITS_EXCEEDED' | 'OK' | 'TIMED_OUT' | 'UNKNOWN';
|
318 |
|
319 |
|
320 |
|
321 |
|
322 | export interface KmlLayerMetadata {
|
323 | author: KmlAuthor;
|
324 | description: string;
|
325 | hasScreenOverlays: boolean;
|
326 | name: string;
|
327 | snippet: string;
|
328 | }
|
329 |
|
330 | export interface KmlAuthor {
|
331 | email: string;
|
332 | name: string;
|
333 | uri: string;
|
334 | }
|
335 |
|
336 | export interface KmlLayerOptions {
|
337 | clickable?: boolean;
|
338 | map?: GoogleMap;
|
339 | preserveViewport?: boolean;
|
340 | screenOverlays?: boolean;
|
341 | suppressInfoWindows?: boolean;
|
342 | url?: string;
|
343 | zIndex?: number;
|
344 | }
|
345 |
|
346 | export interface KmlFeatureData {
|
347 | author: KmlAuthor;
|
348 | description: string;
|
349 | id: string;
|
350 | infoWindowHtml: string;
|
351 | name: string;
|
352 | snippet: string;
|
353 | }
|
354 |
|
355 | export interface KmlMouseEvent extends MouseEvent {
|
356 | featureData: KmlFeatureData;
|
357 | pixelOffset: Size;
|
358 | }
|