<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — online maps unity3d zoom problems]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=616&amp;type=atom" />
	<updated>2017-08-02T17:56:57Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=616</id>
		<entry>
			<title type="html"><![CDATA[Re: online maps unity3d zoom problems]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2677#p2677" />
			<content type="html"><![CDATA[<p>Oops. Forgot to attach the script.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-08-02T17:56:57Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2677#p2677</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: online maps unity3d zoom problems]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2672#p2672" />
			<content type="html"><![CDATA[<p>Hello.</p><p>As braden and zuicis answered you above, you can use 3D markers.</p><p>For me, the original problem is more interesting.<br />Based on your code, I made a test script (attached).<br />Video:<br /><a href="https://www.dropbox.com/s/jn9wbun3uj126ow/2017-08-02%20-%200001.mp4?dl=0">https://www.dropbox.com/s/jn9wbun3uj126 … 1.mp4?dl=0</a><br />In my opinion, this looks normal and expected.<br />If possible, make a small video that demonstrates the problem.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-08-02T11:27:23Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2672#p2672</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: online maps unity3d zoom problems]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2671#p2671" />
			<content type="html"><![CDATA[<p>Yes. <br />Fragment from my project:<br />New marker:<br />Vector2 markerPosition = new Vector2(jsonData.items&nbsp; .location.lng, jsonData.items&nbsp; .location.lat);<br />marker = control.AddMarker3D(markerPosition, markerObjectPrefab);<br />marker.range = new OnlineMapsRange(minZoom, maxZoom);<br />marker.tags = tagInfo;<br />marker.OnClick += OnMarkerClick;<br />marker.scale = MarkerScale;<br />marker.OnPress += OnMarkerPress;<br />marker.customData = customMarkerData;<br />marker.OnRelease += OnMarkerRelease;<br />marker.OnRollOut += OnRollOut;<br />if (jsonData.items&nbsp; .self == true){<br />&nbsp; &nbsp; marker.OnLongPress += OnMarkerLongPress;&nbsp; &nbsp; &nbsp;<br />}<br />MarkerRotation:<br />if (OnlineMaps.instance.zoom &lt;=13){<br />&nbsp; &nbsp; marker.rotation = Quaternion.Euler(-90,0f,0f);<br />}else{<br />&nbsp; &nbsp; marker.rotation = Quaternion.Euler(MarkerAngle,0f,0f);<br />}</p><p>marker movement:<br />marker.SetPosition(lng,lat);</p><p>All info you can find at:<br /><a href="http://infinity-code.com/doxygen/online-maps/classOnlineMapsMarkerBase.html#a46aeb89ee864cd19b098ebac75c05eb0">http://infinity-code.com/doxygen/online … ac75c05eb0</a></p>]]></content>
			<author>
				<name><![CDATA[zuicis]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=67</uri>
			</author>
			<updated>2017-08-02T10:47:32Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2671#p2671</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: online maps unity3d zoom problems]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2669#p2669" />
			<content type="html"><![CDATA[<div class="quotebox"><cite>braden wrote:</cite><blockquote><p>this is a marker ? probably because you are explicitly setting the position of the transform directly in Update.</p><p>instead use marker.SetPosition(lng,lat), then let OnlineMaps position the marker/transform etc automatically for you.</p></blockquote></div><p>I am not using markers.. i am using prefabs (of cars for example) and the cars are constantly moving, depending on information from the server(pooling every 3 seconds).</p><p>can i set a 3d prefab as a marker and then update the location of it constantly?</p>]]></content>
			<author>
				<name><![CDATA[iddqd]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=515</uri>
			</author>
			<updated>2017-08-02T08:47:16Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2669#p2669</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: online maps unity3d zoom problems]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2668#p2668" />
			<content type="html"><![CDATA[<p>this is a marker ? probably because you are explicitly setting the position of the transform directly in Update.</p><p>instead use marker.SetPosition(lng,lat), then let OnlineMaps position the marker/transform etc automatically for you.</p>]]></content>
			<author>
				<name><![CDATA[braden]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=499</uri>
			</author>
			<updated>2017-08-02T08:37:39Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2668#p2668</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[online maps unity3d zoom problems]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2666#p2666" />
			<content type="html"><![CDATA[<p>Hi,<br />when using unity3d with online maps, i can add an entity to the map to a certain point, but when i zoom-out or zoom-in the location of the object is changed, and just moving to anouther palce on the map.<br />when returning to the initial zoom level, the object returns to place.</p><p>should i be doing anything special?</p><p>my code:</p><p>&nbsp; &nbsp; OnlineMaps api = OnlineMaps.instance;<br />&nbsp; &nbsp; public Vector3 HPosition()<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; float Lat = model.Lat;<br />&nbsp; &nbsp; &nbsp; &nbsp; float Lng = model.Lng;<br />&nbsp; &nbsp; &nbsp; &nbsp; float Rad = model.Radius ;<br />&nbsp; &nbsp; &nbsp; &nbsp; Vector3 position = OnlineMapsTileSetControl.instance.GetWorldPosition(Lng, Lat);<br />&nbsp; &nbsp; &nbsp; &nbsp; position.y = -0.70f;<br />&nbsp; &nbsp; &nbsp; &nbsp; return position;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; public Quaternion HRotation()<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; float heading = 90;<br />&nbsp; &nbsp; &nbsp; &nbsp; return Quaternion.Euler(0, heading, 0);<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; private void Update()<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; <br />&nbsp; &nbsp; &nbsp; &nbsp; this.transform.rotation = HRotation();<br />&nbsp; &nbsp; &nbsp; &nbsp; this.transform.position = HPosition();<br />&nbsp; &nbsp; &nbsp; &nbsp; float k =Mathf.Pow(2,9);<br />&nbsp; &nbsp; &nbsp; &nbsp; float scale = Mathf.Pow(2, api.zoom)/k;<br />&nbsp; &nbsp; &nbsp; &nbsp; this.transform.localScale = scale * Vector3.one * model.Radius/15f;<br />&nbsp; &nbsp; }</p>]]></content>
			<author>
				<name><![CDATA[iddqd]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=515</uri>
			</author>
			<updated>2017-08-02T07:48:09Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2666#p2666</id>
		</entry>
</feed>
