1

Right now I am using google maps v3, and when i try to get directions between two locations i am displaying the waypoint and stuff as below

Start: Chesterfield Airport Road & McBride and Son Center Drive, Chesterfield, MO 63005, USA

    1.1 mi - about 2 mins
    1. Head west on Chesterfield Airport Rd toward RHL Dr   

    2. Turn right onto Long Rd Crossing DrDestination will be on the right

Destination: 707 Long Road Crossing Drive, Chesterfield, MO 63005, USA

Everything is fine, now i want to cutomize the text in the Destination ex: Company Name So, i couldn't find a way to handle this, if any one know or did this type of stuff let me know...or any work around plz.............

user2486535
  • 428
  • 1
  • 5
  • 21

1 Answers1

3

Add the below line of code in your function where you call API and pass the string to display address.

g_oDirections.route(oRequest, function (response, status) {
    if (status == google.maps.DirectionsStatus.OK) {
        response.routes[0].legs[0].end_address = "Your display text";
    }
}
user2486535
  • 428
  • 1
  • 5
  • 21