@windy/geolocation
Basic geolocation service, to get users location from GPS or IP, just for the purpose to display users position on the map or give user some type of information related to his location.
Sending users location on your own server is violation of our Terms Of Service and external plugins doing this, will be deleted.
Table of contents
Functions
Functions
getGPSlocation
▸ getGPSlocation(options?
): Promise
<GeolocationInfo
>
Returns promise on GPS based location with GeoIP location as a fallback.
Enables to display information messages to user by default, and enables to get fallback GPS location if GPS location is not available.
Parameters
Name | Type | Description |
---|---|---|
options | GeolocationOptions | Options for geolocation |
Returns
Promise
<GeolocationInfo
>
Geolocation info from GPS, GeoIP as a fallback
getMyLatestPos
▸ getMyLatestPos(): GeolocationInfo
Returns either GPS or IP location whichever is newer.
If none is available, returns fallback location. Although this method provides just a basic, very approximate location it is sync and can be used without user's GPS location permission.
Returns
Location got from GPS or IP, the newer is preferred
requestLocationPermissions
▸ requestLocationPermissions(): Promise
<boolean
>
Returns
Promise
<boolean
>