driving-distance

How to get total driving distance with Google Maps API V3?

ⅰ亾dé卋堺 提交于 2020-01-09 06:49:03
问题 I used to be able to get it like this: directionsService.route(directionsRequest, function(directionsResult, directionsStatus) { var directionsRenderer = new google.maps.DirectionsRenderer({ directions: directionsResult, map: map }); $('#distance').text(directionsResult.trips[0].routes[0].distance.text) $('#duration').text(directionsResult.trips[0].routes[0].duration.text) }) But it looks like they changed their API on me! Looks like trips is no longer there, and routes only gives you a bunch

How to get total driving distance with Google Maps API V3?

霸气de小男生 提交于 2020-01-09 06:48:03
问题 I used to be able to get it like this: directionsService.route(directionsRequest, function(directionsResult, directionsStatus) { var directionsRenderer = new google.maps.DirectionsRenderer({ directions: directionsResult, map: map }); $('#distance').text(directionsResult.trips[0].routes[0].distance.text) $('#duration').text(directionsResult.trips[0].routes[0].duration.text) }) But it looks like they changed their API on me! Looks like trips is no longer there, and routes only gives you a bunch

Is there any way to determine the driving time between two locations using Apple's Maps API?

流过昼夜 提交于 2019-12-31 02:25:29
问题 I am evaluating using google's Distance Matrix / Places / Maps API, versus Apple's Maps api for an iOS app. I am looking at the MKDirectionsRequest class, and I can't seem to find a way to determine what the driving time is between the two points. If this is possible using the apple Maps API, could someone please point me in the right direction? I am hoping it would be possible to accomplish this just using Apple's API, but it looks like this is only going to be possible with Google's API.

How to calculate the driving distance between two points?

社会主义新天地 提交于 2019-12-11 18:30:59
问题 In my app I am getting the latitude , longitude co-ordinates of places using GeocodeService now I want to get distance between these places. I've tried GetDistanceTo method to get the distance two location co-ordinates but it gives me stright distance. How can I calculate driving distance between two locations? thanks in advance 回答1: To calculate the driving distance you'll have to use the Bing Routes API (or Google, but I assume you're using Bing Maps). There's an example of using the api to

Getting driving distance between two points (lat, lon) using R and Google Map API

徘徊边缘 提交于 2019-12-03 03:43:48
问题 I am trying to get the driving distance between two points with lat/lon given. I can manually put them into google map and get the driving distance but I want to do all this programatically. I guess JavaScript is the language to go. But, I do not know JavaScript and I am fairly familiar using R. I would prefer to do it in R since I am doing all the data analysis in R. I am looking for distance along the road not crow-fly distance. After few hours of trying, I wrote the following function in R

Getting driving distance between two points (lat, lon) using R and Google Map API

孤人 提交于 2019-12-02 15:59:06
I am trying to get the driving distance between two points with lat/lon given. I can manually put them into google map and get the driving distance but I want to do all this programatically. I guess JavaScript is the language to go. But, I do not know JavaScript and I am fairly familiar using R. I would prefer to do it in R since I am doing all the data analysis in R. I am looking for distance along the road not crow-fly distance. After few hours of trying, I wrote the following function in R ( This and this one helped). Do you have any better way to get the distance either within this

Is there any way to determine the driving time between two locations using Apple's Maps API?

纵然是瞬间 提交于 2019-12-01 23:11:45
I am evaluating using google's Distance Matrix / Places / Maps API, versus Apple's Maps api for an iOS app. I am looking at the MKDirectionsRequest class, and I can't seem to find a way to determine what the driving time is between the two points. If this is possible using the apple Maps API, could someone please point me in the right direction? I am hoping it would be possible to accomplish this just using Apple's API, but it looks like this is only going to be possible with Google's API. No, apple does not have any such way to get driving time between 2 locations. I'll suggest using Google

How do I get driving time from Google Maps API?

杀马特。学长 韩版系。学妹 提交于 2019-12-01 07:35:26
I use the following function to estimate the time (in hours) to drive a certain distance, assuming an average speed of 65 km/h: distHoras <- function(origin, destination){ xml.url <- paste0('http://maps.googleapis.com/maps/api/distancematrix/xml?origins=', origin, '&destinations=', destination, '&mode=driving&sensor=false') xmlfile <- xmlParse(getURL(xml.url)) dist <- xmlValue(xmlChildren(xpathApply(xmlfile,"//distance")[[1]])$value) distance <- as.numeric(sub(" km", "", dist)) time <- (distance / 1000) / 65 return(time) } How can I tweak this function in order to have it yield time directly,