60
Views
2
Comments
Solved
How to use Google Map's Add Directions API?
Question

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.

UserImage.jpg
G Andrew Duthie
 
MVP
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.

2020-09-11 18-53-44
Stacey Levine

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?

UserImage.jpg
G Andrew Duthie
 
MVP
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.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.