<?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 — OnlineMaps.SetPosition not working correctly.]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=439</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=439&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in OnlineMaps.SetPosition not working correctly..]]></description>
		<lastBuildDate>Thu, 02 Mar 2017 06:47:12 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: OnlineMaps.SetPosition not working correctly.]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1918#p1918</link>
			<description><![CDATA[<p>In this case, it makes sense.<br />Online Maps checks map boundary and corrects the latitude, if the top or bottom latitude is outside (90, -90).</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 02 Mar 2017 06:47:12 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1918#p1918</guid>
		</item>
		<item>
			<title><![CDATA[Re: OnlineMaps.SetPosition not working correctly.]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1915#p1915</link>
			<description><![CDATA[<p>The problem seems to be coming from line 1728 (or close to) in SetPosition: </p><p>if (modified) projection.TileToCoordinates(tpx, tpy, _zoom, out lng, out lat);</p><p>before this method, lat is set to the coordinate, afterwards it is set to zero.</p><p>EDIT:<br />Some more information, as what&#039;s inside that function suggests it&#039;s a math issue: The zoom is set to three (before I set the zoom). The pixel size of the map is 2048x2048. The scene size of the map is 1024x1024.</p><p>EDIT:<br />Setting the zoom before I set the position solves the issue. Seems to be caused by the latitude being clamped to 0 at that zoom level (3).</p>]]></description>
			<author><![CDATA[null@example.com (nug700)]]></author>
			<pubDate>Wed, 01 Mar 2017 21:23:15 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1915#p1915</guid>
		</item>
		<item>
			<title><![CDATA[Re: OnlineMaps.SetPosition not working correctly.]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1914#p1914</link>
			<description><![CDATA[<p>I created that LatLng (Location) struct, and the tostring method uses those fields: </p><p>return string.Format(&quot;(Lat: {0}, Lng: {1})&quot;, Latitude, Longitude);</p><p>So the field is being set.</p><p>I did try your idea: &quot;Loading at location: -112.4193 34.62115&quot;</p><p>I&#039;ve also put a Log call inside SetPosition: &quot;OnlineMaps.SetPosition: -112.42015838623 34.6255073547363&quot;<br />To show that the values are being passed correctly.</p>]]></description>
			<author><![CDATA[null@example.com (nug700)]]></author>
			<pubDate>Wed, 01 Mar 2017 21:11:14 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1914#p1914</guid>
		</item>
		<item>
			<title><![CDATA[Re: OnlineMaps.SetPosition not working correctly.]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1910#p1910</link>
			<description><![CDATA[<p>Hello.</p><p>I tested this method in «SceneManager.sceneLoaded», and it works well.<br />Actually, this method is used in many internal methods, and if it has problem, it be appears a long time ago.<br />I was very confused that the problem is only in the latitude.<br />Try it this way:<br />Debug.Log ( &quot;Loading at location: &quot; + Location.Longitude + &quot;&nbsp; &nbsp;&quot; + Location.Latitude);<br />Perhaps, somehow, this field is not set.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 01 Mar 2017 08:30:14 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1910#p1910</guid>
		</item>
		<item>
			<title><![CDATA[OnlineMaps.SetPosition not working correctly.]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=1909#p1909</link>
			<description><![CDATA[<p>For some reason, OnlineMaps.SetPosition is not setting the latitude to the new value provided, while the longitude is. </p><p>In this example: </p><p>&nbsp; &nbsp; &nbsp; &nbsp; Debug.Log(&quot;Loading at location: &quot; + Location);<br />&nbsp; &nbsp; &nbsp; &nbsp; OnlineMaps.instance.SetPosition(Location.Longitude, Location.Latitude);<br />&nbsp; &nbsp; &nbsp; &nbsp; OnlineMaps.instance.zoom = zoom;<br />&nbsp; &nbsp; &nbsp; &nbsp; Debug.Log(&quot;New location: &quot; + OnlineMaps.instance.position);</p><p>I get this in the log:<br />- Loading at location: (Lat: 34.62605, Lng: -112.418)<br />- New location: (-112.3, 0.0)</p><br /><br /><p>This is called from the SceneManager.sceneLoaded event.</p>]]></description>
			<author><![CDATA[null@example.com (nug700)]]></author>
			<pubDate>Wed, 01 Mar 2017 01:51:38 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=1909#p1909</guid>
		</item>
	</channel>
</rss>
