Skip to content

Commit 242bcba

Browse files
committed
version 1.0
1 parent 702c4ab commit 242bcba

File tree

4 files changed

+11
-17
lines changed

4 files changed

+11
-17
lines changed

src/Fable.ReactGoogleMaps/Fable.Helpers.ReactGoogleMaps.fs

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,14 @@ let googleMap (props:Props.IMapProperties list) : React.ReactElement =
151151

152152
R.from GoogleMapComponent (keyValueList CaseRules.LowerFirst props) []
153153

154+
open Fable.Import.JS
154155

155-
let getPosition (options: obj) : JS.Promise<obj> = importMember "./location.js"
156-
157-
// open Fable.PowerPack
158-
159-
// let getGeoPosition () =
160-
// promise {
161-
// let! pos = getPosition()
162-
// let c = pos?coords
163-
// return Coordinates.newPos (c?latitude |> unbox) (c?longitude |> unbox)
164-
// }
156+
let getGeoPosition () =
157+
Promise.Create (fun resolve reject ->
158+
let onSucces (position:Browser.Position) =
159+
resolve (Coordinates.newPos position.coords.latitude position.coords.longitude )
160+
let onError (posError:Browser.PositionError) =
161+
reject (System.Exception("Could not determine location", System.Exception(sprintf "%A" posError)))
165162

163+
Browser.navigator.geolocation.getCurrentPosition(onSucces, onError)
164+
)

src/Fable.ReactGoogleMaps/Fable.ReactGoogleMaps.fsproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<Version>0.1.0-beta-002</Version>
4+
<Version>0.1.0</Version>
55
<TargetFramework>netstandard2.0</TargetFramework>
66
<GenerateDocumentationFile>true</GenerateDocumentationFile>
77
</PropertyGroup>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
### 0.1.0-beta-002
1+
### 0.1.0
22

33
* Initial release

src/Fable.ReactGoogleMaps/location.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)