geolocation

0.2.0 • Public • Published

geolocation

geolocation

Dependency Status

Usage

var geolocation = require('geolocation')
 
geolocation.getCurrentPosition(function (err, position) {
  if (err) throw err
  console.log(position)
})

Install

$ npm install geolocation

API

geolocation.getCurrentPosition([options], callback)

Wraps navigator.geolocation.getCurrentPosition and exposes a node-ish api.

geolocation.createWatcher([options], [changeListener])

Returns an instance of Watcher

Class: geolocation.Watcher

Inherits from EventEmitter

new geolocation.Watcher([options])

watcher.start()

Starts watching the current position.

watcher.stop()

Stops watching the current position.

Event: 'change'

Emitted when the position change.

Event: 'error'

Emitted if an error occurs.

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.2.0
    972
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.2.0
    972
  • 0.1.0
    0
  • 0.0.0
    47

Package Sidebar

Install

npm i geolocation

Weekly Downloads

1,019

Version

0.2.0

License

MIT

Last publish

Collaborators

  • tellnes