<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1398&amp;type=atom" />
	<updated>2019-12-04T12:34:27Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1398</id>
		<entry>
			<title type="html"><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5825#p5825" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[chema]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1158</uri>
			</author>
			<updated>2019-12-04T12:34:27Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5825#p5825</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5824#p5824" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-12-04T12:29:24Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5824#p5824</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5823#p5823" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[chema]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1158</uri>
			</author>
			<updated>2019-12-04T12:20:41Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5823#p5823</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5822#p5822" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-12-04T12:09:21Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5822#p5822</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5821#p5821" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[chema]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1158</uri>
			</author>
			<updated>2019-12-04T11:59:36Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5821#p5821</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5819#p5819" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-12-04T11:33:41Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5819#p5819</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5818#p5818" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[chema]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1158</uri>
			</author>
			<updated>2019-12-04T10:42:16Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5818#p5818</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5817#p5817" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-12-04T09:20:51Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5817#p5817</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5816#p5816" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[chema]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1158</uri>
			</author>
			<updated>2019-12-04T07:30:06Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5816#p5816</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5813#p5813" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-12-03T19:35:43Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5813#p5813</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5812#p5812" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[chema]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1158</uri>
			</author>
			<updated>2019-12-03T13:52:03Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5812#p5812</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5811#p5811" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-12-03T08:34:45Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5811#p5811</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5806#p5806" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[chema]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1158</uri>
			</author>
			<updated>2019-12-02T08:26:22Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5806#p5806</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5756#p5756" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2019-11-13T14:02:20Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5756#p5756</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Change Custom Provider URL at runtime and Slow loading of map tiles]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=5755#p5755" />
			<content type="html"><![CDATA[<p>Thanks! Now it works like a charm, I can change the style without problems! Although the other problem persists.</p>]]></content>
			<author>
				<name><![CDATA[chema]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1158</uri>
			</author>
			<updated>2019-11-13T13:44:31Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=5755#p5755</id>
		</entry>
</feed>
