Commit 705bf5b3 authored by Chris Scott's avatar Chris Scott

Docs

parent fbaf7950
......@@ -24,7 +24,7 @@ The plugin creates the object `window.plugins.backgroundGeoLocation` with the me
`addGeofence(callback, fail)`
`onGeofence(callback, fail)`
`onGeofence(config, callback, fail)`
`getLocations(callback, fail)`
......@@ -199,9 +199,9 @@ Keep in mind that it is **not** possible to use ```start()``` at the ```pause```
Configures the plugin's parameters (@see following [Config](https://github.com/christocracy/cordova-background-geolocation/blob/edge/README.md#config) section for accepted ```config``` params. The ```locationCallback``` will be executed each time a new Geolocation is recorded and provided with the following parameters:
######`@param {Object} location` The Location data
#######`@param {Object} location` The Location data
`{"coords":{"latitude":45.5192735,"longitude":-73.6168883,"accuracy":10,"speed":0,"heading":0,"altitude":0},"timestamp":"2015-05-27T18:26:44Z"}`
######`@param {Integer} taskId` The taskId used to send to bgGeo.finish(taskId) in order to signal completion of your callbackFn
#######`@param {Integer} taskId` The taskId used to send to bgGeo.finish(taskId) in order to signal completion of your callbackFn
#####`setConfig(successFn, failureFn, config)`
Reconfigure plugin's configuration (@see followign ##Config## section for accepted ```config``` params. **NOTE** The plugin will continue to send recorded Geolocation to the ```locationCallback``` you provided to ```configure``` method -- use this method only to change configuration params (eg: ```distanceFilter```, ```stationaryRadius```, etc).
......@@ -254,10 +254,10 @@ bgGeo.onStationary(function(location, taskId) {
#####`addGeofence(config, callbackFn, failureFn)`
Adds a geofence to be monitored by the native plugin. Monitoring of a geofence is halted after a crossing occurs. The `config` object accepts the following params.
######`@config {String} identifier The name of your geofence, eg: "Home", "Office"
######`@config {Float} radius The radius (meters) of the geofence. In practice, you should make this >= 100 meters.
######`@config {Float} latitude Latitude of the center-point of the circular geofence.
######`@config {Float} longitude Longitude of the center-point of the circular geofence.
#######`@config {String} identifier The name of your geofence, eg: "Home", "Office"
#######`@config {Float} radius The radius (meters) of the geofence. In practice, you should make this >= 100 meters.
#######`@config {Float} latitude Latitude of the center-point of the circular geofence.
#######`@config {Float} longitude Longitude of the center-point of the circular geofence.
```
bgGeo.addGeofence({
......@@ -275,8 +275,8 @@ bgGeo.addGeofence({
#####`onGeofence(callbackFn)`
Adds a geofence event-listener. Your supplied callback will be called when any monitored geofence crossing occurs. The `callbackFn` will be provided the following parameters:
######`@param {String} identifier The name of the geofence which generated the crossing event, eg: "Home"
######`@param {Integer} taskId The background taskId which you must send back to the native plugin via `bgGeo.finish(taskId)` in order to signal that your callback is complete.
#######`@param {String} identifier The name of the geofence which generated the crossing event, eg: "Home"
#######`@param {Integer} taskId The background taskId which you must send back to the native plugin via `bgGeo.finish(taskId)` in order to signal that your callback is complete.
```
bgGeo.onGeofence(function(identifier, taskId) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment