Skip to content

Commit 2ffec4a

Browse files
committed
Merge branch 'set-zoom' of https://github.com/nojaf/fable-react
# Conflicts: # src/Fable.ReactGoogleMaps/README.md
2 parents 8299cd3 + 94e18be commit 2ffec4a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/Fable.ReactGoogleMaps/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,11 @@ let mutable mapRef = MapRef null
146146
let onMapMounted (ref:obj) =
147147
mapRef <- MapRef ref
148148
149-
let bounds = ReactGoogleMaps.Coordinates.newEmptyLatLngBounds()
150-
151-
markerPositions
152-
|> List.fold (fun (acc:LatLngBounds) pos -> acc.extend pos) bounds
149+
let bounds =
150+
let mutable b = ReactGoogleMaps.Coordinates.newEmptyLatLngBounds()
151+
for pos in markerPositions do
152+
bunds.extend pos
153+
mapRef.FitBounds bounds
153154
154155
let myMap =
155156
googleMap [
@@ -158,4 +159,4 @@ let myMap =
158159
MapProperties.Markers markers
159160
MapProperties.OnMapMounted onMapMounted ]
160161
161-
```
162+
```

0 commit comments

Comments
 (0)