dimanche 21 octobre 2018

Render Google Maps from Google Maps API response

I am trying to draw a route between point A to point B. I have been following the link below:

https://developers.google.com/maps/documentation/directions/intro

Following link is an example of how to get the route between Montreal and Toronto. https://maps.googleapis.com/maps/api/directions/json?origin=Toronto&destination=Montreal&key=API_KEY

I get a JSON Response when I run this URL. I have checked a lot, but not able to figure how to render the details from this response into a map. Can someone please help by pointing me in the right direction ?

I have already checked this link: https://developers.google.com/maps/documentation/javascript/examples/directions-simple

I am using alexpechkarev/google-maps package, and Laravel for building this solution. I have run the directions service from the package, which returns the JSON object which is similar to the one given by the link in the google maps api guide.

Any help is appreciated.

Thanks.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire