diff --git a/README.md b/README.md index 6d9e3473..6dea13a6 100644 --- a/README.md +++ b/README.md @@ -319,6 +319,7 @@ export default MyMap; * [`enableAccessibilityElements(...)`](#enableaccessibilityelements) * [`enableCurrentLocation(...)`](#enablecurrentlocation) * [`setPadding(...)`](#setpadding) +* [`getMapBounds()`](#getmapbounds) * [`fitBounds(...)`](#fitbounds) * [`setOnBoundsChangedListener(...)`](#setonboundschangedlistener) * [`setOnCameraIdleListener(...)`](#setoncameraidlelistener) @@ -654,6 +655,19 @@ setPadding(padding: MapPadding) => Promise -------------------- +### getMapBounds() + +```typescript +getMapBounds() => Promise +``` + +Get the map's current viewport latitude and longitude bounds. + +**Returns:** Promise<LatLngBounds> + +-------------------- + + ### fitBounds(...) ```typescript @@ -1169,6 +1183,13 @@ but the current specification only allows X, Y, and (optionally) Z to be defined number[] +#### Marker + +Supports markers of either either "legacy" or "advanced" types. + +google.maps.Marker | google.maps.marker.AdvancedMarkerElement + + ### Enums diff --git a/plugin/ios/Plugin/Map.swift b/plugin/ios/Plugin/Map.swift index 71e4a7de..52701ee4 100644 --- a/plugin/ios/Plugin/Map.swift +++ b/plugin/ios/Plugin/Map.swift @@ -180,10 +180,11 @@ public class Map { let height = Double((item as? UIScrollView)?.contentSize.height ?? 0) let width = Double((item as? UIScrollView)?.contentSize.width ?? 0) - let actualHeight = round(height / 2) + let actualHeightFloor = floor(height / 2) + let actualHeightCeil = ceil(height / 2) - let isWidthEqual = width == self.config.width - let isHeightEqual = actualHeight == self.config.height + let isWidthEqual = width == refWidth + let isHeightEqual = actualHeightFloor == refHeight || actualHeightCeil == refHeight if isWidthEqual && isHeightEqual && item.tag < self.targetViewController?.tag ?? Map.MAP_TAG { return item