parrot-module-geolocation
v0.12.19
Published
Using geolocation with guarantees to obtain a good approximation.
Maintainers
Readme
parrot-module-geolocation
Using geolocation with guarantees to obtain a good approximation.
Browser Compatibility
Install
bower install parrot-module-geolocation --saveGet Started
For use browser geolocation feature we will use parrot.geolocation namespace.
Documentation
parrot.geolocation
.position([Object], <Function>)
Use this method to get your current position.
The method return a callback with Position Object or Error.
Also yo can provide a specific options. default options are:
enableHighAccuracy : true # precision first
maximumAge : 0 # not cache
timeout : 600 # 10s timeoutAnd example of use:
parrot.geolocation.position (position, err) ->
return error if err?
position
# => {accuracy:848, latitude:37, longitude:-1, timestamp:1418986533158}.watch([Object], <Function>, <Function>)
It registers a method handler that will be called when the position changed.
And again you can provide your options, but the default options are:
enableHighAccuracy : false # not necessary precision
timeout : 600 # 10s timeout
maximumAge : 0 # not cacheThis method return a uid that you need to store for clear the handler later.
.clear(<Integer>)
It simply clear a method handler. You need to provide the uid for do the operation.
License
MIT © ParrotJS

