I'm not familiar with the @ format, but the replacement isn't too
difficult. As they said, you just modify the start_address contained
within the DirectionsLeg object, BEFORE you send it to
directionsDisplay. Something like this:
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
response.routes[0].legs[0].start_address = "John's Place";
directionsDisplay.setDirections(response);
...
Remember that one of the good features of the directionsService is
that it figures out where you CAN start from (usually on the street).
So if you enter the lat/lng of "My back door," it will not give
directions FROM your back door, but rather from the street in front of
your house. So replace the "start_address" with some thought. Not
sure? You can look at the start_location in the DirectionsLeg object.
- Jeff
On Dec 21, 6:16 am, Tim G <[email protected]> wrote:
> So I submitted a request for the ability to name waypoints similar to
> v2 and google shot it down
> (seehttp://code.google.com/p/gmaps-api-issues/issues/detail?id=2775)
>
> This was the response:
>
> "Any change we make could be done by developers themselves. I.e.
> modifying the (start|end)_address of relevant DirectionsLegs obtained
> from the DirectionsService. The '@' feature was more useful in v2
> because there was no way for developers to modify the directions
> result before it was rendered."
>
> Does anyone what they mean by modifying the address and how I would go
> about doing that?
>
> My goal was to print out a nickname for a location so it would just
> show that rather than the full address or lat/lon on the turn-by-turn
> directions.(ie. John's pl...@123 Secret St. would accomplish this in
> v2).
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.