<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Google Maps Distance Matrix API]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=737&amp;type=atom" />
	<updated>2018-01-05T08:29:23Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=737</id>
		<entry>
			<title type="html"><![CDATA[Re: Google Maps Distance Matrix API]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=3198#p3198" />
			<content type="html"><![CDATA[<p>Thank YOU!</p>]]></content>
			<author>
				<name><![CDATA[choikeelo]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=619</uri>
			</author>
			<updated>2018-01-05T08:29:23Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=3198#p3198</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Google Maps Distance Matrix API]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=3194#p3194" />
			<content type="html"><![CDATA[<p>Example:<br /></p><div class="codebox"><pre><code>using System.Linq;
using UnityEngine;

public class DistanceAndDuration:MonoBehaviour
{
    private void Start()
    {
        OnlineMapsGoogleDirections.Find(&quot;Los Angeles&quot;, new Vector2(-118.178960f, 35.063995f)).OnComplete += OnGoogleDirectionsComplete;
    }

    private void OnGoogleDirectionsComplete(string response)
    {
        Debug.Log(response);

        OnlineMapsGoogleDirectionsResult result = OnlineMapsGoogleDirections.GetResult(response);
        if (result == null || result.routes.Length == 0) return;

        OnlineMapsGoogleDirectionsResult.Route route = result.routes[0];

        OnlineMaps.instance.AddDrawingElement(new OnlineMapsDrawingLine(route.overview_polyline, Color.red, 3));

        int distance = route.legs.Sum(l =&gt; l.distance.value);
        int duration = route.legs.Sum(l =&gt; l.duration.value);
        Debug.Log(&quot;Distance: &quot; + distance + &quot; meters, or &quot; + (distance / 1000f).ToString(&quot;F2&quot;) + &quot; km&quot;);
        Debug.Log(&quot;Duration: &quot; + duration + &quot; sec, or &quot; + (duration / 60f).ToString(&quot;F1&quot;) + &quot; min, or &quot; + (duration / 3600f).ToString(&quot;F1&quot;) + &quot; hours&quot;);
    }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2018-01-04T12:50:39Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=3194#p3194</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Google Maps Distance Matrix API]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=3192#p3192" />
			<content type="html"><![CDATA[<p>Hello! Could you explain me how to get estimated time of arrival and distance? please give me example of code<br />Thx</p>]]></content>
			<author>
				<name><![CDATA[choikeelo]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=619</uri>
			</author>
			<updated>2018-01-04T03:54:53Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=3192#p3192</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Google Maps Distance Matrix API]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=3188#p3188" />
			<content type="html"><![CDATA[<p>Hello.</p><p>We did not plan to add support for this API, because it can be implemented using Google Directions API.<br />If you really need this API, we can add classes to work with it.<br />But I do not see any advantages over Directions API.</p><p>Yes I speak Russian.<br />If you want, you can write in support in Russian (support@infinity-code.com).<br />For forum posts, please use English.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2018-01-03T15:19:44Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=3188#p3188</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Google Maps Distance Matrix API]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=3186#p3186" />
			<content type="html"><![CDATA[<p>Hello! Do you plan to enter this feature? If yes, when?<br />I need ETA<br /><a href="https://developers.google.com/maps/documentation/distance-matrix/start?hl=ru">https://developers.google.com/maps/docu … tart?hl=ru</a></p><p>Offtop: do you speak rus?</p>]]></content>
			<author>
				<name><![CDATA[choikeelo]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=619</uri>
			</author>
			<updated>2018-01-03T11:35:09Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=3186#p3186</id>
		</entry>
</feed>
