0

I'm new to the google maps API and i'm interested in whether can i use predefined markers on map as a waypoints. For example i'm going from point A to point B and i'm interested in if points C, D and E are in the route of the direction from A to B. I want to know if this is possible.

For those who can't fully understand my question, imagine line as a route of google maps directions API (Generated by this API). this line (route) has starting point A, and end point B. How can i check if in this route there are C, D, E, points, or not.

Also i'm interested in can i perform such work to make routes so that C, D, E markers must be in the A to B route. i.e. when i choose origin and end points, make sure that generated route go on points D, C, E ?

Thanks in advance Giorgi Jambazishvili

  • You can use the coordinates of the marker as the location of a waypoint. See the [documentation on using waypoints](https://developers.google.com/maps/documentation/javascript/directions#Waypoints) – geocodezip Aug 25 '14 at 15:50
  • possible duplicate of [Google api v3 show nearby markers on customer road](http://stackoverflow.com/questions/24912796/google-api-v3-show-nearby-markers-on-customer-road/24916112#24916112) – geocodezip Aug 25 '14 at 15:53
  • Yes I can use marker coordinates but if that marker is outside the route? I need route to be made from A to B using through markers. – Giorgi Jambazishvili Aug 25 '14 at 16:18
  • I don't know what that means. Isn't that what using the marker coordinates as waypoint locations would do? – geocodezip Aug 25 '14 at 18:15
  • ok, i want google map to make such direction that it would be based on marker locations, not on optimal route. i.e for ex i want user to pass through the shop and shop is marker (in our example). If there is chance that user's one of the planned route would be passing on this marker i want to make this route N1 and don't discuss other ones. There are many markers (shops) and that's the problem, i want to choose direction and pass this direction though this marker if possible – Giorgi Jambazishvili Aug 25 '14 at 21:34
  • Perhaps you could provide your code as it exists and clarify what isn't working as expected. – geocodezip Aug 25 '14 at 22:00

0 Answers0