<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Infinity Code Forum — How can I use OnlineMapsFindDirection -> waypoint]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=361</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=361&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in How can I use OnlineMapsFindDirection -> waypoint.]]></description>
		<lastBuildDate>Mon, 05 Feb 2018 11:20:52 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: How can I use OnlineMapsFindDirection -> waypoint]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3329#p3329</link>
			<description><![CDATA[<p>Just delete the last point from the waypoints.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 05 Feb 2018 11:20:52 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3329#p3329</guid>
		</item>
		<item>
			<title><![CDATA[Re: How can I use OnlineMapsFindDirection -> waypoint]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3327#p3327</link>
			<description><![CDATA[<p>One more problem</p><p>In the code I wrote. i want placeLatitude2GO and placeLongitude2GO to disapear and make the last waypoint given. The last waypoint should be where the route ended. But with this code it adds one more route to placeLatitude2GO and placeLongitude2GO.</p><p>How can i solve this?</p>]]></description>
			<author><![CDATA[null@example.com (geral)]]></author>
			<pubDate>Sun, 04 Feb 2018 21:19:09 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3327#p3327</guid>
		</item>
		<item>
			<title><![CDATA[Re: How can I use OnlineMapsFindDirection -> waypoint]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3326#p3326</link>
			<description><![CDATA[<div class="quotebox"><cite>Alex Vertax wrote:</cite><blockquote><p>This is because you pass an array of dummy strings to waypoints.<br />In your case, you need to pass waypoints2.</p><p>In the example in post 2, I meant that you can pass an array or a list that contains the names of the locations (address) or coordinates.</p></blockquote></div><p>Yes that&#039;s it! <br />Sorry for not paying attetion to that detail! <img src="https://forum.infinity-code.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (geral)]]></author>
			<pubDate>Sun, 04 Feb 2018 20:18:55 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3326#p3326</guid>
		</item>
		<item>
			<title><![CDATA[Re: How can I use OnlineMapsFindDirection -> waypoint]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3323#p3323</link>
			<description><![CDATA[<p>This is because you pass an array of dummy strings to waypoints.<br />In your case, you need to pass waypoints2.</p><p>In the example in post 2, I meant that you can pass an array or a list that contains the names of the locations (address) or coordinates.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Sun, 04 Feb 2018 13:57:31 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3323#p3323</guid>
		</item>
		<item>
			<title><![CDATA[Re: How can I use OnlineMapsFindDirection -> waypoint]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3321#p3321</link>
			<description><![CDATA[<p>Thanks for the reply, and your availability!</p><p>The coordinates for placeLatitude2GO and placeLongitude2GO are : 38.56486, -7.920602</p><p>I can generate a valid route between user location and final location. But when I add waypoints as you suggested in the code, the API&nbsp; gives zero results.</p>]]></description>
			<author><![CDATA[null@example.com (geral)]]></author>
			<pubDate>Sun, 04 Feb 2018 11:23:10 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3321#p3321</guid>
		</item>
		<item>
			<title><![CDATA[Re: How can I use OnlineMapsFindDirection -> waypoint]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3320#p3320</link>
			<description><![CDATA[<p>This means Google Directions API can not find this route.</p><p>First of all, try to find a route without waypoints.<br />If this works without waypoints, show me the coordinates that you use in placeLatitude2GO and placeLongitude2GO. I will check it.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Sat, 03 Feb 2018 17:16:00 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3320#p3320</guid>
		</item>
		<item>
			<title><![CDATA[Re: How can I use OnlineMapsFindDirection -> waypoint]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3316#p3316</link>
			<description><![CDATA[<p>Hi</p><p>I&#039;m testing the same, but with no sucess, it always gives me Zero results....</p><div class="codebox"><pre><code>    public float placeLatitude2GO, placeLongitude2GO;
    float placeLatitude1, placeLongitude1;



    string[] waypoints = { &quot;Waypoint 1&quot;, &quot;Waypoint 2&quot;, &quot;Waypoint 3&quot; };
    List&lt;Vector2&gt; waypoints2 = new List&lt;Vector2&gt;
{
    new Vector2(-7.911771f,38.555735f),
    new Vector2(-7.916875f,38.562577f),
    new Vector2(-7.902130f,38.565808f),

};



    public void MakeFeaturedRoutes()
    {
        //Remove todas as linhas que tinha antes para criar a nova route
        OnlineMaps.instance.RemoveAllDrawingElements();

        if (OnlineMapsLocationService.instance.IsLocationServiceRunning())
        {
            placeLatitude1 = OnlineMapsLocationService.instance.position.y;
            placeLongitude1 = OnlineMapsLocationService.instance.position.x;
            Debug.Log(&quot;[MakeFeaturedRoute.cs] Latitude: &quot; + placeLatitude1 + &quot; e Longitude: &quot; + placeLongitude1);



            OnlineMapsGoogleDirections query = OnlineMapsGoogleDirections.Find(new OnlineMapsGoogleDirections.Params(new Vector2(placeLongitude1, placeLatitude1), new Vector2(placeLongitude2GO, placeLatitude2GO))
            {
                //mode = OnlineMapsGoogleDirections.Mode.walking, //Mode de ir a pé

                waypoints = waypoints
            });

            // Specifies that search results must be sent to OnFindDirectionComplete.
            query.OnComplete += OnFindDirectionComplete;

        }
       
    }


    private void OnFindDirectionComplete(string response)
    {
        // Get the resut object.
        OnlineMapsGoogleDirectionsResult result = OnlineMapsGoogleDirections.GetResult(response);

        // Check that the result is not null, and the number of routes is not zero.
        if (result == null || result.routes.Length == 0)
        {
            Debug.Log(&quot;Find direction failed&quot;);
            Debug.Log(response);
            return;
        }

        // Showing the console instructions for each step.
        foreach (OnlineMapsGoogleDirectionsResult.Leg leg in result.routes[0].legs)
        {
            foreach (OnlineMapsGoogleDirectionsResult.Step step in leg.steps)
            {
                Debug.Log(step.string_instructions);
            }
        }

        // Create a line, on the basis of points of the route.
        OnlineMapsDrawingLine route = new OnlineMapsDrawingLine(result.routes[0].overview_polyline, Color.green);

        // Draw the line route on the map.
        OnlineMaps.instance.AddDrawingElement(route);

    }</code></pre></div><p>debugs &quot;Find Direction failed&quot;<br />and the xml:<br /></p><div class="codebox"><pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;DirectionsResponse&gt;
&lt;status&gt;ZERO_RESULTS&lt;/status&gt;
&lt;/DirectionsResponse&gt;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (geral)]]></author>
			<pubDate>Sat, 03 Feb 2018 09:51:12 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3316#p3316</guid>
		</item>
		<item>
			<title><![CDATA[Re: How can I use OnlineMapsFindDirection -> waypoint]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1591#p1591</link>
			<description><![CDATA[<p>Hello.</p><p>Waypoints can be an array or a list, where the values is string or Vector2.</p><p>Example:<br /></p><div class="codebox"><pre><code>string[] waypoints = {&quot;Waypoint 1&quot;, &quot;Waypoint 2&quot;, &quot;Waypoint 3&quot;};
List&lt;Vector2&gt; waypoints2 = new List&lt;Vector2&gt;
{
    new Vector2(lng1, lat1),
    new Vector2(lng2, lat2),
    new Vector2(lng3, lat3),
}; 

OnlineMapsGoogleDirections query = OnlineMapsGoogleDirections.Find(new OnlineMapsGoogleDirections.Params(origin, destination)
{
    waypoints = waypoints
});</code></pre></div><p>An example of how to draw a route:<br /><a href="http://infinity-code.com/atlas/online-maps/pages/FindDirectionExample.html">http://infinity-code.com/atlas/online-m … ample.html</a></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 02 Jan 2017 10:50:46 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1591#p1591</guid>
		</item>
		<item>
			<title><![CDATA[How can I use OnlineMapsFindDirection -> waypoint]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1589#p1589</link>
			<description><![CDATA[<p>Hi,<br />I recently I want to draw the line with route, in addition, I want to set the waypoint (via root).<br />But I don&#039;t know how to use it<br />can you help me?</p>]]></description>
			<author><![CDATA[null@example.com (joonyboy)]]></author>
			<pubDate>Mon, 02 Jan 2017 09:26:48 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1589#p1589</guid>
		</item>
	</channel>
</rss>
