1.0.0 • Published 2 years ago

live-gomedia-position v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

live-gomedia-position

Live vehicle geolocation, taken from the GoMedia on-board WiFi entertainment system.

npm version ISC-licensed minimum Node.js version support me via GitHub Sponsors chat with me on Twitter

Installation

npm install live-gomedia-position

Usage

positions() returns an async iterable of geolocation data points.

const {positions} = require('live-gomedia-position')

const sleep = ms => new Promise(resolve => setTimeout(resolve, ms))

for await (const pos of positions()) {
	console.log(pos)
	await sleep(5000)
}
// {
// 	latitude: 52.715446,
// 	longitude: 12.995633,
// 	speed: 27.43, // km/h
// }
// {
// 	latitude: 52.715805,
// 	longitude: 12.992863,
// 	speed: 27.323,
// }

Related

Contributing

If you have a question or need support using live-gomedia-position, please double-check your code and setup first. If you think you have found a bug or want to propose a feature, use the issues page.