Skip to content

Lab21k/path-runner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Path Runner

Given an GeoJSON path and a speed, will emit position updates on the correct timing, for instance:

If we have 3 points, 10 kilometers from each other and we pass a speed of 10 km/h, it will emit a position update every hour.

Installation

npm install path-runner --save

Example

const PathRunner = require('path-runner'); let pathRunner = new PathRunner({ "type": "LineString", "coordinates": [ [-43.363037109375, -23.000194727498027], [-43.3604621887207, -23.00011572002358], [-43.35780143737793, -23.000194727498027] ] }, 10); pathRunner.start(); pathRunner.on('position', (pos) => { // Do something });

Contributing

  • Fork the repo

  • Install dependencies (requires node > 4.0)

npm install
  • Run the test suite
mocha
  • Make a pull request

  • ???

  • Profit

About

Makes a point run through a LineString in the correct timing given an average speed

Resources

Stars

Watchers

Forks

Packages

No packages published