<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	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/"
		>
<channel>
	<title>Comments on: How to calculate driving distance with Google Maps API</title>
	<atom:link href="http://briancray.com/2009/06/23/calculate-driving-distance-google-maps-api/feed/" rel="self" type="application/rss+xml" />
	<link>http://briancray.com/2009/06/23/calculate-driving-distance-google-maps-api/</link>
	<description>User Experience Design, Web Development, and Internet Marketing</description>
	<lastBuildDate>Fri, 12 Mar 2010 01:01:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<atom:link rel="hub" href="http://pubsubhubbub.appspot.com" />
	<atom:link rel="hub" href="http://superfeedr.com/hubbub" />
		<item>
		<title>By: Daniel</title>
		<link>http://briancray.com/2009/06/23/calculate-driving-distance-google-maps-api/#comment-31873</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Thu, 04 Feb 2010 16:56:12 +0000</pubDate>
		<guid isPermaLink="false">http://briancray.com/?p=793#comment-31873</guid>
		<description>James (comment 71). I got this to work with a map being displayed as well. What you need to do is take the map code lines from inside it&#039;s function initialize tag and include them inside the function initialize tag provided Brian&#039;s distance calc code. I had two function initialize tags and since I don&#039;t know squat about javascript, I didn&#039;t realize that was a problem until I experimented. Hope that works.

For anyone else who reads this, I combined this distance calculation with a map that displayed a marker on 1 address with the ui. The distance calc form appears just underneath the map on the page. I also hid the 2nd address field and entered a default address so that the user enters only their home address to calculate the distance to our company address.</description>
		<content:encoded><![CDATA[<p>James (comment 71). I got this to work with a map being displayed as well. What you need to do is take the map code lines from inside it&#8217;s function initialize tag and include them inside the function initialize tag provided Brian&#8217;s distance calc code. I had two function initialize tags and since I don&#8217;t know squat about javascript, I didn&#8217;t realize that was a problem until I experimented. Hope that works.</p>
<p>For anyone else who reads this, I combined this distance calculation with a map that displayed a marker on 1 address with the ui. The distance calc form appears just underneath the map on the page. I also hid the 2nd address field and entered a default address so that the user enters only their home address to calculate the distance to our company address.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://briancray.com/2009/06/23/calculate-driving-distance-google-maps-api/#comment-31836</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Wed, 27 Jan 2010 06:26:08 +0000</pubDate>
		<guid isPermaLink="false">http://briancray.com/?p=793#comment-31836</guid>
		<description>Thanks Brian
Great example. Have you thought of a way to find the latitude / longitude for a point along the path which is, say 100 miles along the path. 
So for example: 
   Address 1: 10 Victoria St, West Rockhampton QLD 4700, Australia (-23.381403:150.486481)
   Address 2: 28 Queen St, Brisbane QLD 4000, Australia (-27.4711478:153.0232475)
   Driving Distance: 384.9394535910284 miles (or 619.5 kilometers)

Finding the position along the route which is 100 miles from the start?</description>
		<content:encoded><![CDATA[<p>Thanks Brian<br />
Great example. Have you thought of a way to find the latitude / longitude for a point along the path which is, say 100 miles along the path.<br />
So for example:<br />
   Address 1: 10 Victoria St, West Rockhampton QLD 4700, Australia (-23.381403:150.486481)<br />
   Address 2: 28 Queen St, Brisbane QLD 4000, Australia (-27.4711478:153.0232475)<br />
   Driving Distance: 384.9394535910284 miles (or 619.5 kilometers)</p>
<p>Finding the position along the route which is 100 miles from the start?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James</title>
		<link>http://briancray.com/2009/06/23/calculate-driving-distance-google-maps-api/#comment-31753</link>
		<dc:creator>James</dc:creator>
		<pubDate>Sun, 10 Jan 2010 14:32:08 +0000</pubDate>
		<guid isPermaLink="false">http://briancray.com/?p=793#comment-31753</guid>
		<description>Thanks Brian exactly what I was looking for,
Im pretty useless at coding so this guide saved me alot of time.

Still trying to figure out how to show the map with the route plotted out as when I try, it causes the whole thing to stop working. Anyone got any ideas how to do this?

http://edgwarelocalcars.co.uk/Booking.html</description>
		<content:encoded><![CDATA[<p>Thanks Brian exactly what I was looking for,<br />
Im pretty useless at coding so this guide saved me alot of time.</p>
<p>Still trying to figure out how to show the map with the route plotted out as when I try, it causes the whole thing to stop working. Anyone got any ideas how to do this?</p>
<p><a href="http://edgwarelocalcars.co.uk/Booking.html" rel="nofollow">http://edgwarelocalcars.co.uk/Booking.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chris</title>
		<link>http://briancray.com/2009/06/23/calculate-driving-distance-google-maps-api/#comment-31727</link>
		<dc:creator>Chris</dc:creator>
		<pubDate>Sat, 09 Jan 2010 12:25:42 +0000</pubDate>
		<guid isPermaLink="false">http://briancray.com/?p=793#comment-31727</guid>
		<description>Great code, many thanks.  I have one problem though.  I&#039;m calculating the driving distance for several pairs and for one of the locations I&#039;m not getting any directions into or out of it.  When I plug it into normal maps it returns directions but there are too many pairs to do this by hand.  I tried finding a solution online and found this gmaps example: http://gmaps-samples.googlecode.com/svn/trunk/gdirections/directions-static.html but when I plug my locations into this I get the following error: &quot;This route has too many vertices.&quot;  Does anyone know what this means or how I can adapt the code to remove the error?</description>
		<content:encoded><![CDATA[<p>Great code, many thanks.  I have one problem though.  I&#8217;m calculating the driving distance for several pairs and for one of the locations I&#8217;m not getting any directions into or out of it.  When I plug it into normal maps it returns directions but there are too many pairs to do this by hand.  I tried finding a solution online and found this gmaps example: <a href="http://gmaps-samples.googlecode.com/svn/trunk/gdirections/directions-static.html" rel="nofollow">http://gmaps-samples.googlecode.com/svn/trunk/gdirections/directions-static.html</a> but when I plug my locations into this I get the following error: &#8220;This route has too many vertices.&#8221;  Does anyone know what this means or how I can adapt the code to remove the error?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://briancray.com/2009/06/23/calculate-driving-distance-google-maps-api/#comment-31668</link>
		<dc:creator>David</dc:creator>
		<pubDate>Tue, 05 Jan 2010 16:25:52 +0000</pubDate>
		<guid isPermaLink="false">http://briancray.com/?p=793#comment-31668</guid>
		<description>Great!  Thanks Jarred:-)</description>
		<content:encoded><![CDATA[<p>Great!  Thanks Jarred:-)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jarred</title>
		<link>http://briancray.com/2009/06/23/calculate-driving-distance-google-maps-api/#comment-31667</link>
		<dc:creator>Jarred</dc:creator>
		<pubDate>Tue, 05 Jan 2010 16:23:58 +0000</pubDate>
		<guid isPermaLink="false">http://briancray.com/?p=793#comment-31667</guid>
		<description>@David
Change this line:
var drivingDistanceMiles = gDir.getDistance().meters / 1609.344;

To:
var drivingDistanceMiles = (gDir.getDistance().meters / 1609.344).toFixed(1);//for 1 decimal place</description>
		<content:encoded><![CDATA[<p>@David<br />
Change this line:<br />
var drivingDistanceMiles = gDir.getDistance().meters / 1609.344;</p>
<p>To:<br />
var drivingDistanceMiles = (gDir.getDistance().meters / 1609.344).toFixed(1);//for 1 decimal place</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://briancray.com/2009/06/23/calculate-driving-distance-google-maps-api/#comment-31666</link>
		<dc:creator>David</dc:creator>
		<pubDate>Tue, 05 Jan 2010 15:01:22 +0000</pubDate>
		<guid isPermaLink="false">http://briancray.com/?p=793#comment-31666</guid>
		<description>Hi, How do you shorten the results distance to  like 9.6 in stead of 9.624418396564066?</description>
		<content:encoded><![CDATA[<p>Hi, How do you shorten the results distance to  like 9.6 in stead of 9.624418396564066?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill</title>
		<link>http://briancray.com/2009/06/23/calculate-driving-distance-google-maps-api/#comment-31649</link>
		<dc:creator>Bill</dc:creator>
		<pubDate>Mon, 04 Jan 2010 13:03:30 +0000</pubDate>
		<guid isPermaLink="false">http://briancray.com/?p=793#comment-31649</guid>
		<description>Thats amazing,its exaclty that i was finding !!!
MANY THANKS !!!</description>
		<content:encoded><![CDATA[<p>Thats amazing,its exaclty that i was finding !!!<br />
MANY THANKS !!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Björn</title>
		<link>http://briancray.com/2009/06/23/calculate-driving-distance-google-maps-api/#comment-31459</link>
		<dc:creator>Björn</dc:creator>
		<pubDate>Mon, 28 Dec 2009 20:43:31 +0000</pubDate>
		<guid isPermaLink="false">http://briancray.com/?p=793#comment-31459</guid>
		<description>Hi Brian,

Can you please tell me if its possible and if so how to get the time it takes to drive the entered distance, can i replace .meters with .time?</description>
		<content:encoded><![CDATA[<p>Hi Brian,</p>
<p>Can you please tell me if its possible and if so how to get the time it takes to drive the entered distance, can i replace .meters with .time?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Horla</title>
		<link>http://briancray.com/2009/06/23/calculate-driving-distance-google-maps-api/#comment-31451</link>
		<dc:creator>Horla</dc:creator>
		<pubDate>Mon, 28 Dec 2009 11:06:17 +0000</pubDate>
		<guid isPermaLink="false">http://briancray.com/?p=793#comment-31451</guid>
		<description>Hi Brian,
Thanks for this great work. I&#039;m using it for my final year project. My request is: using this tutorial, how can I add a map that will visually show the two location entered in the search boxes?

I&#039;ve try to make it work and show the map (like on google map page) but it&#039;s not working. kindly assist me in this regard as I need to display the map too. it&#039;s for my final year project in college.</description>
		<content:encoded><![CDATA[<p>Hi Brian,<br />
Thanks for this great work. I&#8217;m using it for my final year project. My request is: using this tutorial, how can I add a map that will visually show the two location entered in the search boxes?</p>
<p>I&#8217;ve try to make it work and show the map (like on google map page) but it&#8217;s not working. kindly assist me in this regard as I need to display the map too. it&#8217;s for my final year project in college.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
