<?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 to know when map  has been loaded and drawn?]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=682</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=682&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in How to know when map  has been loaded and drawn?.]]></description>
		<lastBuildDate>Fri, 20 Oct 2017 12:14:47 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: How to know when map  has been loaded and drawn?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2940#p2940</link>
			<description><![CDATA[<p>Really thanks Alex!</p>]]></description>
			<author><![CDATA[null@example.com (ppizarro)]]></author>
			<pubDate>Fri, 20 Oct 2017 12:14:47 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2940#p2940</guid>
		</item>
		<item>
			<title><![CDATA[Re: How to know when map  has been loaded and drawn?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2938#p2938</link>
			<description><![CDATA[<p>Hello.</p><p>Something like:<br /></p><div class="codebox"><pre><code>using System.Collections;
using UnityEngine;

public class CheckFullLoadedExample:MonoBehaviour
{
    private bool isTilesLoaded;
    private bool isRouteFound;
    private IEnumerator timeoutRoutine;

    private void Start()
    {
        OnlineMapsTile.OnAllTilesLoaded += OnAllTilesLoaded;
        OnlineMapsGoogleDirections.Find(&quot;Los Angeles&quot;, &quot;San Francisco&quot;).OnComplete += OnGoogleDirectionsComplete;

        // Time out if something wrong.
        // Strongly recommended.
        timeoutRoutine = FailedTimeout();
        StartCoroutine(timeoutRoutine);
    }

    private IEnumerator FailedTimeout()
    {
        yield return new WaitForSeconds(10);

        Debug.Log(&quot;Failed&quot;);
    }

    private void OnGoogleDirectionsComplete(string response)
    {
        // Parse response
        // ...

        Debug.Log(&quot;Route found&quot;);
        isRouteFound = true;
        CheckFullLoaded();
    }

    private void OnAllTilesLoaded()
    {
        Debug.Log(&quot;All tiles loaded&quot;);
        OnlineMapsTile.OnAllTilesLoaded -= OnAllTilesLoaded;
        isTilesLoaded = true;
        CheckFullLoaded();
    }

    private void CheckFullLoaded()
    {
        if (isRouteFound &amp;&amp; isTilesLoaded)
        {
            StopCoroutine(timeoutRoutine);
            Debug.Log(&quot;Full loaded&quot;);
            OnlineMaps.instance.OnMapUpdated += OnMapUpdated;
            OnlineMaps.instance.Redraw();
        }
    }

    private void OnMapUpdated()
    {
        OnlineMaps.instance.OnMapUpdated -= OnMapUpdated;
        Debug.Log(&quot;The map is fully loaded and drawn.&quot;);
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 19 Oct 2017 22:58:55 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2938#p2938</guid>
		</item>
		<item>
			<title><![CDATA[How to know when map  has been loaded and drawn?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=2934#p2934</link>
			<description><![CDATA[<p>Hi Guys! <br />I wanted to know if there is a method or an event that tells me exactly when the map is loaded or completely drawn on the map,<br />the problem is that on my pc it takes 1 second for example, but on my cell phone it takes 3 seconds, what I need to do is<br />once fully loaded instantiate markers and do route calculations. I&#039;m using a google custom provider and the map is based on<br />textures. TY!</p>]]></description>
			<author><![CDATA[null@example.com (ppizarro)]]></author>
			<pubDate>Thu, 19 Oct 2017 14:21:55 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=2934#p2934</guid>
		</item>
	</channel>
</rss>
