Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/evanshortiss/angular-geo
https://github.com/evanshortiss/angular-geo
Last synced: 21 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/evanshortiss/angular-geo
- Owner: evanshortiss
- Created: 2014-02-20T09:51:28.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-02-27T22:24:51.000Z (over 10 years ago)
- Last Synced: 2024-04-25T05:01:48.998Z (7 months ago)
- Language: Shell
- Size: 469 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Angular Geolocation
A simple wrapper for accessing geolocation features within AngularJS.
I've just started this so it's still a work in progress.
## Tests
Need to write tests.To run the tests run the script **test.sh**. You will need to have node.js and npm installed to do this. Running the tests will run jshint, jslint and a series of test cases.
## API
All methods require a callback with the following format:
```
function(err, res) {
// Sample error handling code...
if(err) {
console.log('Unable to get user position.');
} else {
// Returned object format
// res.latitude;
// res.longitude;
// res.altitude;
// res.accuracy;
// res.altitudeAccuracy;
// res.heading;
// res.speed;
}
}
```### Errors
The error returned to your callback is either **null** or one of the following strings.#####PERMISSION_DENIED
The user has not allowed access to their location.#####POSITION_UNAVAILABLE
Returned when a user's position could not be calculated.#####TIMEOUT
Acquiring the users position took longer than allowed.#####NO_SUPPORT
The device/browser does not support geolocation.### Functions
##### getCoarsePosition([timeout, [maximumAge]], callback)
Gets a users position quickly and a little less accurately than **getFinePosition**. Callback is the only required paramater.##### getFinePosition([timeout, [maximumAge]], callback)
Gets a users position accurately as possible. Callback is the only required paramater.