Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/watson/geocode-wifi
Returns a latitude and a longitude given an array of wifi access points
https://github.com/watson/geocode-wifi
Last synced: 12 days ago
JSON representation
Returns a latitude and a longitude given an array of wifi access points
- Host: GitHub
- URL: https://github.com/watson/geocode-wifi
- Owner: watson
- License: mit
- Created: 2015-06-13T22:36:30.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-07-07T20:53:06.000Z (over 9 years ago)
- Last Synced: 2024-05-12T06:40:56.059Z (8 months ago)
- Language: JavaScript
- Size: 137 KB
- Stars: 26
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-network-js - geocode-wifi
README
# geocode-wifi
Returns a latitude and a longitude given an array of wifi access points.
[![Build status](https://travis-ci.org/watson/geocode-wifi.svg?branch=master)](https://travis-ci.org/watson/geocode-wifi)
[![js-standard-style](https://raw.githubusercontent.com/feross/standard/master/badge.png)](https://github.com/feross/standard)
## Installation
```
npm install geocode-wifi
```## Usage
This module needs network access in order to communicate with Google so
it can triangulate the provided access points.```js
var geocodeWifi = require('geocode-wifi')var towers = [
{ mac: '0e:1d:41:0c:22:d4', ssid: 'NodeConf', signal: -72 },
{ mac: '01:1c:ef:0c:21:2a', ssid: 'NSA Lobby', signal: -2 },
{ mac: 'e0:53:41:92:00:bb', ssid: 'Microsoft Taco', signal: -89 }
]geocodeWifi(towers, function (err, location) {
if (err) throw err
console.log(location) // => { lat: 38.0690894, lng: -122.8069356, accuracy: 42 }
})
```Geocode-wifi have special support for the
[node-wifiscanner](https://github.com/mauricesvay/node-wifiscanner)
module. This means you can parse the output of node-wifiscanner directly
into geocode-wifi:```js
var geocodeWifi = require('geocode-wifi')
var wifiScanner = require('node-wifiscanner')wifiScanner.scan(function (err, towers) {
if (err) throw errgeocodeWifi(towers, function (err, location) {
if (err) throw errconsole.log(location) // => { lat: 38.0690894, lng: -122.8069356, accuracy: 42 }
})
})
```## License
MIT