Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dynamic Map route #1

Open
PalAditya opened this issue Sep 13, 2019 · 2 comments
Open

Add dynamic Map route #1

PalAditya opened this issue Sep 13, 2019 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@PalAditya
Copy link
Member

For now, when the map preview shows up, it only shows the marker to destination. We need it to show the complete route from our location to destination.

Idea: Use directions API (https://maps.googleapis.com/maps/api/directions/json?origin={Start}&destination={End}&mode=driving&key=YOUR_API_KEY) to get the driving route (in result.overview_polyline.points ), which is encoded. The function to decode it is already in index.js, and you need to send a request to maps static API (http://maps.googleapis.com/maps/api/staticmap?sensor=false&zoom=16&size=400x400&path=The_decoded_path_from_above}&key=YOUR_API_KEY) to show the image on the Basic Card already there in dialogflow

Requirements: Synchronous operation is not allowed. Use Promises and asynchronous operation to chain the API calls and then return the results.

@PalAditya PalAditya added enhancement New feature or request good first issue Good for newcomers labels Sep 15, 2019
@apsknight
Copy link
Member

@PalAditya Could you please add some screenshots of required feature by mimicking the behavior in native Google Assistant?

@PalAditya
Copy link
Member Author

Sure. For a longer distance (say Kolkata-Bhubaneswar), the Google assistant shows:

drawing

For a shorter distance (say Khurdha-Bhubaneswar), we have:

drawing

We want to mimic this functionality accurately, with as many polylines (turns) as possible to get from the maps API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants