<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — OnlineMapsMarkerBase.SetPosition only updates when dragging map]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1809&amp;type=atom" />
	<updated>2021-07-14T16:30:48Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1809</id>
		<entry>
			<title type="html"><![CDATA[Re: OnlineMapsMarkerBase.SetPosition only updates when dragging map]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7594#p7594" />
			<content type="html"><![CDATA[<p>Hello.</p><p>You need to call redrawing of the map after updating the marker position.<br /><a href="https://infinity-code.com/doxygen/online-maps/classOnlineMaps.html#a33983fd6e33e021795565f199d39b885">https://infinity-code.com/doxygen/onlin … 199d39b885</a></p><p>P.S. Store the result of GetCoords in a variable for later reuse.<br />This will help you avoid unnecessary performance degradation.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2021-07-14T16:30:48Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7594#p7594</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[OnlineMapsMarkerBase.SetPosition only updates when dragging map]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7593#p7593" />
			<content type="html"><![CDATA[<p>Hi,</p><p>I am not completely sure if this is a bug but I almost assume. I want to position a 2D marker below cursor position:</p><div class="codebox"><pre><code>    void TestSelector()
    {
        OnlineMapsMarker newMarker = UIMarkerController.Create(new Vector2(0f, 0f), MarkerTexture);
        Selector = newMarker;
    }

    void Update()
    {
        if (Map.control.GetCoords() != null &amp;&amp; Selector != null)
        {
            Selector.SetPosition(Map.control.GetCoords().x, Map.control.GetCoords().y);
        }
    }</code></pre></div><p>The code above does only position the marker as long as I press or hold the mouse button. If I move the cursor around without clicking, the marker doesnt change position.</p>]]></content>
			<author>
				<name><![CDATA[DDQ]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1662</uri>
			</author>
			<updated>2021-07-14T14:40:00Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7593#p7593</id>
		</entry>
</feed>
