Skip to content

Commit 6487dfd

Browse files
committed
fix(ios): fixed getTargetContainer calculation
1 parent ac36a4f commit 6487dfd

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ export default MyMap;
319319
* [`enableAccessibilityElements(...)`](#enableaccessibilityelements)
320320
* [`enableCurrentLocation(...)`](#enablecurrentlocation)
321321
* [`setPadding(...)`](#setpadding)
322+
* [`getMapBounds()`](#getmapbounds)
322323
* [`fitBounds(...)`](#fitbounds)
323324
* [`setOnBoundsChangedListener(...)`](#setonboundschangedlistener)
324325
* [`setOnCameraIdleListener(...)`](#setoncameraidlelistener)
@@ -654,6 +655,19 @@ setPadding(padding: MapPadding) => Promise<void>
654655
--------------------
655656

656657

658+
### getMapBounds()
659+
660+
```typescript
661+
getMapBounds() => Promise<LatLngBounds>
662+
```
663+
664+
Get the map's current viewport latitude and longitude bounds.
665+
666+
**Returns:** <code>Promise&lt;LatLngBounds&gt;</code>
667+
668+
--------------------
669+
670+
657671
### fitBounds(...)
658672

659673
```typescript
@@ -1169,6 +1183,13 @@ but the current specification only allows X, Y, and (optionally) Z to be defined
11691183
<code>number[]</code>
11701184

11711185

1186+
#### Marker
1187+
1188+
Supports markers of either either "legacy" or "advanced" types.
1189+
1190+
<code>google.maps.<a href="#marker">Marker</a> | google.maps.marker.AdvancedMarkerElement</code>
1191+
1192+
11721193
### Enums
11731194

11741195

plugin/ios/Plugin/Map.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,11 @@ public class Map {
180180

181181
let height = Double((item as? UIScrollView)?.contentSize.height ?? 0)
182182
let width = Double((item as? UIScrollView)?.contentSize.width ?? 0)
183-
let actualHeight = round(height / 2)
183+
let actualHeightFloor = floor(height / 2)
184+
let actualHeightCeil = ceil(height / 2)
184185

185-
let isWidthEqual = width == self.config.width
186-
let isHeightEqual = actualHeight == self.config.height
186+
let isWidthEqual = width == refWidth
187+
let isHeightEqual = actualHeightFloor == refHeight || actualHeightCeil == refHeight
187188

188189
if isWidthEqual && isHeightEqual && item.tag < self.targetViewController?.tag ?? Map.MAP_TAG {
189190
return item

0 commit comments

Comments
 (0)