Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

REST client for the OSRM server API

License

NotificationsYou must be signed in to change notification settings

Project-OSRM/osrm.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Client library forOpen Source Routing Machine - OSRM that uses the REST http APIthat is exposed byosrm-routed.

The interface is compatible withnode-osrm. However it is not meant asreplacement fornode-osrm on the server.

Can be used with NodeJS and with browserify.

Example

varOSRM=require('osrm.js');varosrm=newOSRM("https://router.project-osrm.org");osrm.route({coordinates:[[13.438640,52.519930],[13.415852,52.513191]],steps:true,alternatives:false,overview:'simplified',geometries:'polyline'},function(err,result){console.log(result);});osrm.trip({coordinates:[[13.438640,52.519930],[13.415852,52.513191]],steps:true,overview:'simplified',geometries:'polyline'},function(err,result){console.log(result);});osrm.match({coordinates:[[13.438640,52.519930],[13.415852,52.513191]],timestamps:[1460585940,1460585945],steps:true,overview:'simplified',geometries:'polyline'},function(err,result){console.log(result);});osrm.table({coordinates:[[13.438640,52.519930],[13.415852,52.513191],[13.333086,52.4224]],sources:[0],destinations:[1,2]},function(err,result){console.log(result);});osrm.tile([17603,10747,15],function(err,result){console.log(result);// pbf encoded vector tile});//You can also pass it query paths directly:osrm.request('/route/v1/driving/13.438640,52.519930;13.415852,52.513191',function(err,result){});

Testing

npm test # run node tape testsfirefox test.html # check the console if tape tests worked

About

REST client for the OSRM server API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp