We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8299cd3 + 94e18be commit 2ffec4aCopy full SHA for 2ffec4a
src/Fable.ReactGoogleMaps/README.md
@@ -146,10 +146,11 @@ let mutable mapRef = MapRef null
146
let onMapMounted (ref:obj) =
147
mapRef <- MapRef ref
148
149
- let bounds = ReactGoogleMaps.Coordinates.newEmptyLatLngBounds()
150
-
151
- markerPositions
152
- |> List.fold (fun (acc:LatLngBounds) pos -> acc.extend pos) bounds
+ let bounds =
+ let mutable b = ReactGoogleMaps.Coordinates.newEmptyLatLngBounds()
+ for pos in markerPositions do
+ bunds.extend pos
153
+ mapRef.FitBounds bounds
154
155
let myMap =
156
googleMap [
@@ -158,4 +159,4 @@ let myMap =
158
159
MapProperties.Markers markers
160
MapProperties.OnMapMounted onMapMounted ]
161
-```
162
+```
0 commit comments