beginner developer here. i'm trying build web app displays things current time, weather, , news. i'm trying use google distance matrix api calculate commute time , distance.
the following url spits out json, i'm trying find way parse file , display in html if makes sense. need commute time , distance.
here example: https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=washington,dc&destinations=new+york+city,ny
var units = imperial origins = address1 destinations = destination1 apikey = my_api_key var url = "https://maps.googleapis.com/maps/api/distancematrix/json?units=" + units + "&origins=" + origins + "&destinations=" + destinations + "&key=" +apikey;
typically, use ajax call retrieve addition data. use jquery solution (link api documentation). situation described, sure set datatype
option "json"
. use success
option handle returned data, which, in case, json.
Comments
Post a Comment