<?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 — When I zoom in on a map with elevation the map moves]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=2113</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=2113&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in When I zoom in on a map with elevation the map moves.]]></description>
		<lastBuildDate>Wed, 26 Apr 2023 14:31:35 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: When I zoom in on a map with elevation the map moves]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9008#p9008</link>
			<description><![CDATA[<p>Thank you so much</p>]]></description>
			<author><![CDATA[null@example.com (jose)]]></author>
			<pubDate>Wed, 26 Apr 2023 14:31:35 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9008#p9008</guid>
		</item>
		<item>
			<title><![CDATA[Re: When I zoom in on a map with elevation the map moves]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9007#p9007</link>
			<description><![CDATA[<p>Hi.</p><p>This is a planned behavior and happens because the map defaults to a fixed size in the scene.<br />When you zoom in/out, the displayed distance between map boundaries changes, but the map size in scene is fixed, so the height of the map changes.</p><p>Here is an example of how to fix the center point at the same height:<br /></p><div class="codebox"><pre><code>using UnityEngine;

namespace InfinityCode.OnlineMapsSupport
{
    public class KeepCenterAtZero : MonoBehaviour
    {
        private OnlineMaps map;

        private void Start()
        {
            map = OnlineMaps.instance;
            map.OnMapUpdated += OnMapUpdated;
        }

        private void OnMapUpdated()
        {
            double tlx, tly, brx, bry;
            double lng, lat;
            map.GetCorners(out tlx, out tly, out brx, out bry);
            map.GetPosition(out lng, out lat);
            Vector3 worldPosition = OnlineMapsTileSetControl.instance.GetWorldPositionWithElevation(lng, lat, tlx, tly, brx, bry);
            map.transform.Translate(new Vector3(0, -worldPosition.y, 0));
        }
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 26 Apr 2023 13:26:10 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9007#p9007</guid>
		</item>
		<item>
			<title><![CDATA[Re: When I zoom in on a map with elevation the map moves]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9006#p9006</link>
			<description><![CDATA[<p>What I want is to be able to zoom without the map moving.<br />I used the Lock Y scale but the elevation doesn&#039;t work out for me and in my project I change location and it breaks</p>]]></description>
			<author><![CDATA[null@example.com (jose)]]></author>
			<pubDate>Wed, 26 Apr 2023 12:28:07 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9006#p9006</guid>
		</item>
		<item>
			<title><![CDATA[When I zoom in on a map with elevation the map moves]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=9005#p9005</link>
			<description><![CDATA[<p>Hi, I try to zoom in on the map while using the elevation of the map but I have the problem that every time I zoom the map rises from the point where I put it without moving the transform</p>]]></description>
			<author><![CDATA[null@example.com (jose)]]></author>
			<pubDate>Wed, 26 Apr 2023 12:25:01 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=9005#p9005</guid>
		</item>
	</channel>
</rss>
