diff --git a/plugin/README.md b/plugin/README.md index 0d858c2..e278abd 100644 --- a/plugin/README.md +++ b/plugin/README.md @@ -305,6 +305,7 @@ export default MyMap; * [`enableAccessibilityElements(...)`](#enableaccessibilityelements) * [`enableCurrentLocation(...)`](#enablecurrentlocation) * [`setPadding(...)`](#setpadding) +* [`getMapBounds()`](#getmapbounds) * [`fitBounds(...)`](#fitbounds) * [`setOnBoundsChangedListener(...)`](#setonboundschangedlistener) * [`setOnCameraIdleListener(...)`](#setoncameraidlelistener) @@ -640,6 +641,19 @@ setPadding(padding: MapPadding) => Promise -------------------- +### getMapBounds() + +```typescript +getMapBounds() => Promise +``` + +Get the map's current viewport latitude and longitude bounds. + +**Returns:** Promise<LatLngBounds> + +-------------------- + + ### fitBounds(...) ```typescript diff --git a/plugin/src/map.ts b/plugin/src/map.ts index 8d688cd..977c032 100644 --- a/plugin/src/map.ts +++ b/plugin/src/map.ts @@ -57,6 +57,12 @@ export interface GoogleMapInterface { enableAccessibilityElements(enabled: boolean): Promise; enableCurrentLocation(enabled: boolean): Promise; setPadding(padding: MapPadding): Promise; + /** + * Get the map's current viewport latitude and longitude bounds. + * + * @returns {LatLngBounds} + */ + getMapBounds(): Promise; /** * Sets the map viewport to contain the given bounds. * @param bounds The bounds to fit in the viewport.