Static
gps_Static
gps_Abstract
Abstract
Static
gps_Static
createiOSLocationStatic
getStatic
getStatic
startStatic
stopStatic
createiOSLocationStatic
getStatic
getStatic
startStatic
stopRest
...args: any[]Optional
altitude: AltitudeKeysOptional
altitude: AltitudeKeysTracks GPS location updates regardless of the app state. Does not depend on Google Play Services.
-![]() |
|
---|---|
iOS Demo | Android Demo |
Run the following command from the root of your project:
+ + +Run the following command from the root of your project:
ns plugin add @nativescript-community/gps
Here is a simple example. You can find more in the doc here
-import { GPS } from '@nativescript-community/gps';
const gps = new GPS();
const location = await gps.getCurrentLocation<LatLonKeys>({
minimumUpdateTime,
desiredAccuracy,
timeout,
skipPermissionCheck: true
});
-
-Here is a simple example. You can find more in the doc here
+import { GPS } from '@nativescript-community/gps';
const gps = new GPS();
const location = await gps.getCurrentLocation<LatLonKeys>({
minimumUpdateTime,
desiredAccuracy,
timeout,
skipPermissionCheck: true
});
+
+
+The repo uses submodules. If you did not clone with --recursive
then you need to call
The repo uses submodules. If you did not clone with --recursive
then you need to call
git submodule update --init
+
The package manager used to install and link dependencies must be pnpm
or yarn
. npm
wont work.
To develop and test:
if you use yarn
then run yarn
if you use pnpm
then run pnpm i
Interactive Menu:
To start the interactive menu, run npm start
(or yarn start
or pnpm start
). This will list all of the commonly used scripts.
npm run build.all
-
+npm run build.all
+
+
WARNING: it seems yarn build.all
wont always work (not finding binaries in node_modules/.bin
) which is why the doc explicitly uses npm run
npm run demo.[ng|react|svelte|vue].[ios|android]
npm run demo.svelte.ios # Example
-
+npm run demo.[ng|react|svelte|vue].[ios|android]
npm run demo.svelte.ios # Example
+
+
Demo setup is a bit special in the sense that if you want to modify/add demos you dont work directly in demo-[ng|react|svelte|vue]
Instead you work in demo-snippets/[ng|react|svelte|vue]
-You can start from the install.ts
of each flavor to see how to register new demos
You can update the repo files quite easily
+You can start from theinstall.ts
of each flavor to see how to register new demos
+
+
+You can update the repo files quite easily
First update the submodules
-npm run update
-
+npm run update
+
+
Then commit the changes Then update common files
-npm run sync
-
+npm run sync
+
+
Then you can run yarn|pnpm
, commit changed files if any
npm run readme
-
-npm run doc
-
-The publishing is completely handled by lerna
(you can add -- --bump major
to force a major release)
-Simply run
npm run publish
-
-The repo uses https:// for submodules which means you won't be able to push directly into the submodules. +
npm run readme
+
+
+npm run doc
+
+
+The publishing is completely handled by lerna
(you can add -- --bump major
to force a major release)
+Simply run
npm run publish
+
+
+The repo uses https:// for submodules which means you won't be able to push directly into the submodules.
One easy solution is t modify ~/.gitconfig
and add
[url "ssh://git@github.com/"]
pushInsteadOf = https://github.com/
+[url "ssh://git@github.com/"]
pushInsteadOf = https://github.com/
-
-
-Questions
If you have any questions/issues/comments please feel free to create an issue or start a conversation in the NativeScript Community Discord.
-
-Demos and Development
Repo Setup
The repo uses submodules. If you did not clone with --recursive
then you need to call
+
+
+
+Questions
If you have any questions/issues/comments please feel free to create an issue or start a conversation in the NativeScript Community Discord.
+
+Demos and Development
Repo Setup
The repo uses submodules. If you did not clone with --recursive
then you need to call
git submodule update --init
+
The package manager used to install and link dependencies must be pnpm
or yarn
. npm
wont work.
To develop and test:
if you use yarn
then run yarn
if you use pnpm
then run pnpm i
Interactive Menu:
To start the interactive menu, run npm start
(or yarn start
or pnpm start
). This will list all of the commonly used scripts.
-Build
npm run build.all
-
+Build
npm run build.all
+
+
WARNING: it seems yarn build.all
wont always work (not finding binaries in node_modules/.bin
) which is why the doc explicitly uses npm run
-Demos
npm run demo.[ng|react|svelte|vue].[ios|android]
npm run demo.svelte.ios # Example
-
+Demos
npm run demo.[ng|react|svelte|vue].[ios|android]
npm run demo.svelte.ios # Example
+
+
Demo setup is a bit special in the sense that if you want to modify/add demos you dont work directly in demo-[ng|react|svelte|vue]
Instead you work in demo-snippets/[ng|react|svelte|vue]
-You can start from the install.ts
of each flavor to see how to register new demos
-
-Contributing
Update repo
You can update the repo files quite easily
+You can start from the install.ts
of each flavor to see how to register new demos
+
+Contributing
Update repo
You can update the repo files quite easily
First update the submodules
-npm run update
-
+npm run update
+
+
Then commit the changes
Then update common files
-npm run sync
-
+npm run sync
+
+
Then you can run yarn|pnpm
, commit changed files if any
-Update readme
npm run readme
-
-Update doc
npm run doc
-
-Publish
The publishing is completely handled by lerna
(you can add -- --bump major
to force a major release)
-Simply run
-npm run publish
-
-modifying submodules
The repo uses https:// for submodules which means you won't be able to push directly into the submodules.
+
Update readme
npm run readme
+
+
+Update doc
npm run doc
+
+
+Publish
The publishing is completely handled by lerna
(you can add -- --bump major
to force a major release)
+Simply run
+npm run publish
+
+
+modifying submodules
The repo uses https:// for submodules which means you won't be able to push directly into the submodules.
One easy solution is t modify ~/.gitconfig
and add
-[url "ssh://git@github.com/"]
pushInsteadOf = https://github.com/
+[url "ssh://git@github.com/"]
pushInsteadOf = https://github.com/
-
-Questions
If you have any questions/issues/comments please feel free to create an issue or start a conversation in the NativeScript Community Discord.
-
If you have any questions/issues/comments please feel free to create an issue or start a conversation in the NativeScript Community Discord.
+Provides options for location monitoring.
-Provides options for location monitoring.
+Optional
activityiOS only
-Optional
allowsiOS only
-Optional
deferrediOS only
-Optional
desiredSpecifies desired accuracy in meters. Defaults to DesiredAccuracy.HIGH
-Optional
dontmonitor the location in the background.
-Optional
maximumhow old locations to receive in ms.
-Optional
minimumMinimum time interval between location updates, in milliseconds.
-Optional
nmeaOptional
onOptional
onOptional
pausesiOS only
-Optional
providerandroid only
-Optional
skipmonitor the location in the background.
-Optional
timeouthow long to wait for a location in ms.
-Optional
updateUpdate distance filter in meters. Specifies how often to update. Default on iOS is no filter, on Android it is 0 meters
-Optional
activityiOS only
+Optional
allowsiOS only
+Optional
deferrediOS only
+Optional
desiredSpecifies desired accuracy in meters. Defaults to DesiredAccuracy.HIGH
+Optional
dontmonitor the location in the background.
+Optional
maximumhow old locations to receive in ms.
+Optional
minimumMinimum time interval between location updates, in milliseconds.
+Optional
nmeaOptional
onOptional
onOptional
pausesiOS only
+Optional
providerandroid only
+Optional
skipmonitor the location in the background.
+Optional
timeouthow long to wait for a location in ms.
+Optional
updateUpdate distance filter in meters. Specifies how often to update. Default on iOS is no filter, on Android it is 0 meters
+Optional
age?: numberthe location age from the moment it was received
-Optional
android?: anyThe android-specific location object.
-The bearing (course), in degrees.
-Optional
elapsedthe location time in elapsed ms since boot (lot more accurate)
-The horizontal accuracy, in meters.
-Optional
ios?: anyThe ios-specific CLLocation object.
-Optional
msl[android only]: nmea altitude
-Optional
provider?: string[android only]: the provider of the location
-The speed, in meters/second over ground.
-The time at which this location was determined in ms since epoch
-The vertical accuracy, in meters.
-Optional
age?: numberthe location age from the moment it was received
+Optional
android?: anyThe android-specific location object.
+The bearing (course), in degrees.
+Optional
elapsedBoot?: numberthe location time in elapsed ms since boot (lot more accurate)
+The horizontal accuracy, in meters.
+Optional
ios?: anyThe ios-specific CLLocation object.
+Optional
mslAltitude?: number[android only]: nmea altitude
+Optional
provider?: string[android only]: the provider of the location
+The speed, in meters/second over ground.
+The time at which this location was determined in ms since epoch
+The vertical accuracy, in meters.
+Optional
error: ErrorOptional
manager: anyConst
Const
Const
Const
A data class that encapsulates common properties for a geolocation.
-