0

I've been using the google maps api and the DirectionsService to draw a line from the cars current position (startpoint) to the destination.

My goal is to have the following functionality:

  1. Show the cars starting position, and route taken as indicated by the grey line in the image.
  2. Show the cars destination, indicated by blue line.
  3. Based on other "highlights" or "waypoints" nearby, and what route would be required to go to that waypoint, deviating from the original route.

I didn't find any good way to do this, with either the DirectionsService or the normal map and layers. The issue here lies that I need to be able to "predict" a route and draw the line based on the roadnetwork, not just an aerial line from the start position to the current position.

I know this is a vague question, but if someone could point me in the right direction, it would be highly appreciated.

Google Maps Image

duncan
  • 31,401
  • 13
  • 78
  • 99
Stian Bakken
  • 673
  • 1
  • 5
  • 15
  • you want to show route from starting point to destination – D Coder Sep 02 '16 at 09:53
  • @DCoder yes, but I also would like to show the original starting point, current position, destination, and possible de-tours based on other coordinates I have. – Stian Bakken Sep 02 '16 at 09:56
  • see this http://jsfiddle.net/user2314737/u9no8te4/ and this one http://stackoverflow.com/questions/5959788/google-maps-api-v3-how-show-the-direction-from-a-point-a-to-point-b-blue-line – D Coder Sep 02 '16 at 09:57
  • @DCoder I think you misunderstand. If you look at the screenshot above, I don't think that is possible by using the directionsservice. – Stian Bakken Sep 02 '16 at 17:13

0 Answers0