<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Placing a marker in the sky at a specified altitude / GPS]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=2031&amp;type=atom" />
	<updated>2022-09-14T23:36:36Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=2031</id>
		<entry>
			<title type="html"><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8580#p8580" />
			<content type="html"><![CDATA[<p>Thank you. I really appreciate this.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2022-09-14T23:36:36Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8580#p8580</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8579#p8579" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Ty]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2232</uri>
			</author>
			<updated>2022-09-14T23:34:59Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8579#p8579</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8578#p8578" />
			<content type="html"><![CDATA[<p>marker3D.customFields[&quot;name&quot;] and marker3D[&quot;name&quot;] are the same, but the second way is shorter.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2022-09-14T23:31:23Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8578#p8578</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8577#p8577" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Ty]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2232</uri>
			</author>
			<updated>2022-09-14T23:26:28Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8577#p8577</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8576#p8576" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2022-09-14T23:06:06Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8576#p8576</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8575#p8575" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Ty]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2232</uri>
			</author>
			<updated>2022-09-14T23:02:24Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8575#p8575</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8574#p8574" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2022-09-14T22:29:20Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8574#p8574</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8573#p8573" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Ty]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2232</uri>
			</author>
			<updated>2022-09-14T22:20:05Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8573#p8573</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8572#p8572" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2022-09-14T21:06:53Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8572#p8572</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8571#p8571" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Ty]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2232</uri>
			</author>
			<updated>2022-09-14T20:57:32Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8571#p8571</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8570#p8570" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2022-09-14T05:04:42Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8570#p8570</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8569#p8569" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Ty]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2232</uri>
			</author>
			<updated>2022-09-13T21:52:02Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8569#p8569</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8568#p8568" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2022-09-13T18:59:12Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8568#p8568</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Placing a marker in the sky at a specified altitude / GPS]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=8566#p8566" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Ty]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2232</uri>
			</author>
			<updated>2022-09-13T17:36:51Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=8566#p8566</id>
		</entry>
</feed>
