Skip to content

Commit aa830d6

Browse files
committed
Merge pull request DefinitelyTyped#501 from qcz/smallfixes2
Various Google Maps definition fixes
2 parents 6eff7d1 + 4ac9537 commit aa830d6

File tree

1 file changed

+43
-20
lines changed

1 file changed

+43
-20
lines changed

googlemaps/google.maps.d.ts

Lines changed: 43 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ declare module google.maps {
2727
/***** MVC *****/
2828
export class MVCObject {
2929
constructor ();
30+
addListener(eventName: string, handler: (...args: any[]) => void): MapsEventListener;
3031
bindTo(key: string, target: MVCObject, targetKey?: string, noNotify?: bool): void;
3132
changed(key: string): void;
3233
get(key: string): any;
@@ -304,20 +305,23 @@ declare module google.maps {
304305

305306
export class Polyline extends MVCObject {
306307
constructor (opts?: PolylineOptions);
308+
getDraggable(): bool;
307309
getEditable(): bool;
308310
getMap(): Map;
309-
getPath(): MVCArray[];
311+
getPath(): MVCArray;
310312
getVisible(): bool;
313+
setDraggable(draggable: bool): void;
311314
setEditable(editable: bool): void;
312315
setMap(map: Map): void;
313316
setOptions(options: PolylineOptions): void;
314-
setPath(path: MVCArray[]): void;
317+
setPath(path: MVCArray): void;
315318
setPath(path: LatLng[]): void;
316319
setVisible(visible: bool): void;
317320
}
318321

319322
export interface PolylineOptions {
320323
clickable?: bool;
324+
draggable: bool;
321325
editable?: bool;
322326
geodesic?: bool;
323327
icons?: IconSequence[];
@@ -331,32 +335,36 @@ declare module google.maps {
331335
}
332336

333337
export interface IconSequence {
338+
fixedRotation?: bool;
334339
icon?: Symbol;
335340
offset?: string;
336341
repeat?: string;
337342
}
338343

339344
export class Polygon extends MVCObject {
340345
constructor (opts?: PolygonOptions);
346+
getDraggable(): bool;
341347
getEditable(): bool;
342348
getMap(): Map;
343-
getPath(): MVCArray[];
344-
getPaths(): MVCArray[][];
349+
getPath(): MVCArray;
350+
getPaths(): MVCArray[];
345351
getVisible(): bool;
352+
setDraggable(draggable: bool): void;
346353
setEditable(editable: bool): void;
347354
setMap(map: Map): void;
348355
setOptions(options: PolygonOptions): void;
349-
setPath(path: MVCArray[]): void;
356+
setPath(path: MVCArray): void;
350357
setPath(path: LatLng[]): void;
358+
setPaths(paths: MVCArray): void;
351359
setPaths(paths: MVCArray[]): void;
352-
setPaths(paths: MVCArray[][]): void;
353360
setPaths(path: LatLng[]): void;
354361
setPaths(path: LatLng[][]): void;
355362
setVisible(visible: bool): void;
356363
}
357364

358365
export interface PolygonOptions {
359366
clickable?: bool;
367+
draggable?: bool;
360368
editable?: bool;
361369
fillColor?: string;
362370
fillOpacity?: number;
@@ -365,6 +373,7 @@ declare module google.maps {
365373
paths?: any[];
366374
strokeColor?: string;
367375
strokeOpacity?: number;
376+
strokePosition?: StrokePosition;
368377
strokeWeight?: number;
369378
visible?: bool;
370379
zIndex?: number;
@@ -379,10 +388,12 @@ declare module google.maps {
379388
export class Rectangle extends MVCObject {
380389
constructor (opts?: RectangleOptions);
381390
getBounds(): LatLngBounds;
391+
getDraggable(): bool;
382392
getEditable(): bool;
383393
getMap(): Map;
384394
getVisible(): bool;
385395
setBounds(bounds: LatLngBounds): void;
396+
setDraggable(draggable: bool): void;
386397
setEditable(editable: bool): void;
387398
setMap(map: Map): void;
388399
setOptions(options: RectangleOptions): void;
@@ -392,12 +403,14 @@ declare module google.maps {
392403
export interface RectangleOptions {
393404
bounds?: LatLngBounds;
394405
clickable?: bool;
406+
draggable?: bool;
395407
editable?: bool;
396408
fillColor?: string;
397409
fillOpacity?: number;
398410
map?: Map;
399411
strokeColor?: string;
400412
strokeOpacity?: number;
413+
strokePosition?: StrokePosition;
401414
strokeWeight?: number;
402415
visible?: bool;
403416
zIndex?: number;
@@ -407,11 +420,13 @@ declare module google.maps {
407420
constructor (opts?: CircleOptions);
408421
getBounds(): LatLngBounds;
409422
getCenter(): LatLng;
423+
getDraggable(): bool;
410424
getEditable(): bool;
411425
getMap(): Map;
412426
getRadius(): number;
413427
getVisible(): bool;
414428
setCenter(center: LatLng): void;
429+
setDraggable(draggable: bool): void;
415430
setEditable(editable: bool): void;
416431
setMap(map: Map): void;
417432
setOptions(options: CircleOptions): void;
@@ -422,17 +437,25 @@ declare module google.maps {
422437
export interface CircleOptions {
423438
center?: LatLng;
424439
clickable?: bool;
440+
draggable?: bool;
425441
editable?: bool;
426442
fillColor?: string;
427443
fillOpacity?: number;
428444
map?: Map;
429445
radius?: number;
430446
strokeColor?: string;
431447
strokeOpacity?: number;
448+
strokePosition?: StrokePosition;
432449
strokeWeight?: number;
433450
visible?: bool;
434451
zIndex?: number;
435452
}
453+
454+
export enum StrokePosition {
455+
CENTER,
456+
INSIDE,
457+
OUTSIDE
458+
}
436459

437460
export class GroundOverlay extends MVCObject {
438461
constructor (url: string, bounds: LatLngBounds, opts?: GroundOverlayOptions);
@@ -486,7 +509,7 @@ declare module google.maps {
486509
}
487510

488511
export interface GeocoderRequest {
489-
address: string;
512+
address?: string;
490513
bounds?: LatLngBounds;
491514
location?: LatLng;
492515
region?: string;
@@ -1099,7 +1122,7 @@ declare module google.maps {
10991122

11001123
export interface StreetViewPov {
11011124
heading?: number;
1102-
picth?: number;
1125+
pitch?: number;
11031126
zoom?: number;
11041127
}
11051128

@@ -1403,28 +1426,28 @@ declare module google.maps {
14031426
}
14041427

14051428
export interface DrawingManagerOptions {
1406-
circleOptions: CircleOptions;
1407-
drawingControl: bool;
1408-
drawingControlOptions: DrawingControlOptions;
1409-
drawingMode: OverlayType;
1410-
map: Map;
1411-
markerOptions: MarkerOptions;
1412-
polygonOptions: PolygonOptions;
1413-
polylineOptions: PolylineOptions;
1414-
rectangleOptions: RectangleOptions;
1429+
circleOptions?: CircleOptions;
1430+
drawingControl?: bool;
1431+
drawingControlOptions?: DrawingControlOptions;
1432+
drawingMode?: OverlayType;
1433+
map?: Map;
1434+
markerOptions?: MarkerOptions;
1435+
polygonOptions?: PolygonOptions;
1436+
polylineOptions?: PolylineOptions;
1437+
rectangleOptions?: RectangleOptions;
14151438
}
14161439

14171440
export interface DrawingControlOptions {
1418-
drawingModes: OverlayType[];
1419-
position: ControlPosition;
1441+
drawingModes?: OverlayType[];
1442+
position?: ControlPosition;
14201443
}
14211444

14221445
export interface OverlayCompleteEvent {
14231446
overlay: MVCObject;
14241447
type: OverlayType;
14251448
}
14261449

1427-
export enum OverlayType {
1450+
export enum OverlayType {
14281451
CIRCLE,
14291452
MARKER,
14301453
POLYGON,

0 commit comments

Comments
 (0)