Skip to content

@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.

Parameters

NameTypeDescription
optionsPositionOptionsOptionally custom options passed to Capacitor geolocation plugin

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

GeolocationInfo

Location got from GPS or IP, the newer is preferred