0

I want to draw a path as i give instruction to google map as below :

  1. Start at the Iowa border on US-61 Northbound at milepost (MP) Grant 0.00.
  2. Continue north for 16.3 miles to WI-133 (Grant County).
  3. Turn left and drive west on WI-133 for about 1.1 miles.
  4. End at MP Grant 1.14 in Potosi at Main Street.

Return Trip:

  1. Start again at MP Grant 1.14 in Potosi at Main Street on WI-133.
  2. Head east back to US-61 for 1.1 miles.
  3. Turn right and drive south on US-61 for 16.3 miles.
  4. End at MP Grant 0.00 at the Iowa border.

When I pass this instruction to google map I want to draw path on google map.

Can we achieve this Using google map?

If Not than give me suggestion how to achieve this?

1
  • Please provide enough code so others can better understand or reproduce the problem. Commented Mar 28 at 16:44

1 Answer 1

0

You Can do this but you need to convert your instructions into geographic coordinates. For example purposes, let’s assume you have these coordinates (you would normally obtain these by geocoding your milepost or known points)

Start - Iowa border at US-61 (e.g., LatLng(42.0, -91.0))

North Point - 16.3 miles north (e.g., LatLng(42.15, -91.0))

Turn Point - Intersection with WI-133 (e.g., LatLng(42.15, -91.02))

End of Outbound - Potosi (e.g., LatLng(42.16, -91.02))

Return Trip - You can reverse these coordinates or define them as needed.

Insted of the instructions you need to send pints from where to where the google map build the map for you according to those points is this help

Sign up to request clarification or add additional context in comments.

1 Comment

I used below code to parse instructions and get LatLng based on instructions. After getting LatLng I will set a marker point on that LatLng and draw a polyline between all instructions. But I will not draw path for road it will draw direct staright line between points PLease check this doc : docs.google.com/document/d/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.