<?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 — Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=1398</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1398&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Change Custom Provider URL at runtime and Slow loading of map tiles.]]></description>
		<lastBuildDate>Wed, 04 Dec 2019 12:34:27 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5825#p5825</link>
			<description><![CDATA[<p>THANK YOU SO MUCH!<br />You are awesome, man <img src="https://forum.infinity-code.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></description>
			<author><![CDATA[null@example.com (chema)]]></author>
			<pubDate>Wed, 04 Dec 2019 12:34:27 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5825#p5825</guid>
		</item>
		<item>
			<title><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5824#p5824</link>
			<description><![CDATA[<p>I modified your shader a bit to make it work:<br /></p><div class="codebox"><pre><code>Shader &quot;Unlit/MapShader&quot;
{
    Properties
    {
        // we have removed support for texture tiling/offset,
        // so make them not be displayed in material inspector
        [NoScaleOffset] _MainTex(&quot;Texture&quot;, 2D) = &quot;white&quot; {}
    }
    SubShader
    {
        Pass
        {
            CGPROGRAM
            // use &quot;vert&quot; function as the vertex shader
            #pragma vertex vert
            // use &quot;frag&quot; function as the pixel (fragment) shader
            #pragma fragment frag

            #include &quot;UnityCG.cginc&quot;

            // vertex shader inputs
            struct appdata
            {
                float4 vertex : POSITION; // vertex position
                float2 uv : TEXCOORD0; // texture coordinate
            };

            // vertex shader outputs (&quot;vertex to fragment&quot;)
            struct v2f
            {
                float2 uv : TEXCOORD0; // texture coordinate
                float4 vertex : SV_POSITION; // clip space position
            };

            sampler2D _MainTex;
            float4 _MainTex_ST;

            // vertex shader
            v2f vert(appdata v)
            {
                v2f o;
                // transform position to clip space
                // (multiply with model*view*projection matrix)
                o.vertex = UnityObjectToClipPos(v.vertex);
                // just pass the texture coordinate
                //o.uv = v.uv;
                o.uv = TRANSFORM_TEX(v.uv, _MainTex);
                return o;
            }

            // texture we will sample
            //sampler2D _MainTex;

            // pixel shader; returns low precision (&quot;fixed4&quot; type)
            // color (&quot;SV_Target&quot; semantic)
            fixed4 frag(v2f i) : SV_Target
            {
                // sample texture and return it
                fixed4 col = tex2D(_MainTex, i.uv);
                return col;
            }
            ENDCG
        }
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 04 Dec 2019 12:29:24 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5824#p5824</guid>
		</item>
		<item>
			<title><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5823#p5823</link>
			<description><![CDATA[<p>The shader I used before was Unlit Transparent (Unity built-in). That shader made the map look good (not dark) but I could not modify it to see the projectors (IgnoreProjector=False). Then I changed it to the shader I just sent you, which solved the projector problem and also the map looked good (not dark). However the tile problem appeared.</p>]]></description>
			<author><![CDATA[null@example.com (chema)]]></author>
			<pubDate>Wed, 04 Dec 2019 12:20:41 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5823#p5823</guid>
		</item>
		<item>
			<title><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5822#p5822</link>
			<description><![CDATA[<p>Yes, the problem is this shader.<br />Tileset Control uses tiling and offset to correctly display the tiles of previous zoom levels until the tiles of the current zoom level are loaded.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 04 Dec 2019 12:09:21 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5822#p5822</guid>
		</item>
		<item>
			<title><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5821#p5821</link>
			<description><![CDATA[<p>Test this shader to reproduce the problem:</p><p>Shader &quot;Unlit/MapShader&quot;<br />{<br />&nbsp; &nbsp; Properties<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; // we have removed support for texture tiling/offset,<br />&nbsp; &nbsp; &nbsp; &nbsp; // so make them not be displayed in material inspector<br />&nbsp; &nbsp; &nbsp; &nbsp; [NoScaleOffset] _MainTex (&quot;Texture&quot;, 2D) = &quot;white&quot; {}<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; SubShader<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; Pass<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; CGPROGRAM<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // use &quot;vert&quot; function as the vertex shader<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #pragma vertex vert<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // use &quot;frag&quot; function as the pixel (fragment) shader<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #pragma fragment frag</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // vertex shader inputs<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; struct appdata<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; float4 vertex : POSITION; // vertex position<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; float2 uv : TEXCOORD0; // texture coordinate<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // vertex shader outputs (&quot;vertex to fragment&quot;)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; struct v2f<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; float2 uv : TEXCOORD0; // texture coordinate<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; float4 vertex : SV_POSITION; // clip space position<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; };</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // vertex shader<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v2f vert (appdata v)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; v2f o;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // transform position to clip space<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // (multiply with model*view*projection matrix)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o.vertex = UnityObjectToClipPos(v.vertex);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // just pass the texture coordinate<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o.uv = v.uv;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return o;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // texture we will sample<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sampler2D _MainTex;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // pixel shader; returns low precision (&quot;fixed4&quot; type)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // color (&quot;SV_Target&quot; semantic)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fixed4 frag (v2f i) : SV_Target<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // sample texture and return it<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fixed4 col = tex2D(_MainTex, i.uv);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return col;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ENDCG<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />}</p>]]></description>
			<author><![CDATA[null@example.com (chema)]]></author>
			<pubDate>Wed, 04 Dec 2019 11:59:36 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5821#p5821</guid>
		</item>
		<item>
			<title><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5819#p5819</link>
			<description><![CDATA[<p>I tested with the Tileset shader, and also could not reproduce the problem.<br />Most likely the problem is in something else.</p><p>To prevent the map from being too dark, adjust the light in the scene.<br />Or remove all the lights in the scene and set up Ambient Color (Window / Rendering / Lighting Settings / Environment Lighting / Source - Color, Ambient Color - White).</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 04 Dec 2019 11:33:41 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5819#p5819</guid>
		</item>
		<item>
			<title><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5818#p5818</link>
			<description><![CDATA[<p>Thank you so much. The problem was the tile set shader, with the default shader works!</p><p>Although now the map is darker, I will see what I can do.</p>]]></description>
			<author><![CDATA[null@example.com (chema)]]></author>
			<pubDate>Wed, 04 Dec 2019 10:42:16 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5818#p5818</guid>
		</item>
		<item>
			<title><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5817#p5817</link>
			<description><![CDATA[<p>I use the latest version of the asset (3.6.3) with default settings.<br />Here&#039;s a video:<br /><a href="https://www.dropbox.com/s/jmfge80qpgbgt9l/ScreenRecorderProject31.mp4?dl=0">https://www.dropbox.com/s/jmfge80qpgbgt … 1.mp4?dl=0</a></p><p>P.S. Create Browser is another feature of our asset.<br />You can open Map Wizard using Hierarchy / Create.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 04 Dec 2019 09:20:51 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5817#p5817</guid>
		</item>
		<item>
			<title><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5816#p5816</link>
			<description><![CDATA[<p>Your apk works perfectly! Can I see your source code?<br />Which version of Online Maps are you using? I will try to do the same in my project and see if it works properly.</p>]]></description>
			<author><![CDATA[null@example.com (chema)]]></author>
			<pubDate>Wed, 04 Dec 2019 07:30:06 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5816#p5816</guid>
		</item>
		<item>
			<title><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5813#p5813</link>
			<description><![CDATA[<p>I tested your url on PC (hi-end) and Android (low-end).<br />I have similar download times for tiles.<br />But I do not have what problem as I see in your GIF.<br /><span class="postimg"><img src="https://i.ibb.co/tMY8Th8/img1.png" alt="https://i.ibb.co/tMY8Th8/img1.png" /></span><br />In the image, I marked with arrows the places where the border between the tiles is visible.<br />Most likely, this is because these are wrong tiles.<br />But the main question is, why are the wrong tiles here?!<br />I scrolled and zoomed the map a lot, but did not see anything like it.</p><p>I tested all map modes without using a cache.<br />My apk is attached.<br />In this apk do you have a problem like in GIF?</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 03 Dec 2019 19:35:43 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5813#p5813</guid>
		</item>
		<item>
			<title><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5812#p5812</link>
			<description><![CDATA[<p>My url is:</p><p><a href="https://maps.googleapis.com/maps/vt?pb=!1m5!1m4!1i{zoom}!2i{x}!3i{y}!4i256!2m3!1e0!2sm!3i491201350!3m17!2ses-ES!3sUS!5e18!12m4!1e68!2m2!1sset!2sRoadmap!12m3!1e37!2m1!1ssmartmaps!12m4!1e26!2m2!1sstyles!2zcy5lOmx8cC52Om9mZixzLnQ6MjF8cC52Om9mZixzLnQ6MjB8cC52Om9mZixzLnQ6NXxzLmU6Zy5mfHAuYzojZmZlNGRkZWIscy50OjgxfHMuZTpnLnN8cC5jOiNmZmM5YjRlMSxzLnQ6MnxzLmU6Zy5mfHAuYzojZmZmZmM1OWUscy50OjJ8cy5lOmwudHxwLnY6b2ZmLHMudDo0MHxzLmU6Zy5mfHAuYzojZmZhNmExMDAscy50OjN8cy5lOmcuZnxwLmM6I2ZmZWZlZmVmLHMudDozfHMuZTpsfHAudjpvZmYscy50OjZ8cy5lOmcuZnxwLmM6I2ZmMDA3Mzc0LHMudDo2fHMuZTpsLnR8cC52Om9mZg!4e0">https://maps.googleapis.com/maps/vt?pb= … Om9mZg!4e0</a></p><p>For the response time I have written two lines within the StartDownloadTileAsync method (OnlineMapsTileManager.cs):</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if (loadOnline)<br />&nbsp; &nbsp; &nbsp; &nbsp; {</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; float startTime = Time.realtimeSinceStartup;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [...]</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Debug.Log((Time.realtimeSinceStartup - startTime) * 1000);<br />&nbsp; &nbsp; &nbsp; &nbsp; }</p><p>I do not know it is the server response time, but on PC the values are between 0.09 and 0.12 and on mobile the values are between 0.3 and 0.8 (or more).</p>]]></description>
			<author><![CDATA[null@example.com (chema)]]></author>
			<pubDate>Tue, 03 Dec 2019 13:52:03 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5812#p5812</guid>
		</item>
		<item>
			<title><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5811#p5811</link>
			<description><![CDATA[<p>I looked at your GIF again, and your tiles do not match for different zoom levels.<br />Please send your url, I will check why this happens.</p><p>P.S. What is your server response time when downloading tiles to PC and mobile?</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 03 Dec 2019 08:34:45 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5811#p5811</guid>
		</item>
		<item>
			<title><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5806#p5806</link>
			<description><![CDATA[<p>Hello,</p><p>1. This worked for me on PC, but it does not on mobile.<br />3. Can you give me a tip for this? How can I do it?</p><p>Greetings!</p>]]></description>
			<author><![CDATA[null@example.com (chema)]]></author>
			<pubDate>Mon, 02 Dec 2019 08:26:22 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5806#p5806</guid>
		</item>
		<item>
			<title><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5756#p5756</link>
			<description><![CDATA[<p>1. Try to increase the maximum number of simultaneous downloads (OnlineMapsTileManager.maxTileDownloads).<br />2. Check the tile load time.<br />Perhaps the problem is that the server is too far (in another country) or has a long response time (for example, this is your own WMS).<br />3. Try preloading tiles for a larger area to minimize this effect.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 13 Nov 2019 14:02:20 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5756#p5756</guid>
		</item>
		<item>
			<title><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=5755#p5755</link>
			<description><![CDATA[<p>Thanks! Now it works like a charm, I can change the style without problems! Although the other problem persists.</p>]]></description>
			<author><![CDATA[null@example.com (chema)]]></author>
			<pubDate>Wed, 13 Nov 2019 13:44:31 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=5755#p5755</guid>
		</item>
	</channel>
</rss>
