File tree Expand file tree Collapse file tree 4 files changed +21
-8
lines changed
src/Fable.ReactGoogleMaps Expand file tree Collapse file tree 4 files changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -12,23 +12,36 @@ module Coordinates =
1212 abstract member lat: unit -> float
1313 abstract member lng: unit -> float
1414
15- [<Emit( " new window.google.maps.LatLng($0, $1)" ) >]
16- let newLatLng ( lat : float , lng : float ) : LatLng = jsNative
15+ let newLatLng ( lat : float , lng : float ) : LatLng =
16+ let pos = obj()
17+ pos?lat <- lat
18+ pos?lng <- lng
19+ pos |> unbox
1720
1821
1922 // https://developers.google.com/maps/documentation/javascript/reference/coordinates#LatLngBounds
2023
2124 type LatLngBounds =
2225 abstract member extend : LatLngBounds -> LatLngBounds
2326 abstract member extend : LatLng -> LatLngBounds
24-
25- [<Emit( " new window.google.maps.LatLngBounds($0, $1)" ) >]
26- let newLatLngBounds ( sw : LatLng , ne : LatLng ) : LatLngBounds = jsNative
27+ abstract member getSouthWest : unit -> LatLng
28+ abstract member getNorthEast : unit -> LatLng
29+
30+
31+ let newLatLngBounds ( sw : LatLng , ne : LatLng ) : LatLng =
32+ let bounds = obj()
33+ bounds?sw <- sw
34+ bounds?ne <- ne
35+ bounds |> unbox
2736
2837
2938 [<Emit( " new window.google.maps.LatLngBounds()" ) >]
3039 let newEmptyLatLngBounds () : LatLngBounds = jsNative
3140
41+ let emptyLatLngBounds () : LatLng =
42+ let bounds = obj()
43+ bounds |> unbox
44+
3245module Places =
3346
3447 type [<Pojo>] Geometry = {
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" utf-8" ?>
22<Project Sdk =" Microsoft.NET.Sdk" >
33 <PropertyGroup >
4- <Version >0.4.0 </Version >
4+ <Version >0.4.2 </Version >
55 <TargetFramework >netstandard2.0</TargetFramework >
66 <GenerateDocumentationFile >true</GenerateDocumentationFile >
77 </PropertyGroup >
Original file line number Diff line number Diff line change @@ -147,7 +147,7 @@ let onMapMounted (ref:obj) =
147147 mapRef <- MapRef ref
148148
149149 let bounds =
150- let mutable b = ReactGoogleMaps.Coordinates.newEmptyLatLngBounds ()
150+ let mutable b = ReactGoogleMaps.Coordinates.emptyLatLngBounds ()
151151 for pos in markerPositions do
152152 bunds.extend pos
153153 mapRef.FitBounds bounds
Original file line number Diff line number Diff line change 1- ### 0.4.1
1+ ### 0.4.2
22
33* Cleaning up map bounds
44
You can’t perform that action at this time.
0 commit comments