2

Am trying to build a server on NodeJS, I want to create a n api the simply takes two points and uses a google api and creates a route, I got lost in web, any recommendation for tutorials is appreciated

motchezz
  • 153
  • 1
  • 1
  • 12

1 Answers1

2

What you need here is a Direction API or Direction Service, it can calculate directions (using a variety of methods of transportation) by using the DirectionsService object. This object communicates with the Google Maps API Directions Service which receives direction requests and returns an efficient path. You may either handle these directions results yourself or use the DirectionsRenderer object to render these results.

The Directions service can return multi-part directions using a series of waypoints. Directions are displayed as a polyline drawing the route on a map.

Here are the sample jsfiddle for it.

http://jsfiddle.net/gHK7s/2/ and http://jsfiddle.net/user2314737/u9no8te4/

Now, to connect it with the Node.js that you want, you can check these SO questions on how to do that.

For more information, check this Node.js Client for Google Maps Services

Community
  • 1
  • 1
KENdi
  • 7,576
  • 2
  • 16
  • 31