From 7f820b490e27ed3cabb8c013ab56b355e7b99fd8 Mon Sep 17 00:00:00 2001 From: Umar Bolatov Date: Tue, 22 May 2018 22:06:29 -0700 Subject: [PATCH] Fix #25954 --- types/googlemaps/googlemaps-tests.ts | 20 ++++++++++++++++++++ types/googlemaps/index.d.ts | 19 +++++++++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/types/googlemaps/googlemaps-tests.ts b/types/googlemaps/googlemaps-tests.ts index 973a15d03f..561e53f91a 100644 --- a/types/googlemaps/googlemaps-tests.ts +++ b/types/googlemaps/googlemaps-tests.ts @@ -40,6 +40,26 @@ let map: google.maps.Map = new google.maps.Map( mapOptions ); +/***** Fitting map to bounds *****/ +map.fitBounds({ + north: 10, + east: 10, + west: 10, + south: 10 +}, 50); + +map.fitBounds({ + east: 10, + north: 10, + south: 10, + west: 10 +}, { + bottom: 100, + left: 150, + right: 150, + top: 50 +}); + /***** Data *****/ diff --git a/types/googlemaps/index.d.ts b/types/googlemaps/index.d.ts index 5c4cca2eb3..9430698fe6 100644 --- a/types/googlemaps/index.d.ts +++ b/types/googlemaps/index.d.ts @@ -1,6 +1,14 @@ // Type definitions for Google Maps JavaScript API 3.30 // Project: https://developers.google.com/maps/ -// Definitions by: Folia A/S , Chris Wrench , Kiarash Ghiaseddin , Grant Hutchins , Denis Atyasov , Michael McMullin , Martin Costello , Sven Kreiss +// Definitions by: Folia A/S , +// Chris Wrench , +// Kiarash Ghiaseddin , +// Grant Hutchins , +// Denis Atyasov , +// Michael McMullin , +// Martin Costello , +// Sven Kreiss +// Umar Bolatov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /* @@ -31,7 +39,7 @@ declare namespace google.maps { /***** Map *****/ export class Map extends MVCObject { constructor(mapDiv: Element|null, opts?: MapOptions); - fitBounds(bounds: LatLngBounds|LatLngBoundsLiteral, padding?: number): void; + fitBounds(bounds: LatLngBounds|LatLngBoundsLiteral, padding?: number|Padding): void; getBounds(): LatLngBounds|null|undefined; getCenter(): LatLng; getDiv(): Element; @@ -58,6 +66,13 @@ declare namespace google.maps { setClickableIcons(clickable: boolean): void; } + export interface Padding { + bottom: number; + left: number; + right: number; + top: number; + } + export interface MapOptions { /** * Color used for the background of the Map div. This color will be visible when