google maps api 3 - Is there a way that I can tell the direction request to stay on one road while it plots the start to end? -


is there way can tell direction request stay on 1 road while plots start end?

request:

  • say start (lat/lon) , end (lat/lon) on route us1.
  • say interstate i-95 runs parallel along route us1 @ above start end segment.
  • api route direction request above start end.

map route shows:

  • starts @ start point on route us1.
  • takes exit us1 run route on i-95.
  • just before end point, takes exit i-95 us1 , ends @ end point on route us1.

current behavior:

above routing understandable google api plots direction on fastest route , api takes route i-95 parallel segment of us1.

my requirement:

is there parameter can specify in below direction request stay on us1 route, regardless of faster/quicker/shorter alternate route?

var request = {           origin:start,           destination:end,           travelmode: google.maps.directionstravelmode.driving        }; 

you can set few optional parameters request:

  1. you can provide waypoints (up 8, include origin , destination) direction go via waypoints.
  2. you can provide avoid avoid tollways or highways (i don't know if case in question.
  3. you can set alternatives true. way, google provide more 1 alternative route may 1 looking for.

https://developers.google.com/maps/documentation/directions/#requestparameters (scroll down 'optional parameters').

hope you


Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -