[Vuejs]-How to in execute Google API into Nativescript-Vue?

0👍

You may try with axios.
If you hit this api by axios

https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=Washington,DC&destinations=New+York+City,NY&key=YOUR_API_KEY

you will get data like this –

{
"destination_addresses" : [ "New York, NY, USA" ],
"origin_addresses" : [ "Washington, DC, USA" ],
"rows" : [
  {
     "elements" : [
        {
           "distance" : {
              "text" : "225 mi",
              "value" : 361715
           },
           "duration" : {
              "text" : "3 hours 49 mins",
              "value" : 13725
           },
           "status" : "OK"
        }
     ]
  }
],
"status" : "OK"
}

so it’s easy with vuejs for show data in view, if you familiar with vuejs.

Happy coding 🙂

Leave a comment