Merge pull request #25955 from bolatovumar/master

[@types/googlemaps] Fix #25954
This commit is contained in:
Benjamin Lichtman
2018-05-31 21:03:54 -07:00
committed by GitHub
2 changed files with 37 additions and 2 deletions

View File

@@ -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 *****/

View File

@@ -1,6 +1,14 @@
// Type definitions for Google Maps JavaScript API 3.30
// Project: https://developers.google.com/maps/
// Definitions by: Folia A/S <http://www.folia.dk>, Chris Wrench <https://github.com/cgwrench>, Kiarash Ghiaseddin <https://github.com/Silver-Connection/DefinitelyTyped>, Grant Hutchins <https://github.com/nertzy>, Denis Atyasov <https://github.com/xaolas>, Michael McMullin <https://github.com/mrmcnerd>, Martin Costello <https://github.com/martincostello>, Sven Kreiss <https://github.com/svenkreiss>
// Definitions by: Folia A/S <http://www.folia.dk>,
// Chris Wrench <https://github.com/cgwrench>,
// Kiarash Ghiaseddin <https://github.com/Silver-Connection/DefinitelyTyped>,
// Grant Hutchins <https://github.com/nertzy>,
// Denis Atyasov <https://github.com/xaolas>,
// Michael McMullin <https://github.com/mrmcnerd>,
// Martin Costello <https://github.com/martincostello>,
// Sven Kreiss <https://github.com/svenkreiss>
// Umar Bolatov <https://github.com/bolatovumar>
// 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