<?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 — Placing a marker in the sky at a specified altitude / GPS]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=2031</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=2031&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Placing a marker in the sky at a specified altitude / GPS.]]></description>
		<lastBuildDate>Wed, 14 Sep 2022 23:36:36 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8580#p8580</link>
			<description><![CDATA[<p>Thank you. I really appreciate this.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 14 Sep 2022 23:36:36 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8580#p8580</guid>
		</item>
		<item>
			<title><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8579#p8579</link>
			<description><![CDATA[<p>Thank you for all your help on this.&nbsp; I have everything working now on this question.&nbsp; I&#039;m sure I&#039;ll have others later... but I am going to leave y&#039;all a stellar review for your support on the asset store.</p>]]></description>
			<author><![CDATA[null@example.com (Ty)]]></author>
			<pubDate>Wed, 14 Sep 2022 23:34:59 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8579#p8579</guid>
		</item>
		<item>
			<title><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8578#p8578</link>
			<description><![CDATA[<p>marker3D.customFields[&quot;name&quot;] and marker3D[&quot;name&quot;] are the same, but the second way is shorter.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 14 Sep 2022 23:31:23 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8578#p8578</guid>
		</item>
		<item>
			<title><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8577#p8577</link>
			<description><![CDATA[<p>Fantastic!&nbsp; I got that working, but I&#039;m wondering if I&#039;m using customFields correctly on the map instancing of the prefab script:&nbsp; </p><p>marker3D.customFields[&#039;name&#039;]=droneList[keyValue.Key][&quot;DroneName&quot;];</p>]]></description>
			<author><![CDATA[null@example.com (Ty)]]></author>
			<pubDate>Wed, 14 Sep 2022 23:26:28 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8577#p8577</guid>
		</item>
		<item>
			<title><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8576#p8576</link>
			<description><![CDATA[<div class="codebox"><pre><code>public class SomeScript : MonoBehaviour
{
    private void Start()
    {
        OnlineMapsMarkerBase marker = GetComponent&lt;OnlineMapsMarker3DInstance&gt;().marker;
        gameObject.name = marker[&quot;name&quot;] as string;

        // When you create a marker:
        // marker[&quot;name&quot;] = &quot;SOME NAME&quot;;
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 14 Sep 2022 23:06:06 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8576#p8576</guid>
		</item>
		<item>
			<title><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8575#p8575</link>
			<description><![CDATA[<p>Thank you!&nbsp; is there an example of using the OnlineMapsMarker3DInstance call inside the start of the marker instance?&nbsp; I looked at the documentation, and I am a bit lost.</p>]]></description>
			<author><![CDATA[null@example.com (Ty)]]></author>
			<pubDate>Wed, 14 Sep 2022 23:02:24 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8575#p8575</guid>
		</item>
		<item>
			<title><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8574#p8574</link>
			<description><![CDATA[<p>You cannot do it directly.<br />But, you can add your own script to the marker prefab, which at Start will get OnlineMapsMarker3DInstance from this GameObject, and then get a reference to the marker from the instance.<br /><a href="https://infinity-code.com/doxygen/online-maps/classOnlineMapsMarkerInstanceBase.html#ad9e000da13711eb4f11b0083d582aa49">https://infinity-code.com/doxygen/onlin … 83d582aa49</a></p><p>P.S. To store custom data (in this case, the passed GameObject name), it&#039;s better to use customFields instead of label, because the label will cause the tooltip to be displayed on hover.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 14 Sep 2022 22:29:20 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8574#p8574</guid>
		</item>
		<item>
			<title><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8573#p8573</link>
			<description><![CDATA[<p>Thank you again for all your quick responses.&nbsp; Hopefully this is the final question because I can now position, rotate, etc markers.&nbsp; However, some of my other scripts are dependent on the name of the marker.&nbsp; I saw that I can change the label.&nbsp; But is there an actual way to change the name of the instanced marker as you would a GameObject.name=&quot;YadaYada&quot;?&nbsp; Marker3D.name does not seem to work.&nbsp; If not, is there a way from the marker&#039;s start script to reference its label?&nbsp; Again, apologies for my stupidity on this.</p>]]></description>
			<author><![CDATA[null@example.com (Ty)]]></author>
			<pubDate>Wed, 14 Sep 2022 22:20:05 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8573#p8573</guid>
		</item>
		<item>
			<title><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8572#p8572</link>
			<description><![CDATA[<p>marker3D.altitudeType = OnlineMapsAltitudeType.relative;<br /><a href="https://infinity-code.com/doxygen/online-maps/classOnlineMapsMarker3D.html#af1e88f81f25da1fdbbeb2f41dc6d3b33">https://infinity-code.com/doxygen/onlin … 41dc6d3b33</a></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 14 Sep 2022 21:06:53 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8572#p8572</guid>
		</item>
		<item>
			<title><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8571#p8571</link>
			<description><![CDATA[<p>Thank you again, Alex.&nbsp; New issue though.&nbsp; It appears that the altitude is sea level?&nbsp; The altitude I have is AGL (above ground level).&nbsp; Is there a method for getting the ground altitude at a GPS location so I can set the sea level altitude with some math?&nbsp; currently my markers are appearing below the map when they are set at an altitude of 45 meters.&nbsp; FYI, yes I am using a 3D map.</p>]]></description>
			<author><![CDATA[null@example.com (Ty)]]></author>
			<pubDate>Wed, 14 Sep 2022 20:57:32 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8571#p8571</guid>
		</item>
		<item>
			<title><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8570#p8570</link>
			<description><![CDATA[<p>Altitude in meters. This is specified in the API Reference.</p><p>The problem is that when you use Vector2, X is longitude, Y is latitude.<br />Latitude cannot be -97, so just reverse the order of the values.</p><p>P.S. When the marker needs to be visible at any zoom, you can simply remove the range setting line.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 14 Sep 2022 05:04:42 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8570#p8570</guid>
		</item>
		<item>
			<title><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8569#p8569</link>
			<description><![CDATA[<p>Thank you.</p><p>So I added this script (using GPS coordinates that should mark the same location that I&#039;m directly over), and set an altitude of 300 (not sure if that&#039;s meters, feet, etc).&nbsp; But the result is that I end up with the marker at the corner of the map, and it doesn&#039;t move with the map when I move.</p><div class="codebox"><pre><code>using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class placeMarker : MonoBehaviour
{
    /// &lt;summary&gt;
        /// Prefab of 3D marker
        /// &lt;/summary&gt;
        public GameObject markerPrefab;

        private OnlineMapsMarker3D marker3D;

        /*private void OnGUI()
        {
            if (GUI.Button(new Rect(5, 5, 100, 20), &quot;Move Left&quot;))
            {
                // Change the marker coordinates.
                Vector2 mPos = marker3D.position;
                mPos.x += 0.1f;
                marker3D.position = mPos;
            }
        }*/

        private void Start()
        {
            // Get instance of OnlineMapsControlBase3D (Texture or Tileset)
            OnlineMapsControlBase3D control = OnlineMapsControlBase3D.instance;

            if (control == null)
            {
                Debug.LogError(&quot;You must use the 3D control (Texture or Tileset).&quot;);
                return;
            }

            // Marker position. Geographic coordinates.
            Vector2 markerPosition = new Vector2(30.341355816183523f,-97.91188041419034f);

            // Create 3D marker
            marker3D = OnlineMapsMarker3DManager.CreateItem(markerPosition, markerPrefab);
            marker3D.altitude = 300;
            // Specifies that marker should be shown only when zoom from 1 to 10.
            marker3D.range = new OnlineMapsRange(1, 20);
        }
    }</code></pre></div><p>so it appears at the corner of the map, and very much below the map.</p>]]></description>
			<author><![CDATA[null@example.com (Ty)]]></author>
			<pubDate>Tue, 13 Sep 2022 21:52:02 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8569#p8569</guid>
		</item>
		<item>
			<title><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8568#p8568</link>
			<description><![CDATA[<p>Hello.</p><p>The easiest way is to create 3D marker and set the altitude.<br /><a href="https://infinity-code.com/doxygen/online-maps/classOnlineMapsMarker3D.html#ae1c9eed9a2695c4f5d1c691b4998fa1e">https://infinity-code.com/doxygen/onlin … 1b4998fa1e</a><br /><a href="https://infinity-code.com/atlas/online-maps/pages/Marker3D_Example.html">https://infinity-code.com/atlas/online- … ample.html</a></p><p>To make the marker scale with the map instead of having a fixed size, set sizeType = OnlineMapsMarker3D.SizeType.realWorld and the desired scale value.<br /><a href="https://infinity-code.com/doxygen/online-maps/classOnlineMapsMarker3D.html#ac8ee16a0d8bc771f2df37c88ac04bdca">https://infinity-code.com/doxygen/onlin … 88ac04bdca</a><br />When sizeType - realWorld, the marker instance will have the specified scale at maximum zoom and will be halved every zoom level.<br />For example, with scale - 100, marker.instance.transform.localScale will be:<br />Zoom 20 - {100, 100, 100};<br />Zoom 19 - {50, 50, 50};<br />...<br />Zoom 15 - {3.125, 3.125, 3.125};<br />...<br />etc.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 13 Sep 2022 18:59:12 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8568#p8568</guid>
		</item>
		<item>
			<title><![CDATA[Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=8566#p8566</link>
			<description><![CDATA[<p>I know... not a usual question.&nbsp; But I&#039;d like to place a prefab in the sky above the map (of course have it move with the map movement / zoom factor).&nbsp; Here are my specific questions:</p><p>How do I place the object in the 3D space?&nbsp; I have an AGL (above ground level) altitude in Meters, and GPS coordinates.&nbsp; Do I send the lon/lat/alt to a function in your API?&nbsp; If so, what is the function?&nbsp; If not, do I use the place marker to get the lon/lat, and then use something else to get the alt of the ground below my desired location and add my AGL altitude?&nbsp; If so, what format do I need to convert the meters to?&nbsp; Will I need to update this conversion based on zoom level?</p><p>I know... complex question, but I&#039;m stuck... I&#039;m very much hoping I can just send WGS83 lon/lat and meter alt to your script and plug that response into a transform or something.&nbsp; I was very hopeful when I saw the flying airplane in your demo video.&nbsp; Seems like that is exactly what I&#039;m trying to do.</p>]]></description>
			<author><![CDATA[null@example.com (Ty)]]></author>
			<pubDate>Tue, 13 Sep 2022 17:36:51 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=8566#p8566</guid>
		</item>
	</channel>
</rss>
