<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Zoom up the map and keep the image existing]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1379&amp;type=atom" />
	<updated>2019-11-12T09:04:58Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1379</id>
		<entry>
			<title type="html"><![CDATA[Re: Zoom up the map and keep the image existing]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5746#p5746" />
			<content type="html"><![CDATA[<p>Most likely the problem is that before &quot;yield return&quot; you did not mark that the tile is loading (tile.status = OnlineMapsTileStatus.loading), which gives you a huge memory leak and can cause any unexpected problems.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-11-12T09:04:58Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5746#p5746</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Zoom up the map and keep the image existing]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5744#p5744" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>XiaWuchu wrote:</cite><blockquote><div class="quotebox"><cite>Alex Vertax wrote:</cite><blockquote><p>This script only protects tiles from unloading, but does not load new tiles.</p><p>You have two ways:<br />1. Easy way - simple update to Online Maps v3.6.<br />2. Use OnlineMapsTileManager.StartDownloadTile to load the missing tiles in the example above. But you will need to implement this yourself.</p></blockquote></div><p>OK, Thank you!</p></blockquote></div><br /><p>Hello!<br />Finally, I decide to update. As you said, I found if I used Resources to load with the count parent level 20 the image would not disappear. However, I&#039;d like to use StreamAssets to load tiles.</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; WWW www = new WWW(&quot;file://&quot; + Application.streamingAssetsPath + &quot;/&quot; + tile.resourcesPath + &quot;.jpg&quot;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; yield return www;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Object tileTexture = <a href="http://www.texture">www.texture</a>;</p><p>In this case, the image would disappear when I continued to zoom up. <br />Is there a way to solve it?<br />THX!</p>]]></content>
			<author>
				<name><![CDATA[XiaWuchu]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1032</uri>
			</author>
			<updated>2019-11-11T13:52:00Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5744#p5744</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Zoom up the map and keep the image existing]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5693#p5693" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Alex Vertax wrote:</cite><blockquote><p>This script only protects tiles from unloading, but does not load new tiles.</p><p>You have two ways:<br />1. Easy way - simple update to Online Maps v3.6.<br />2. Use OnlineMapsTileManager.StartDownloadTile to load the missing tiles in the example above. But you will need to implement this yourself.</p></blockquote></div><p>OK, Thank you!</p>]]></content>
			<author>
				<name><![CDATA[XiaWuchu]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1032</uri>
			</author>
			<updated>2019-10-14T02:10:09Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5693#p5693</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Zoom up the map and keep the image existing]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5691#p5691" />
			<content type="html"><![CDATA[<p>This script only protects tiles from unloading, but does not load new tiles.</p><p>You have two ways:<br />1. Easy way - simple update to Online Maps v3.6.<br />2. Use OnlineMapsTileManager.StartDownloadTile to load the missing tiles in the example above. But you will need to implement this yourself.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-10-13T12:35:02Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5691#p5691</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Zoom up the map and keep the image existing]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5690#p5690" />
			<content type="html"><![CDATA[<p>Thank you! It did work! <br />But it worked only for those tiles in the Game window at that moment. When I dragged the map, other tiles were still blank. <br />Is there a way to make whole tiles&#039; image always exist even if there is no corresponding image when I drag or zoom the map?</p>]]></content>
			<author>
				<name><![CDATA[XiaWuchu]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1032</uri>
			</author>
			<updated>2019-10-13T08:36:20Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5690#p5690</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Zoom up the map and keep the image existing]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5689#p5689" />
			<content type="html"><![CDATA[<p>Something like:<br /></p><div class="codebox"><pre><code>using System.Collections.Generic;
using UnityEngine;

public class BlockTiles : MonoBehaviour
{
    public List&lt;OnlineMapsTile&gt; tiles;
    private OnlineMaps map;
    private object blocker;

    private void Start()
    {
        tiles = new List&lt;OnlineMapsTile&gt;();
        map = OnlineMaps.instance;
        map.OnUpdateLate += OnUpdateLate;
        blocker = new object();
    }

    private void OnUpdateLate()
    {
        double tlx, tly, brx, bry;
        map.GetTileCorners(out tlx, out tly, out brx, out bry);
        int max = 1 &lt;&lt; map.zoom;
        if (tlx &gt; brx) brx += max;

        int itlx = (int) tlx;
        int itly = (int) tly;
        int ibrx = (int) brx;
        int ibry = (int) bry;

        foreach (OnlineMapsTile tile in tiles) tile.Unblock(blocker);

        tiles.Clear();

        for (int z = map.zoom; z &gt;= OnlineMaps.MINZOOM; z--)
        {
            for (int x = itlx; x &lt;= ibrx; x++)
            {
                int cx = x;
                if (x &gt; max) x -= max;

                for (int y = itly; y &lt;= ibry; y++)
                {
                    OnlineMapsTile tile = OnlineMapsTile.GetTile(z, cx, y);
                    if (tile != null)
                    {
                        tile.Block(blocker);
                        tiles.Add(tile);
                    }
                }
            }

            max /= 2;
            itlx /= 2;
            itly /= 2;
            ibrx /= 2;
            ibry /= 2;
        }
    }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-10-12T11:49:32Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5689#p5689</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Zoom up the map and keep the image existing]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5688#p5688" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>Alex Vertax wrote:</cite><blockquote><p>No, it&#039;s easy enough.</p></blockquote></div><p>I checked the API, but had no idea how to do it yet. Could you give me more tips? Thanks a lot.</p>]]></content>
			<author>
				<name><![CDATA[XiaWuchu]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1032</uri>
			</author>
			<updated>2019-10-11T11:28:25Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5688#p5688</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Zoom up the map and keep the image existing]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5687#p5687" />
			<content type="html"><![CDATA[<p>No, it&#039;s easy enough.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-10-11T10:50:01Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5687#p5687</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Zoom up the map and keep the image existing]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5686#p5686" />
			<content type="html"><![CDATA[<p>I am using Online Maps v3.5. Is it troublesome to achieve what I said by using API?</p>]]></content>
			<author>
				<name><![CDATA[XiaWuchu]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1032</uri>
			</author>
			<updated>2019-10-11T10:47:17Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5686#p5686</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Zoom up the map and keep the image existing]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5685#p5685" />
			<content type="html"><![CDATA[<p>Hello.</p><p>In Online Maps v3.6:<br />Online Maps / Advanced / Count Parent Levels - 20.</p><p>In Online Maps v3.5 or earlier, this can only be done using API.<br />Points of interest:<br />OnlineMapsTileManager.OnTileLoaded<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsTileManager.html#a799d15b4822cd5c746bb33f7070aa394">http://infinity-code.com/doxygen/online … f7070aa394</a><br />OnlineMapsTile.Block<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsTile.html#af017b50f1581047a1a38e7ba46a509b4">http://infinity-code.com/doxygen/online … ba46a509b4</a></p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-10-11T09:57:52Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5685#p5685</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Zoom up the map and keep the image existing]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5684#p5684" />
			<content type="html"><![CDATA[<p>Hello,<br />I used the Online Maps offline. I found that I could zoom up the map even if there was not corresponding zoom level in the Resouces folder. Certainly, the map tile was not new image but the old which became fuzzy. <br />However, when I continued to zoom up the map to some degree, the image of the map tile disappeared. <br />Is there a way to keep the image always existing?</p>]]></content>
			<author>
				<name><![CDATA[XiaWuchu]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1032</uri>
			</author>
			<updated>2019-10-11T09:16:23Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5684#p5684</id>
		</entry>
</feed>
