<?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 — Smooth-er zoom]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=176</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=176&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Smooth-er zoom.]]></description>
		<lastBuildDate>Fri, 13 Apr 2018 10:46:00 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Smooth-er zoom]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3550#p3550</link>
			<description><![CDATA[<p>Hello.</p><p>I will try to open the public access to the current version of Online Maps v3 on Monday.<br />It has a built-in true float zoom for all controls.<br />Follow the announcements in this section:<br /><a href="http://forum.infinity-code.com/viewforum.php?id=29">http://forum.infinity-code.com/viewforum.php?id=29</a></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 13 Apr 2018 10:46:00 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3550#p3550</guid>
		</item>
		<item>
			<title><![CDATA[Re: Smooth-er zoom]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3549#p3549</link>
			<description><![CDATA[<p>Hi there,</p><p>Just wondering if there was any update on the float zoom feature that was mentioned before.</p><p>I&#039;m working on a feature that allows a user to click on one of several markers on interest then, ideally, the view should smoothly zoom in until the area around the marker is at closest zoom.&nbsp; Then have the option to reset which will smoothly zoom back out until all the markers are visable.</p><p>I managed to get it basically working by only doing any actions on the discrete change over point of the zoom.&nbsp; Here are the relevant functions:<br /></p><div class="codebox"><pre><code>public void MoveToPosition (Vector2 posIn, int targetZoomIn) {
        fromPosition = OnlineMaps.instance.position;
        startZoom = OnlineMaps.instance.zoom;
        zoomIn = targetZoomIn &gt; startZoom;
        time = timePerZoom * Mathf.Abs (targetZoomIn - startZoom);
        targetZoom = targetZoomIn;
        toPosition = posIn;
        angle = 0;
        isMovement = true;
    }

    void runMovement ()
    {
        angle += Time.deltaTime / time;

        if (angle &gt; 1) {
            isMovement = false;
            OnlineMaps.instance.zoom = targetZoom;
            OnlineMaps.instance.SetPosition (toPosition.x, toPosition.y);
            return;
        }

        int currentZoom = Mathf.RoundToInt (Mathf.Lerp (startZoom, targetZoom, angle));


        if (OnlineMaps.instance.zoom != currentZoom) {
            if (zoomIn) {
                OnlineMapsControlBase.instance.ZoomOnPoint (currentZoom - OnlineMaps.instance.zoom, 
                OnlineMapsControlBase.instance.GetScreenPosition (toPosition));
                Vector2 CenterScreen = OnlineMapsControlBase.instance.GetCoords (new Vector2 (Screen.width / 2, Screen.height / 2));
                Vector2 pos = Vector2.Lerp (CenterScreen, toPosition, angle);
                OnlineMaps.instance.SetPosition (pos.x, pos.y);
            } else {
                int zoomsLeft = currentZoom - targetZoom;
                OnlineMapsControlBase.instance.ZoomOnPoint (currentZoom - OnlineMaps.instance.zoom, 
                OnlineMapsControlBase.instance.GetScreenPosition (fromPosition));
                Vector2 pos = Vector2.Lerp (fromPosition, toPosition, Mathf.Pow(0.5f,zoomsLeft));
                OnlineMaps.instance.SetPosition (pos.x, pos.y);
            }
        }
    }

    public void ZoomToCenterOfMarkers ()
    {
        Vector2 center;
        int zoom;
        OnlineMapsUtils.GetCenterPointAndZoom (OnlineMaps.instance.markers, out center, out zoom);
        MoveToPosition (center, zoom + 1); // Unsure why but the view is better at plus one zoom
    }</code></pre></div><p>Do you have any advice on how to make this smoother?&nbsp; I tried to adapt the smooth zoom feature (which I realise is designed for touch input) but it didn&#039;t perform well over large zoom amounts (starting with whole world and zooming in to a point of interest like the start of google earth).</p><p>Thanks</p>]]></description>
			<author><![CDATA[null@example.com (Pidgie)]]></author>
			<pubDate>Thu, 12 Apr 2018 04:00:32 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3549#p3549</guid>
		</item>
		<item>
			<title><![CDATA[Re: Smooth-er zoom]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1467#p1467</link>
			<description><![CDATA[<p>Hello Alex,</p><p>it works! This allow us to go ahead supporting maps in our application.</p><p>However, I will wait for the full implementation! <img src="https://forum.infinity-code.com/img/smilies/wink.png" width="15" height="15" alt="wink" /></p><br /><p>Thanks for you support.</p><p>Regards</p><p>Enrico</p>]]></description>
			<author><![CDATA[null@example.com (guruhenry)]]></author>
			<pubDate>Sun, 27 Nov 2016 09:35:15 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1467#p1467</guid>
		</item>
		<item>
			<title><![CDATA[Re: Smooth-er zoom]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1465#p1465</link>
			<description><![CDATA[<p>Hello.</p><p>The new version is already available through the built-in update system (channel - beta).<br />Try to use it with Render in Thread - OFF.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 25 Nov 2016 17:50:27 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1465#p1465</guid>
		</item>
		<item>
			<title><![CDATA[Re: Smooth-er zoom]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1462#p1462</link>
			<description><![CDATA[<p>Hello Alex,</p><p>Ok, I will wait for the new beta!</p><p>Thanks</p><p>Enrico</p>]]></description>
			<author><![CDATA[null@example.com (guruhenry)]]></author>
			<pubDate>Thu, 24 Nov 2016 14:07:55 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1462#p1462</guid>
		</item>
		<item>
			<title><![CDATA[Re: Smooth-er zoom]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1461#p1461</link>
			<description><![CDATA[<p>As I said, the best solution is to make a true float zoom.<br />But it takes some time.</p><p>Within 1-2 days we will release the next beta version with fixed flash (for Render in Thread - OFF).<br />Try to use it with Render in Thread - OFF.<br />If it will suits your needs, it&#039;s good.<br />If not, then unfortunately you need to wait for true float zoom feature.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 23 Nov 2016 18:11:45 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1461#p1461</guid>
		</item>
		<item>
			<title><![CDATA[Re: Smooth-er zoom]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1460#p1460</link>
			<description><![CDATA[<p>Hello Alex,</p><p>the flash impacts the look and feel, and with this unresolved issue I can&#039;t add the map feature to the app I&#039;m developing with my team.</p><p>The quality of user interactions support and the UI/map view quality and response are key features for us to offer in apps that use maps.</p><p>Your plugin has really good features, but this is a serious problem and it is unexpected for us.</p><p>Feel free to ask us tests if you think it could help you to find a solution.</p>]]></description>
			<author><![CDATA[null@example.com (guruhenry)]]></author>
			<pubDate>Wed, 23 Nov 2016 15:45:22 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1460#p1460</guid>
		</item>
		<item>
			<title><![CDATA[Re: Smooth-er zoom]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1459#p1459</link>
			<description><![CDATA[<p>Hello.</p><p>We found the problem and fixed it for Render in Thread - OFF.<br />But in fact, it created a few new problems.<br />I think there is only one right solution - is make a really true float zoom, without playing with transform.<br />We will try to implement it, but I do not know how much time it will take.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 23 Nov 2016 14:17:14 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1459#p1459</guid>
		</item>
		<item>
			<title><![CDATA[Re: Smooth-er zoom]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1456#p1456</link>
			<description><![CDATA[<p>Hello,</p><p>I performed a new test with Unity editor, Tileset scene, using the game preview. Zooming in with the mouse wheel you can occasionally see the flash, and it occurs prior the real tiles update.</p><p>So it is really simple to reproduce and I believe it&#039;s the same problem.</p>]]></description>
			<author><![CDATA[null@example.com (guruhenry)]]></author>
			<pubDate>Tue, 22 Nov 2016 10:59:03 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1456#p1456</guid>
		</item>
		<item>
			<title><![CDATA[Re: Smooth-er zoom]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1455#p1455</link>
			<description><![CDATA[<p>Hello,</p><p>I updated my projects and I perfomed new tests with my app and with the test app compiled using Tileset scene with and <br />without your CustomTilesetControl code. </p><p>The result is the same with previous Online Maps stable version (2.4): the map flashes as I mentioned in my previous posts.</p><p>For this specific project I work with Unity 4.7.0f1 and the target platform is Android.</p>]]></description>
			<author><![CDATA[null@example.com (guruhenry)]]></author>
			<pubDate>Tue, 22 Nov 2016 10:42:45 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1455#p1455</guid>
		</item>
		<item>
			<title><![CDATA[Re: Smooth-er zoom]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1454#p1454</link>
			<description><![CDATA[<p>I just checked the changelog.<br />This problem is fixed in Online Maps v2.5.0.9.<br />Please update Online Maps to the latest beta version through the built-in update system.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 22 Nov 2016 08:59:36 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1454#p1454</guid>
		</item>
		<item>
			<title><![CDATA[Re: Smooth-er zoom]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1453#p1453</link>
			<description><![CDATA[<p>Hello,</p><p>Render In Thread option OFF does not solve the problem.</p>]]></description>
			<author><![CDATA[null@example.com (guruhenry)]]></author>
			<pubDate>Tue, 22 Nov 2016 08:42:37 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1453#p1453</guid>
		</item>
		<item>
			<title><![CDATA[Re: Smooth-er zoom]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1451#p1451</link>
			<description><![CDATA[<p>Hello.</p><p>Try to use:<br />Online Maps / Troubleshooting / Render In Thread - OFF.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 22 Nov 2016 05:25:00 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1451#p1451</guid>
		</item>
		<item>
			<title><![CDATA[Re: Smooth-er zoom]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1449#p1449</link>
			<description><![CDATA[<p>Hello,<br />I tried your code in the Tileset scene and it shows the same glitch I mentioned. </p><p>When the integer zoom factor changes, the map often flashes (not always).</p><p>Basically in my app I use the code of the method ZoomInPoint with the addition of mesh scaling and positioning in a way similar to your code, and the result is the same.</p><p>Now suppose we are zooming in. When we reach a scale = 2, we have to change the zoom factor with an offset = +1 and reset the mesh scale to 1.<br />What I saw is that the mesh scaling is performed at the end of the current update, at the end of the UpdateGestureZoom method, while the map update due to api.zoom changes, where a zoomed tiled is shown waiting for the new tiles set to be loaded, is performed in the next frame. So for an instant, we can see the mesh rescaled to 1 but with the tiles not zoomed nor updated, and this is the glitch/flash I mentioned.</p><p>What do you think about it?</p><p>Thanks</p>]]></description>
			<author><![CDATA[null@example.com (guruhenry)]]></author>
			<pubDate>Mon, 21 Nov 2016 19:13:08 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1449#p1449</guid>
		</item>
		<item>
			<title><![CDATA[Re: Smooth-er zoom]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1442#p1442</link>
			<description><![CDATA[<p>Hello.</p><p>Try this (attached).<br />This is the latest version of the custom tileset by Gamar.</p><p>P.S. In Online Maps v2.5 it will not work because we have renamed «api» to «map». <br />So for Online Maps v2.5 this script need a little bit fix.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 17 Nov 2016 21:18:11 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1442#p1442</guid>
		</item>
	</channel>
</rss>
