<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Update markers position problem]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=2424&amp;type=atom" />
	<updated>2026-04-21T08:19:12Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=2424</id>
		<entry>
			<title type="html"><![CDATA[Re: Update markers position problem]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9979#p9979" />
			<content type="html"><![CDATA[<p>Hey, I&#039;ve sent you an email with the project. Thank you.</p>]]></content>
			<author>
				<name><![CDATA[mikli1]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2745</uri>
			</author>
			<updated>2026-04-21T08:19:12Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9979#p9979</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Update markers position problem]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9978#p9978" />
			<content type="html"><![CDATA[<p>Hi, </p><p>I’ve taken a look, but I don’t see any obvious issues that would clearly explain the problem. <br />At least nothing that stands out right away.<br />If you’d like, you can send me a minimal project where the issue is reproducible. <br />That would make it much easier to debug and understand what’s going on.<br />You can send it to me by email or via Discord.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2026-04-20T19:25:34Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9978#p9978</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Update markers position problem]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=9977#p9977" />
			<content type="html"><![CDATA[<p>Hi, I&#039;m using Online maps 4.5.0.1 and Unity 6.3.<br />I have a custom markers engine just like in the examples. I&#039;m calling UpdateMarkers when map moves (assigned to public Action OnMapUpdated). My application is only 2d. I&#039;m using Canvas with screen overlay mode with canvas scaler - scale with screen size (mode expand). Also my map is in many places in my application and my map views have different sizes, sometimes full screen sometimes they are smaller in popups. In my setup I have a MapCamera that renders the map into a Map render texture. I have multiple RawImages in my project with RawImageTouchForwarders.</p><p>The problem I have is that when I move the map markers position is not updated with the same vector. They got desync and point to another location. Seems like something with the canvas scaler is incorrectly calculated... but I cannot find the error in the code.</p><br /><p>This is my UpdateMarker method:<br /></p><div class="codebox"><pre><code>private void UpdateMarker(IUIEntity marker, MapController mc)
{
    if (marker == null || !marker.hasGameObject || marker.gameObject == null)
    {
        return;
    }

    Transform markerTransform = marker.gameObject.transform;
    RawImageTouchForwarder forwarder = markerTransform.parent.parent.GetComponentInChildren&lt;RawImageTouchForwarder&gt;(true);

    if (forwarder == null)
    {
        Logger.Error(&quot;Could not find raw image touch forwarder for marker: &quot; + marker.gameObject.name);
        return;
    }

    Vector2 screenPosition = mc.control.LocationToScreen(marker.longitude, marker.latitude);
    screenPosition = forwarder.MapToForwarderSpace(screenPosition);

    RectTransformUtility.ScreenPointToLocalPointInRectangle(markerTransform.parent as RectTransform, screenPosition, null, out Vector2 point);
    markerTransform.localPosition = point;
}</code></pre></div><p>Thanks for help.</p>]]></content>
			<author>
				<name><![CDATA[mikli1]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2745</uri>
			</author>
			<updated>2026-04-20T14:44:39Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=9977#p9977</id>
		</entry>
</feed>
