File tree Expand file tree Collapse file tree 3 files changed +9
-11
lines changed
src/Fable.ReactGoogleMaps Expand file tree Collapse file tree 3 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -34,14 +34,17 @@ module Coordinates =
3434 bounds?ne <- ne
3535 bounds |> unbox
3636
37-
38- [<Emit( " new window.google.maps.LatLngBounds()" ) >]
39- let newEmptyLatLngBounds () : LatLngBounds = jsNative
4037
41- let emptyLatLngBounds () : LatLng =
38+ let emptyLatLngBounds () : LatLngBounds =
4239 let bounds = obj()
4340 bounds |> unbox
4441
42+ let getBoundsFromLatLngs ( positions : LatLng seq ) : LatLngBounds =
43+ let mutable b = emptyLatLngBounds()
44+ for pos in positions do
45+ b <- b.extend pos
46+ b
47+
4548module Places =
4649
4750 type [<Pojo>] Geometry = {
Original file line number Diff line number Diff line change @@ -145,12 +145,7 @@ let markerPositions: Position list = // ...
145145let mutable mapRef = MapRef null
146146let onMapMounted (ref:obj) =
147147 mapRef <- MapRef ref
148-
149- let bounds =
150- let mutable b = ReactGoogleMaps.Coordinates.emptyLatLngBounds()
151- for pos in markerPositions do
152- bunds.extend pos
153- mapRef.FitBounds bounds
148+ mapRef.FitBounds(getBoundsFromLatLngs markerPositions)
154149
155150let myMap =
156151 googleMap [
Original file line number Diff line number Diff line change 1- ### 0.4.2
1+ ### 0.4.3
22
33* Cleaning up map bounds
44
You can’t perform that action at this time.
0 commit comments