<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Getting Marker Positions as a Vector3]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=2139&amp;type=atom" />
	<updated>2023-07-11T12:09:54Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=2139</id>
		<entry>
			<title type="html"><![CDATA[Re: Getting Marker Positions as a Vector3]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9108#p9108" />
			<content type="html"><![CDATA[<p>Ah. Yes I called update and things worked as expected. I think I am a couple of versions out and I do not have the GetWorldPositionWithElevation(double lng, double lat, float altitude)..but I am always afraid to upgrade packages of things when things are mostly working ( hence going with the MARKER.update();</p><p>thanks for the help. Greatly appreciated!! I should have known that an update/refresh would do the trick!</p>]]></content>
			<author>
				<name><![CDATA[d.arrenmacisaac]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2631</uri>
			</author>
			<updated>2023-07-11T12:09:54Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9108#p9108</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Getting Marker Positions as a Vector3]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9107#p9107" />
			<content type="html"><![CDATA[<p>Hi.</p><p>Marker positions are not updated immediately, but when the map is redrawn.<br />You need to call marker.Update to force a marker to update the position or use OnlineMapsControlBaseDynamicMesh.GetWorldPositionWithElevation(double lng, double lat, float altitude) to get the position in the scene, without creating markers.<br /><a href="https://infinity-code.com/doxygen/online-maps/classOnlineMapsControlBaseDynamicMesh.html#a69268480a0594cae8de049341347139b">https://infinity-code.com/doxygen/onlin … 341347139b</a></p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2023-07-11T11:27:01Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9107#p9107</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Getting Marker Positions as a Vector3]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9106#p9106" />
			<content type="html"><![CDATA[<p>..also worth noting I did look at the &quot;getPosition&quot; possibilities but I was only seeing vector2 return values and nothing. I also created ( from :</p><p> public Vector3 GetWorldPositionOfMarkerWithElevation(double lng, double lat, double heightVal)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; double mx, my;<br />&nbsp; &nbsp; &nbsp; &nbsp; GetPosition(lng, lat, out mx, out my);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; mx = -mx / map.width * sizeInScene.x;<br />&nbsp; &nbsp; &nbsp; &nbsp; my = my / map.height * sizeInScene.y;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; float y = (float)heightVal;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; Vector3 offset = transform.rotation * new Vector3((float)mx, y, (float)my);<br />&nbsp; &nbsp; &nbsp; &nbsp; offset.Scale(map.transform.lossyScale);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; return map.transform.position + offset;<br />&nbsp; &nbsp; }</p><p>...and while this is not accurate it does render lines which are too deep ( I am sure my scaling needs work!!) . This work was based off of&nbsp; public Vector3 GetWorldPositionWithElevation(double lng, double lat, double tlx, double tly, double brx, double bry).</p>]]></content>
			<author>
				<name><![CDATA[d.arrenmacisaac]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2631</uri>
			</author>
			<updated>2023-07-10T19:54:48Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9106#p9106</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Getting Marker Positions as a Vector3]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9105#p9105" />
			<content type="html"><![CDATA[<p>Hello,</p><p>I have been using OnlineMaps for some dev work and I am hoping someone can assist me with getting the location of a OnlineMapsMarker3D marker ( I have added many markers to the map with altitude). I create many markers on the map with altitude and I want to get the markers world position and not where it is living on the map. I want to connect these markers with a lineRenderer ( not draw on the map ) and I know how to do it fine outside of OnlineMaps..but the issue is that as soon as I add the marker to the map and start to query for its position I cannot get the actual position. I have looked at MARKER.instance.transform.position and MARKER.transform.position but things do not appear to pass back the actual transform of the OnlineMapsMarker3D. </p><p>Inside of a loop I am doing:</p><p> OnlineMapsMarker3D fishLoc = OnlineMapsMarker3DManager.CreateItem(nLng, nLat, bearingGameObject);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fishLoc.altitudeType = OnlineMapsAltitudeType.absolute;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fishLoc.altitude = showBelowWater ? val.z : -val.z;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fishLoc.sizeType = OnlineMapsMarker3D.SizeType.meters;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fishLoc.scale = 100f;</p><p>..then I am trying to get the world position of the marker I just added ( something like): </p><p>vector3 actualWorldLoc = fishLoc.transform.position; // or fishLoc.instance.transform.position</p><p>..the issue I am having is that it is not giving me back the actual position of the markers as is noted in the inspector when I look at the marker on the &#039;marker&#039; section of the map. The inspector values all seem accurate but I cannot get the same values via code when I am creating the items on the map. </p><p>Hopefully that all makes sense. ANy help appreciated!</p>]]></content>
			<author>
				<name><![CDATA[d.arrenmacisaac]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2631</uri>
			</author>
			<updated>2023-07-10T19:51:04Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9105#p9105</id>
		</entry>
</feed>
