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:
- Show the cars starting position, and route taken as indicated by the grey line in the image.
- Show the cars destination, indicated by blue line.
- 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.