Comments on: How to calculate driving distance between 2 locations with Google Maps API https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/ Sat, 10 Mar 2018 01:10:49 +0000 hourly 1 https://wordpress.org/?v=6.6.2 By: Christian Varga https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-583 Mon, 18 May 2015 12:24:00 +0000 https://christianvarga.com/?p=15#comment-583 In reply to franco.

I provided a link to a working demo in my article, you can find it here: https://christianvarga.com/driving_distance.html. You need to look at that, then look at your own code to figure out where you went wrong. I can’t help you any further because you haven’t provided any code or explained your issue. I’m not a mind reader; saying “it doesn’t work” doesn’t give me any information that I can use to help you. Please read the following article: http://mattgemmell.com/what-have-you-tried/

]]>
By: franco https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-582 Mon, 18 May 2015 10:57:00 +0000 https://christianvarga.com/?p=15#comment-582 In reply to Christian Varga.

i have the same problem all i can see is the html session but the java wouldn’t work. Need some help please.

]]>
By: Jananga Hettiarachchi https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-580 Wed, 13 May 2015 11:34:00 +0000 https://christianvarga.com/?p=15#comment-580 dear Guys,
i Know this is bit delay…
i modified the multiple select boxes to multiple check boxes… If u have time try this code…!!!

Waypoints in directions

html, body, #map-canvas {

height: 100%;

margin: 0px;

padding: 0px

}

#panel {

position: absolute;

top: 5px;

left: 50%;

margin-left: -180px;

z-index: 5;

background-color: #fff;

padding: 5px;

border: 1px solid #999;

}

var directionsDisplay;

var directionsService = new google.maps.DirectionsService();

var map;

function initialize() {

directionsDisplay = new google.maps.DirectionsRenderer();

//var chicago = new google.maps.LatLng(41.850033, -87.6500523);

var lanka = new google.maps.LatLng(7.8772157,80.7003428);

var mapOptions = {

zoom: 7,

center: lanka,

mapTypeId: google.maps.MapTypeId.HYBRID,

scrollwheel: false,

navigationControl: false,

mapTypeControl: false,

scaleControl: false,

draggable: false,

}

map = new google.maps.Map(document.getElementById(‘map-canvas’), mapOptions);

directionsDisplay.setMap(map);

}

function calcRoute() {

//alert(“test”);

var start = document.getElementById(‘start’).value;

var end = document.getElementById(‘end’).value;

//alert(start);

var waypts = [];

// var checkboxArray = document.getElementsByName(‘city’);//(‘waypoints’);

var checkboxArray = new Array();//new Array();

//alert(checkboxArray);

$(“.waypoints:checked”).each(function(index, element) {

checkboxArray[index] = $(this).val();

});

//alert(checkboxArray.length);

//alert(checkboxArray[1]);

for (var i = 0; i < checkboxArray.length; i++) {

waypts.push({

location:checkboxArray[i],

stopover:true});

}

//alert("sdgrs");

//var checkboxArray = document.getElementsByClassName('waypoints');

//var checkboxArray = document.getElementsByClassName('waypoints');

//alert(checkboxArray.length);

/*for (var i = 0; i < checkboxArray.length; i++) {

if (checkboxArray.options[i].checked == true) {

waypts.push({

location:checkboxArray[i].value,

stopover:true});

}

}*/

var request = {

origin: start,

destination: end,

waypoints: waypts,

optimizeWaypoints: true,

travelMode: google.maps.TravelMode.DRIVING

};

directionsService.route(request, function(response, status) {

if (status == google.maps.DirectionsStatus.OK) {

directionsDisplay.setDirections(response);

var route = response.routes[0];

var summaryPanel = document.getElementById('directions_panel');

summaryPanel.innerHTML = '';

// For each route, display summary information.

for (var i = 0; i < route.legs.length; i++) {

var routeSegment = i + 1;

summaryPanel.innerHTML += 'Route Segment: ‘ + routeSegment + ‘‘;

summaryPanel.innerHTML += route.legs[i].start_address + ‘ to ‘;

summaryPanel.innerHTML += route.legs[i].end_address + ”;

summaryPanel.innerHTML += route.legs[i].distance.text + ”;

}

}

});

}

google.maps.event.addDomListener(window, ‘load’, initialize);

Start:

Colombo<!–

Boston, MA

New York, NY

Miami, FL–>

Waypoints:

(Check for multiple selection)

<!–

Kaluthata

Negombo

Ratnapura

Galle

Matara

Batticaloa

Trincomalee

Kandy

–>

<!–

Colombo–>

Kaluthata

Negombo

Ratnapura

Galle

Matara

Batticaloa

Trincomalee

Kandy<!–

Anuradhapura–>

End:

Anuradhapura<!–

Seattle, WA

San Francisco, CA

Los Angeles, CA–>

]]>
By: aswan https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-564 Wed, 25 Mar 2015 04:08:00 +0000 https://christianvarga.com/?p=15#comment-564 thnks

]]>
By: Christian Varga https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-563 Tue, 24 Mar 2015 10:04:00 +0000 https://christianvarga.com/?p=15#comment-563 In reply to Aayush Singh.

You can do that using Waypoints: https://developers.google.com/maps/documentation/javascript/examples/directions-waypoints

]]>
By: Aayush Singh https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-562 Tue, 24 Mar 2015 09:22:00 +0000 https://christianvarga.com/?p=15#comment-562 Great work !! Thanks . But suppose I wish to determine distance for multiple locations from a starting point , can you please suggest me about it?? Thanks in advance.

]]>
By: Lars https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-559 Mon, 23 Mar 2015 16:48:00 +0000 https://christianvarga.com/?p=15#comment-559 Thank you very much. Works great and helped me a lot to understand it. You are great.

]]>
By: Amin Mehedi https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-556 Sat, 21 Mar 2015 08:20:00 +0000 https://christianvarga.com/?p=15#comment-556 In reply to Christian Varga.

Thanks again for your valuable suggestion. I already tried some codes which provide me AIR distance between two points, not travled route distance. & Google Way-points had request/query limitation. grrrrr…..

]]>
By: Christian Varga https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-555 Sat, 21 Mar 2015 05:14:00 +0000 https://christianvarga.com/?p=15#comment-555 In reply to Amin Mehedi.

Are the vehicles tracked via GPS? This would allow you to get a very accurate measure of the distance travelled without relying on Google Maps. You could store the latlng every 10 seconds (or so), then at the end of the day, add up the distance between all the latlng points (which can be done mathematically: http://www.movable-type.co.uk/scripts/latlong.html). This would be very accurate. You could even look at how Uber tracks vehicles as an example. If you use Google Maps, the results will be wildly inaccurate – what if someone takes a different route, or doesn’t track one of the trips? There are many issues with this approach, if the data needs to be reliable then I wouldn’t recommend the use of Google Maps. Unfortunately I can’t help you build a solution, I think it would be better if you found a developer in Bangladesh who can come on site and build the solution with you in person.

]]>
By: Amin Mehedi https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-553 Mon, 16 Mar 2015 06:50:00 +0000 https://christianvarga.com/?p=15#comment-553 In reply to Christian Varga.

Thanks for your suggestion. I want to take some of your busy time. Plz read….
My company has a customized VTS (Vehicle Tracking Service) solution, which we assembled here in Bangladesh. I am the web application developer and front-end developed using HTML, CSS, JS, PHP, MySql. Recently one of our client requested us for some requirement. They need total distance covered by every vehicle day-wise. So that, after every 30days, they can calculate the total distance and can change engine oil on that notification. Thats why I need this on php to save in the database. Will you plz guide me or code for me ? My company will pay you for this. If yes, plz response. I will discuss some issues later. Thanks.

]]>
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" version="2.0">
<channel>
<title> Comments on: How to calculate driving distance between 2 locations with Google Maps API </title>
<atom:link href="https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/feed/" rel="self" type="application/rss+xml"/>
<link>https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/</link>
<description/>
<lastBuildDate>Sat, 10 Mar 2018 01:10:49 +0000</lastBuildDate>
<sy:updatePeriod> hourly </sy:updatePeriod>
<sy:updateFrequency> 1 </sy:updateFrequency>
<generator>https://wordpress.org/?v=6.6.2</generator>
<item>
<title> By: Christian Varga </title>
<link>https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-583</link>
<dc:creator>
<![CDATA[ Christian Varga ]]>
</dc:creator>
<pubDate>Mon, 18 May 2015 12:24:00 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=15#comment-583</guid>
<description>
<![CDATA[ In reply to &lt;a href=&quot;https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-582&quot;&gt;franco&lt;/a&gt;. I provided a link to a working demo in my article, you can find it here: https://christianvarga.com/driving_distance.html. You need to look at that, then look at your own code to figure out where you went wrong. I can&#039;t help you any further because you haven&#039;t provided any code or explained your issue. I&#039;m not a mind reader; saying &quot;it doesn&#039;t work&quot; doesn&#039;t give me any information that I can use to help you. Please read the following article: http://mattgemmell.com/what-have-you-tried/ ]]>
</description>
<content:encoded>
<![CDATA[ <p>In reply to <a href="https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-582">franco</a>.</p> <p>I provided a link to a working demo in my article, you can find it here: <a href="https://christianvarga.com/driving_distance.html" rel="nofollow ugc">https://christianvarga.com/driving_distance.html</a>. You need to look at that, then look at your own code to figure out where you went wrong. I can&#8217;t help you any further because you haven&#8217;t provided any code or explained your issue. I&#8217;m not a mind reader; saying &#8220;it doesn&#8217;t work&#8221; doesn&#8217;t give me any information that I can use to help you. Please read the following article: <a href="http://mattgemmell.com/what-have-you-tried/" rel="nofollow ugc">http://mattgemmell.com/what-have-you-tried/</a></p> ]]>
</content:encoded>
</item>
<item>
<title> By: franco </title>
<link>https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-582</link>
<dc:creator>
<![CDATA[ franco ]]>
</dc:creator>
<pubDate>Mon, 18 May 2015 10:57:00 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=15#comment-582</guid>
<description>
<![CDATA[ In reply to &lt;a href=&quot;https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-494&quot;&gt;Christian Varga&lt;/a&gt;. i have the same problem all i can see is the html session but the java wouldn&#039;t work. Need some help please. ]]>
</description>
<content:encoded>
<![CDATA[ <p>In reply to <a href="https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-494">Christian Varga</a>.</p> <p>i have the same problem all i can see is the html session but the java wouldn&#8217;t work. Need some help please.</p> ]]>
</content:encoded>
</item>
<item>
<title> By: Jananga Hettiarachchi </title>
<link>https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-580</link>
<dc:creator>
<![CDATA[ Jananga Hettiarachchi ]]>
</dc:creator>
<pubDate>Wed, 13 May 2015 11:34:00 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=15#comment-580</guid>
<description>
<![CDATA[ dear Guys, i Know this is bit delay... i modified the multiple select boxes to multiple check boxes... If u have time try this code...!!! Waypoints in directions html, body, #map-canvas { height: 100%; margin: 0px; padding: 0px } #panel { position: absolute; top: 5px; left: 50%; margin-left: -180px; z-index: 5; background-color: #fff; padding: 5px; border: 1px solid #999; } &lt;!-- jQuery (necessary for Bootstrap&#039;s JavaScript plugins) --&gt; var directionsDisplay; var directionsService = new google.maps.DirectionsService(); var map; function initialize() { directionsDisplay = new google.maps.DirectionsRenderer(); //var chicago = new google.maps.LatLng(41.850033, -87.6500523); var lanka = new google.maps.LatLng(7.8772157,80.7003428); var mapOptions = { zoom: 7, center: lanka, mapTypeId: google.maps.MapTypeId.HYBRID, scrollwheel: false, navigationControl: false, mapTypeControl: false, scaleControl: false, draggable: false, } map = new google.maps.Map(document.getElementById(&#039;map-canvas&#039;), mapOptions); directionsDisplay.setMap(map); } function calcRoute() { //alert(&quot;test&quot;); var start = document.getElementById(&#039;start&#039;).value; var end = document.getElementById(&#039;end&#039;).value; //alert(start); var waypts = []; // var checkboxArray = document.getElementsByName(&#039;city&#039;);//(&#039;waypoints&#039;); var checkboxArray = new Array();//new Array(); //alert(checkboxArray); $(&quot;.waypoints:checked&quot;).each(function(index, element) { checkboxArray[index] = $(this).val(); }); //alert(checkboxArray.length); //alert(checkboxArray[1]); for (var i = 0; i &#060; checkboxArray.length; i++) { waypts.push({ location:checkboxArray[i], stopover:true}); } //alert(&#034;sdgrs&#034;); //var checkboxArray = document.getElementsByClassName(&#039;waypoints&#039;); //var checkboxArray = document.getElementsByClassName(&#039;waypoints&#039;); //alert(checkboxArray.length); /*for (var i = 0; i &#060; checkboxArray.length; i++) { if (checkboxArray.options[i].checked == true) { waypts.push({ location:checkboxArray[i].value, stopover:true}); } }*/ var request = { origin: start, destination: end, waypoints: waypts, optimizeWaypoints: true, travelMode: google.maps.TravelMode.DRIVING }; directionsService.route(request, function(response, status) { if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); var route = response.routes[0]; var summaryPanel = document.getElementById(&#039;directions_panel&#039;); summaryPanel.innerHTML = &#039;&#039;; // For each route, display summary information. for (var i = 0; i &#060; route.legs.length; i++) { var routeSegment = i + 1; summaryPanel.innerHTML += &#039;&lt;b&gt;Route Segment: &#039; + routeSegment + &#039;&lt;/b&gt;&#039;; summaryPanel.innerHTML += route.legs[i].start_address + &#039; to &#039;; summaryPanel.innerHTML += route.legs[i].end_address + &#039;&#039;; summaryPanel.innerHTML += route.legs[i].distance.text + &#039;&#039;; } } }); } google.maps.event.addDomListener(window, &#039;load&#039;, initialize); &lt;b&gt;Start:&lt;/b&gt; Colombo&#060;!-- Boston, MA New York, NY Miami, FL--&#062; &lt;b&gt;Waypoints:&lt;/b&gt; &lt;i&gt;(Check for multiple selection)&lt;/i&gt; &#060;!-- Kaluthata Negombo Ratnapura Galle Matara Batticaloa Trincomalee Kandy --&#062; &#060;!-- Colombo--&#062; Kaluthata Negombo Ratnapura Galle Matara Batticaloa Trincomalee Kandy&#060;!-- Anuradhapura--&#062; &lt;b&gt;End:&lt;/b&gt; Anuradhapura&#060;!-- Seattle, WA San Francisco, CA Los Angeles, CA--&#062; ]]>
</description>
<content:encoded>
<![CDATA[ <p>dear Guys,<br /> i Know this is bit delay&#8230;<br /> i modified the multiple select boxes to multiple check boxes&#8230; If u have time try this code&#8230;!!!</p> <p> Waypoints in directions</p> <p> html, body, #map-canvas {</p> <p> height: 100%;</p> <p> margin: 0px;</p> <p> padding: 0px</p> <p> }</p> <p> #panel {</p> <p> position: absolute;</p> <p> top: 5px;</p> <p> left: 50%;</p> <p> margin-left: -180px;</p> <p> z-index: 5;</p> <p> background-color: #fff;</p> <p> padding: 5px;</p> <p> border: 1px solid #999;</p> <p> }</p> <p> <!-- jQuery (necessary for Bootstrap's JavaScript plugins) --></p> <p>var directionsDisplay;</p> <p>var directionsService = new google.maps.DirectionsService();</p> <p>var map;</p> <p>function initialize() {</p> <p> directionsDisplay = new google.maps.DirectionsRenderer();</p> <p> //var chicago = new google.maps.LatLng(41.850033, -87.6500523);</p> <p> var lanka = new google.maps.LatLng(7.8772157,80.7003428);</p> <p> var mapOptions = {</p> <p> zoom: 7,</p> <p> center: lanka,</p> <p> mapTypeId: google.maps.MapTypeId.HYBRID,</p> <p> scrollwheel: false,</p> <p> navigationControl: false,</p> <p> mapTypeControl: false,</p> <p> scaleControl: false,</p> <p> draggable: false,</p> <p> }</p> <p> map = new google.maps.Map(document.getElementById(&#8216;map-canvas&#8217;), mapOptions);</p> <p> directionsDisplay.setMap(map);</p> <p>}</p> <p>function calcRoute() {</p> <p> //alert(&#8220;test&#8221;);</p> <p> var start = document.getElementById(&#8216;start&#8217;).value;</p> <p> var end = document.getElementById(&#8216;end&#8217;).value;</p> <p> //alert(start);</p> <p> var waypts = [];</p> <p> // var checkboxArray = document.getElementsByName(&#8216;city&#8217;);//(&#8216;waypoints&#8217;);</p> <p> var checkboxArray = new Array();//new Array();</p> <p> //alert(checkboxArray);</p> <p> $(&#8220;.waypoints:checked&#8221;).each(function(index, element) {</p> <p> checkboxArray[index] = $(this).val();</p> <p> });</p> <p> //alert(checkboxArray.length);</p> <p> //alert(checkboxArray[1]);</p> <p> for (var i = 0; i &lt; checkboxArray.length; i++) {</p> <p> waypts.push({</p> <p> location:checkboxArray[i],</p> <p> stopover:true});</p> <p> }</p> <p> //alert(&quot;sdgrs&quot;);</p> <p> //var checkboxArray = document.getElementsByClassName(&#039;waypoints&#039;);</p> <p> //var checkboxArray = document.getElementsByClassName(&#039;waypoints&#039;);</p> <p> //alert(checkboxArray.length);</p> <p> /*for (var i = 0; i &lt; checkboxArray.length; i++) {</p> <p> if (checkboxArray.options[i].checked == true) {</p> <p> waypts.push({</p> <p> location:checkboxArray[i].value,</p> <p> stopover:true});</p> <p> }</p> <p> }*/</p> <p> var request = {</p> <p> origin: start,</p> <p> destination: end,</p> <p> waypoints: waypts,</p> <p> optimizeWaypoints: true,</p> <p> travelMode: google.maps.TravelMode.DRIVING</p> <p> };</p> <p> directionsService.route(request, function(response, status) {</p> <p> if (status == google.maps.DirectionsStatus.OK) {</p> <p> directionsDisplay.setDirections(response);</p> <p> var route = response.routes[0];</p> <p> var summaryPanel = document.getElementById(&#039;directions_panel&#039;);</p> <p> summaryPanel.innerHTML = &#039;&#039;;</p> <p> // For each route, display summary information.</p> <p> for (var i = 0; i &lt; route.legs.length; i++) {</p> <p> var routeSegment = i + 1;</p> <p> summaryPanel.innerHTML += &#039;<b>Route Segment: &#8216; + routeSegment + &#8216;</b>&#8216;;</p> <p> summaryPanel.innerHTML += route.legs[i].start_address + &#8216; to &#8216;;</p> <p> summaryPanel.innerHTML += route.legs[i].end_address + &#8221;;</p> <p> summaryPanel.innerHTML += route.legs[i].distance.text + &#8221;;</p> <p> }</p> <p> }</p> <p> });</p> <p>}</p> <p>google.maps.event.addDomListener(window, &#8216;load&#8217;, initialize);</p> <p> <b>Start:</b></p> <p> Colombo&lt;!&#8211;</p> <p> Boston, MA</p> <p> New York, NY</p> <p> Miami, FL&#8211;&gt;</p> <p> <b>Waypoints:</b> </p> <p> <i>(Check for multiple selection)</i> </p> <p> &lt;!&#8211;</p> <p> Kaluthata</p> <p> Negombo</p> <p> Ratnapura</p> <p> Galle</p> <p> Matara</p> <p> Batticaloa</p> <p> Trincomalee</p> <p> Kandy</p> <p> &#8211;&gt;</p> <p> &lt;!&#8211;</p> <p> Colombo&#8211;&gt;</p> <p> Kaluthata</p> <p> Negombo</p> <p> Ratnapura</p> <p> Galle</p> <p> Matara</p> <p> Batticaloa</p> <p> Trincomalee</p> <p> Kandy&lt;!&#8211;</p> <p> Anuradhapura&#8211;&gt;</p> <p> <b>End:</b></p> <p> Anuradhapura&lt;!&#8211;</p> <p> Seattle, WA</p> <p> San Francisco, CA</p> <p> Los Angeles, CA&#8211;&gt;</p> ]]>
</content:encoded>
</item>
<item>
<title> By: aswan </title>
<link>https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-564</link>
<dc:creator>
<![CDATA[ aswan ]]>
</dc:creator>
<pubDate>Wed, 25 Mar 2015 04:08:00 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=15#comment-564</guid>
<description>
<![CDATA[ thnks ]]>
</description>
<content:encoded>
<![CDATA[ <p>thnks</p> ]]>
</content:encoded>
</item>
<item>
<title> By: Christian Varga </title>
<link>https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-563</link>
<dc:creator>
<![CDATA[ Christian Varga ]]>
</dc:creator>
<pubDate>Tue, 24 Mar 2015 10:04:00 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=15#comment-563</guid>
<description>
<![CDATA[ In reply to &lt;a href=&quot;https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-562&quot;&gt;Aayush Singh&lt;/a&gt;. You can do that using Waypoints: https://developers.google.com/maps/documentation/javascript/examples/directions-waypoints ]]>
</description>
<content:encoded>
<![CDATA[ <p>In reply to <a href="https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-562">Aayush Singh</a>.</p> <p>You can do that using Waypoints: <a href="https://developers.google.com/maps/documentation/javascript/examples/directions-waypoints" rel="nofollow ugc">https://developers.google.com/maps/documentation/javascript/examples/directions-waypoints</a></p> ]]>
</content:encoded>
</item>
<item>
<title> By: Aayush Singh </title>
<link>https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-562</link>
<dc:creator>
<![CDATA[ Aayush Singh ]]>
</dc:creator>
<pubDate>Tue, 24 Mar 2015 09:22:00 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=15#comment-562</guid>
<description>
<![CDATA[ Great work !! Thanks . But suppose I wish to determine distance for multiple locations from a starting point , can you please suggest me about it?? Thanks in advance. ]]>
</description>
<content:encoded>
<![CDATA[ <p>Great work !! Thanks . But suppose I wish to determine distance for multiple locations from a starting point , can you please suggest me about it?? Thanks in advance.</p> ]]>
</content:encoded>
</item>
<item>
<title> By: Lars </title>
<link>https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-559</link>
<dc:creator>
<![CDATA[ Lars ]]>
</dc:creator>
<pubDate>Mon, 23 Mar 2015 16:48:00 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=15#comment-559</guid>
<description>
<![CDATA[ Thank you very much. Works great and helped me a lot to understand it. You are great. ]]>
</description>
<content:encoded>
<![CDATA[ <p>Thank you very much. Works great and helped me a lot to understand it. You are great.</p> ]]>
</content:encoded>
</item>
<item>
<title> By: Amin Mehedi </title>
<link>https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-556</link>
<dc:creator>
<![CDATA[ Amin Mehedi ]]>
</dc:creator>
<pubDate>Sat, 21 Mar 2015 08:20:00 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=15#comment-556</guid>
<description>
<![CDATA[ In reply to &lt;a href=&quot;https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-555&quot;&gt;Christian Varga&lt;/a&gt;. Thanks again for your valuable suggestion. I already tried some codes which provide me AIR distance between two points, not travled route distance. &#038; Google Way-points had request/query limitation. grrrrr..... ]]>
</description>
<content:encoded>
<![CDATA[ <p>In reply to <a href="https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-555">Christian Varga</a>.</p> <p>Thanks again for your valuable suggestion. I already tried some codes which provide me AIR distance between two points, not travled route distance. &amp; Google Way-points had request/query limitation. grrrrr&#8230;..</p> ]]>
</content:encoded>
</item>
<item>
<title> By: Christian Varga </title>
<link>https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-555</link>
<dc:creator>
<![CDATA[ Christian Varga ]]>
</dc:creator>
<pubDate>Sat, 21 Mar 2015 05:14:00 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=15#comment-555</guid>
<description>
<![CDATA[ In reply to &lt;a href=&quot;https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-553&quot;&gt;Amin Mehedi&lt;/a&gt;. Are the vehicles tracked via GPS? This would allow you to get a very accurate measure of the distance travelled without relying on Google Maps. You could store the latlng every 10 seconds (or so), then at the end of the day, add up the distance between all the latlng points (which can be done mathematically: http://www.movable-type.co.uk/scripts/latlong.html). This would be very accurate. You could even look at how Uber tracks vehicles as an example. If you use Google Maps, the results will be wildly inaccurate - what if someone takes a different route, or doesn&#039;t track one of the trips? There are many issues with this approach, if the data needs to be reliable then I wouldn&#039;t recommend the use of Google Maps. Unfortunately I can&#039;t help you build a solution, I think it would be better if you found a developer in Bangladesh who can come on site and build the solution with you in person. ]]>
</description>
<content:encoded>
<![CDATA[ <p>In reply to <a href="https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-553">Amin Mehedi</a>.</p> <p>Are the vehicles tracked via GPS? This would allow you to get a very accurate measure of the distance travelled without relying on Google Maps. You could store the latlng every 10 seconds (or so), then at the end of the day, add up the distance between all the latlng points (which can be done mathematically: <a href="http://www.movable-type.co.uk/scripts/latlong.html" rel="nofollow ugc">http://www.movable-type.co.uk/scripts/latlong.html</a>). This would be very accurate. You could even look at how Uber tracks vehicles as an example. If you use Google Maps, the results will be wildly inaccurate &#8211; what if someone takes a different route, or doesn&#8217;t track one of the trips? There are many issues with this approach, if the data needs to be reliable then I wouldn&#8217;t recommend the use of Google Maps. Unfortunately I can&#8217;t help you build a solution, I think it would be better if you found a developer in Bangladesh who can come on site and build the solution with you in person.</p> ]]>
</content:encoded>
</item>
<item>
<title> By: Amin Mehedi </title>
<link>https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-553</link>
<dc:creator>
<![CDATA[ Amin Mehedi ]]>
</dc:creator>
<pubDate>Mon, 16 Mar 2015 06:50:00 +0000</pubDate>
<guid isPermaLink="false">https://christianvarga.com/?p=15#comment-553</guid>
<description>
<![CDATA[ In reply to &lt;a href=&quot;https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-552&quot;&gt;Christian Varga&lt;/a&gt;. Thanks for your suggestion. I want to take some of your busy time. Plz read.... My company has a customized VTS (Vehicle Tracking Service) solution, which we assembled here in Bangladesh. I am the web application developer and front-end developed using HTML, CSS, JS, PHP, MySql. Recently one of our client requested us for some requirement. They need total distance covered by every vehicle day-wise. So that, after every 30days, they can calculate the total distance and can change engine oil on that notification. Thats why I need this on php to save in the database. Will you plz guide me or code for me ? My company will pay you for this. If yes, plz response. I will discuss some issues later. Thanks. ]]>
</description>
<content:encoded>
<![CDATA[ <p>In reply to <a href="https://christianvarga.com/how-to-calculate-driving-distance-between-2-locations-with-google-maps-api/#comment-552">Christian Varga</a>.</p> <p>Thanks for your suggestion. I want to take some of your busy time. Plz read&#8230;.<br /> My company has a customized VTS (Vehicle Tracking Service) solution, which we assembled here in Bangladesh. I am the web application developer and front-end developed using HTML, CSS, JS, PHP, MySql. Recently one of our client requested us for some requirement. They need total distance covered by every vehicle day-wise. So that, after every 30days, they can calculate the total distance and can change engine oil on that notification. Thats why I need this on php to save in the database. Will you plz guide me or code for me ? My company will pay you for this. If yes, plz response. I will discuss some issues later. Thanks.</p> ]]>
</content:encoded>
</item>
</channel>
</rss>