How to use Google Map's Add Directions API?

When clicking a button, it calls this action:

with the ff parameters:

However, nothing is displayed on map.

I suspect I need to add parameters for "DurationCallback" and "DirectionsRequestOptions" ? Can you give me sample inputs.

Have you checked your console log (in the browser) for error messages? Sometimes javascript messages only really show up there. Is your API key set correctly? Can you successfully use a map to show a static address?

Solution

There is a working example of using the Directions (Add/Remove) actions in the demo project for the Google Maps component. Have you taken a look at that? In Service Studio, open up the Google Maps application, and there should be a GoogleMapsDemo module, which you can look at to review how it's done.

Also, you may want to look at the error logs in Service Studio, as well as use the browser's dev tools (usually accessed via F12) to see if there are any errors showing up in the browser console.

Solution