<?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 — Tips & Tricks]]></title>
		<link>https://forum.infinity-code.com/index.php</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;fid=39&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent topics at Infinity Code Forum.]]></description>
		<lastBuildDate>Thu, 11 Jul 2024 13:29:18 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Smooth Camera Zoom to Location]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?id=2291&amp;action=new</link>
			<description><![CDATA[<p>Hi, I am deeply sorry if this question was already answered, but my search had no results.</p><p>I want to realize a smooth camera movement to a specific location on the map. Below my (maybe hacky) code.</p><div class="codebox"><pre><code>IEnumerator MoveCamera(Vector2 coords, int zoom)
        {     
            float currentZoom = OnlineMaps.instance.zoom;

            double currentLon;
            double currentLat;
            OnlineMaps.instance.GetPosition(out currentLon, out currentLat);

            while (Mathf.Abs((float)currentLon - coords.y) &gt; 0.01f || Mathf.Abs((float)currentLat - coords.x) &gt; 0.01f)
            {
                currentLon = Mathf.Lerp((float)currentLon, coords.y, 0.45f);
                currentLat = Mathf.Lerp((float)currentLat, coords.x, 0.45f);
                currentZoom = Mathf.Lerp((float)currentZoom, zoom, 0.65f);

                OnlineMaps.instance.SetPositionAndZoom(currentLon, currentLat, currentZoom);

                yield return null;
            }

            UnlockCamera();
        }</code></pre></div><p>This works functionality wise exactly as intended, but unfortunately I get huge dropdowns if the zoom level changes during the camera movement. I looked in the profiler and its specifically: OnlineMaps.Update() / Texture2D.Compress, which is skyrocketing if there are changes in zoom level.</p><p>Could you tell me if I use the correct approach to realize this function or if there is any way to improve this bottle-neck.</p><p>Thanks,<br />Danish</p>]]></description>
			<author><![CDATA[null@example.com (DDQ)]]></author>
			<pubDate>Thu, 11 Jul 2024 13:29:18 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?id=2291&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Clustering 2D and 3D markers]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?id=2268&amp;action=new</link>
			<description><![CDATA[<p>Hello.</p><p>Examples of how to cluster 2D and 3D markers.<br />Clustering scripts contain clustering logic.<br />Test scripts contain examples of how to use this logic.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 03 May 2024 13:37:20 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?id=2268&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Overlaying a single image using a shader]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?id=2142&amp;action=new</link>
			<description><![CDATA[<p><span class="postimg"><img src="https://i.ibb.co/qNftn2C/Map-Overlay.png" alt="https://i.ibb.co/qNftn2C/Map-Overlay.png" /></span></p><p>When you need to overlay a single image on a map, the best way to do it is on the shader side.</p><p>This way has two huge advantages:<br />1. It&#039;s really fast.<br />2. It&#039;s elevation friendly.</p><p>Disadvantage:<br />You can only have one such overlay at a time.</p><p>Requirement: Tileset Control.</p><p>How to use it:<br />1. Download the script and shader for your Render Pipeline.<br />Built-in RP - TilesetWithOverlay.<br />URP/HDRP/Custom RP - TilesetWithOverlay Graph.<br />2. Import this into the project.<br />3. Add TilesetOverlayUsingShader component to the map GameObject, and configure the fields.<br />4. Set the shader to Tileset / Materials &amp; Shaders / Tileset Shader.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 26 Jul 2023 21:32:44 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?id=2142&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Smoothing GPS movement]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?id=1640&amp;action=new</link>
			<description><![CDATA[<p>[Reserved for video]</p><p>GPS values are jerky, that does not look smooth, and can create visual discomfort when driving.<br />In this example, I&#039;ll show you how to work around this problem.</p><p>GpsRouteEmulator simulates driving a car along a route at a specified speed to test location smoothing in the Unity Editor. <br />Uses Google Direction API and requires entering Google Maps key into Key Manager.</p><p>SmoothGPSMovement smooths location changes based on speed and compass value.</p><p>Possible improvements:<br />1. SmoothGPSMovement knows nothing about the route. <br />Using a route can improve the prediction of the expected point.</p><p>2. If GPS is lost (for example, entering a tunnel), the script will continue to move. <br />To fix this, you need to limit the simulated distance and / or time from the last update of GPS location.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 19 Nov 2020 00:41:28 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?id=1640&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Tileset On UI]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?id=1539&amp;action=new</link>
			<description><![CDATA[<p><div class="fancy_video_tag_player"><iframe class="youtube-player" type="text/html" width="640" height="385" src="https://www.youtube.com/embed/KNnPJSj5KZc" frameborder="0"></iframe></div></p><p>When you need to display a map on a UI, most users use UI Image or UI Raw Image Control, which can cause loss of quality or performance.<br />Tileset is much faster, uses less memory and has many exclusive features.<br />Tileset is a dynamically mesh, and cannot be used as a UI element directly.<br />In this video, I’ll show you how to display Tileset on a UI.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 09 Jun 2020 23:47:30 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?id=1539&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Rasterization drawing elements]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?id=1478&amp;action=new</link>
			<description><![CDATA[<p><span class="postimg"><img src="https://infinity-code.com/sites/default/files/styles/full_post/public/images/news/2020.03.25%20-%20Online%20Maps%20-%20Rasterization%20drawing%20elements.jpg?itok=ASJ0hbQ6" alt="https://infinity-code.com/sites/default/files/styles/full_post/public/images/news/2020.03.25%20-%20Online%20Maps%20-%20Rasterization%20drawing%20elements.jpg?itok=ASJ0hbQ6" /></span></p><p>When you need to display very complex drawing elements, such as country or state borders, the best way is to rasterize it into tiles and use it as overlay.</p><p>Example of how to rasterize drawing elements:<br /></p><div class="codebox"><pre><code>using System.Collections;
using System.IO;
using UnityEngine;

public class RasterizeDrawingForOverlay : MonoBehaviour
{
    public int zoomFrom = 1;
    public int zoomTo = 10;

    private bool started = false;
    private IEnumerator routine;
    private Texture2D texture;
    private Color32[] colors;
    private OnlineMaps map;

    private void Finish()
    {
        Destroy(texture);
        texture = null;
        colors = null;
        map = null;

#if UNITY_EDITOR
        UnityEditor.AssetDatabase.Refresh();
#endif
    }

    private void GetBounds(out double lx, out double ty, out double rx, out double by)
    {
        lx = double.MaxValue;
        ty = double.MinValue;
        rx = double.MinValue;
        by = double.MaxValue;

        foreach (var el in OnlineMapsDrawingElementManager.instance)
        {
            if (el is OnlineMapsDrawingRect)
            {
                OnlineMapsDrawingRect rect = el as OnlineMapsDrawingRect;
                UpdateBounds(ref lx, ref ty, ref rx, ref by, rect.x, rect.y);
                UpdateBounds(ref lx, ref ty, ref rx, ref by, rect.x + rect.width, rect.y + rect.height);
                continue;
            }

            IEnumerable points;
            if (el is OnlineMapsDrawingLine) points = (el as OnlineMapsDrawingLine).points;
            else if (el is OnlineMapsDrawingPoly) points = (el as OnlineMapsDrawingPoly).points;
            else continue;

            int valueType = -1; // 0 - Vector2, 1 - float, 2 - double, 3 - OnlineMapsVector2d
            object v1 = null;
            int i = -1;
            double ppx = 0;

            foreach (object p in points)
            {
                i++;

                if (valueType == -1)
                {
                    if (p is Vector2) valueType = 0;
                    else if (p is float) valueType = 1;
                    else if (p is double) valueType = 2;
                    else if (p is OnlineMapsVector2d) valueType = 3;
                }

                object v2 = v1;
                v1 = p;

                double px = 0;
                double py = 0;

                if (valueType == 0)
                {
                    if (i == 0)
                    {
                        Vector2 p1 = (Vector2)v1;
                        ppx = p1.x;
                        UpdateBounds(ref lx, ref ty, ref rx, ref by, p1.x, p1.y);
                        continue;
                    }

                    Vector2 v = (Vector2) v1;
                    px = v.x;
                    py = v.y;
                }
                else if (valueType == 3)
                {
                    if (i == 0)
                    {
                        OnlineMapsVector2d p1 = (OnlineMapsVector2d)v1;
                        ppx = p1.x;
                        UpdateBounds(ref lx, ref ty, ref rx, ref by, p1.x, p1.y);
                        continue;
                    }

                    Vector2 v = (OnlineMapsVector2d)v1;
                    px = v.x;
                    py = v.y;
                }
                else if (i % 2 == 1)
                {
                    if (i == 1)
                    {
                        if (valueType == 1)
                        {
                            ppx = (float)v2;
                            UpdateBounds(ref lx, ref ty, ref rx, ref by, ppx, (float)v1);
                        }
                        else
                        {
                            ppx = (double)v2;
                            UpdateBounds(ref lx, ref ty, ref rx, ref by, ppx, (double)v1);
                        }
                        continue;
                    }

                    if (valueType == 1)
                    {
                        px = (float) v2;
                        py = (float) v1;
                    }
                    else
                    {
                        px = (double) v2;
                        py = (double) v1;
                    }
                }

                while (true)
                {
                    double ox = px - ppx;

                    if (ox &gt; 180) px -= 360;
                    else if (ox &lt; -180) px += 360;
                    else break;
                }

                UpdateBounds(ref lx, ref ty, ref rx, ref by, px, py);

                ppx = px;
            }
        }
    }

    private void OnGUI()
    {
        if (!started)
        {
            if (GUILayout.Button(&quot;Rasterize&quot;))
            {
                routine = Rasterize();
                StartCoroutine(routine);
            }
        }
        else
        {
            if (GUILayout.Button(&quot;Cancel&quot;))
            {
                StopCoroutine(routine);
                Finish();
            }
        }
    }

    public IEnumerator Rasterize()
    {
        if (OnlineMapsDrawingElementManager.CountItems == 0) yield break;

        double lx, ty, rx, by;
        GetBounds(out lx, out ty, out rx, out by);

        map = OnlineMaps.instance;
        texture = new Texture2D(256, 256, TextureFormat.ARGB32, false);
        colors = new Color32[256 * 256];

        for (int z = zoomFrom; z &lt;= zoomTo; z++)
        {
            int max = 1 &lt;&lt; z;

            double tlx, tty, trx, tby;
            map.projection.CoordinatesToTile(lx, ty, z, out tlx, out tty);
            map.projection.CoordinatesToTile(rx, by, z, out trx, out tby);

            int ilx = (int) tlx;
            int ity = (int) tty;
            int irx = (int) trx;
            int iby = (int) tby;

            if (ilx &gt; irx) irx += max;

            for (int x = ilx; x &lt;= irx; x++)
            {
                int cx = x;
                if (cx &gt;= max) cx -= max;

                for (int y = ity; y &lt;= iby; y++)
                {
                    yield return RasterizeTile(z, cx, y);
                }
            }
        }

        Finish();
    }

    private IEnumerator RasterizeTile(int zoom, int x, int y)
    {
        yield return null;

        Color32 empty = new Color32(255, 255, 255, 0);
        for (int i = 0; i &lt; 256 * 256; i++) colors[i] = empty;

        Vector2 bufferPos = map.buffer.topLeftPosition;
        double sx, sy;
        map.projection.TileToCoordinates(bufferPos.x, bufferPos.y, map.buffer.lastState.zoom, out sx, out sy);

        Vector2 bufferPosition = new Vector2(x, y);

        foreach (OnlineMapsDrawingElement el in map.control.drawingElementManager)
        {
            el.Draw(colors, bufferPosition, 256, 256, zoom);
        }

        bool hasColor = false;
        for (int i = 0; i &lt; 256 * 256; i++)
        {
            if (colors[i].a != 0)
            {
                hasColor = true;
                break;
            }
        }

        if (!hasColor)
        {
            Debug.Log(&quot;Ignore &quot; + zoom + &quot;/&quot; + x + &quot;/&quot; + y);
            yield break;
        }

        texture.SetPixels32(colors);
        texture.Apply(false);

        byte[] bytes = texture.EncodeToPNG();

        string path = Application.dataPath + &quot;/Resources/DrawingTiles/&quot; + zoom + &quot;/&quot; + x + &quot;/&quot; + y + &quot;.png&quot;;
        Debug.Log(path);
        FileInfo info = new FileInfo(path);
        if (!info.Directory.Exists) info.Directory.Create();

        File.WriteAllBytes(path, bytes);
    }

    private static void UpdateBounds(ref double lx, ref double ty, ref double rx, ref double by, double px, double py)
    {
        if (px &lt; lx) lx = px;
        if (px &gt; rx) rx = px;

        if (py &gt; ty) ty = py;
        if (py &lt; by) by = py;
    }
}</code></pre></div><p>P.S. Online Maps v3.6 and below contains a bug due to which this will not work for Tileset.<br />To fix it, update Online Maps to version 3.7 or higher (if present), or modify OnlineMapsDrawingElement.DrawLineToBuffer (line 454):<br /></p><div class="codebox"><pre><code>manager.map.projection.CoordinatesToTile(tlx, tly, izoom, out sx, out sy);</code></pre></div><p>to<br /></p><div class="codebox"><pre><code>manager.map.projection.CoordinatesToTile(0, 0, izoom, out sx, out sy);</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 25 Mar 2020 20:00:12 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?id=1478&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Map Baseboards]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?id=1421&amp;action=new</link>
			<description><![CDATA[<p><span class="postimg"><img src="https://infinity-code.com/sites/default/files/styles/full_post/public/images/news/2020.01.08%20-%20Map%20Baseboards.jpg?itok=Ycpi8eN6" alt="https://infinity-code.com/sites/default/files/styles/full_post/public/images/news/2020.01.08%20-%20Map%20Baseboards.jpg?itok=Ycpi8eN6" /></span></p><p>Example of how to make baseboards for a map.<br />Requirement: Tileset Control.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 07 Jan 2020 22:47:50 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?id=1421&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Map follow GameObject]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?id=1339&amp;action=new</link>
			<description><![CDATA[<p><div class="fancy_video_tag_player"><iframe class="youtube-player" type="text/html" width="640" height="385" src="https://www.youtube.com/embed/BubHVdThEJo" frameborder="0"></iframe></div></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 27 Aug 2019 14:10:02 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?id=1339&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Replace Color to Texture]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?id=1119&amp;action=new</link>
			<description><![CDATA[<p><div class="fancy_video_tag_player"><iframe class="youtube-player" type="text/html" width="640" height="385" src="https://www.youtube.com/embed/b-mg6iJ2w5o" frameborder="0"></iframe></div></p><p>This video continues Online Maps + PBR (Physically Based Rendering) video.<br />Watch this video first if you haven&#039;t seen it:<br /><a href="http://forum.infinity-code.com/viewtopic.php?id=1022">http://forum.infinity-code.com/viewtopic.php?id=1022</a></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Tue, 23 Apr 2019 09:39:05 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?id=1119&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Online Maps + PBR (Physically Based Rendering)]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?id=1022&amp;action=new</link>
			<description><![CDATA[<p>How to use Online Maps + PBR (Physically Based Rendering).<br /><div class="fancy_video_tag_player"><iframe class="youtube-player" type="text/html" width="640" height="385" src="https://www.youtube.com/embed/_kbi6johq8A" frameborder="0"></iframe></div></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 30 Jan 2019 13:37:43 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?id=1022&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Multiplayer on the map - it's easy (Online Maps + Photon PUN2)]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?id=936&amp;action=new</link>
			<description><![CDATA[<p><div class="fancy_video_tag_player"><iframe class="youtube-player" type="text/html" width="640" height="385" src="https://www.youtube.com/embed/Yl5K_Wr6Umk" frameborder="0"></iframe></div></p><p><strong>Script:</strong><br /></p><div class="codebox"><pre><code>/*     INFINITY CODE 2013-2018      */
/*   http://www.infinity-code.com   */

using System.Collections.Generic;
using ExitGames.Client.Photon;
using Photon.Pun;
using Photon.Realtime;
using UnityEngine;
using Random = UnityEngine.Random;

namespace InfinityCode.OnlineMapsExamples
{
    /// &lt;summary&gt;
    /// Example of how to display the location of several users on the map at the same time usign Photon PUN2.
    /// Drag the player marker to move it synchronously for all clients.
    /// &lt;/summary&gt;
    public class SyncDraggingUsingPhoton : MonoBehaviourPunCallbacks
    {
        /// &lt;summary&gt;
        /// Dictionary of other players
        /// &lt;/summary&gt;
        public Dictionary&lt;string, OnlineMapsMarker3D&gt; otherPlayers;

        /// &lt;summary&gt;
        /// Array of marker prefabs
        /// &lt;/summary&gt;
        public GameObject[] prefabs;

        /// &lt;summary&gt;
        /// Reference to the map
        /// &lt;/summary&gt;
        private OnlineMaps map;

        /// &lt;summary&gt;
        /// Reference to the control
        /// &lt;/summary&gt;
        private OnlineMapsTileSetControl control;

        /// &lt;summary&gt;
        /// Creates a marker for another player, and sets the position
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;player&quot;&gt;&lt;/param&gt;
        private void CreateOtherPlayer(Player player)
        {
            // Get player properties
            Hashtable props = player.CustomProperties;
            double longitude = (double)props[&quot;longitude&quot;];
            double latitude = (double)props[&quot;latitude&quot;];
            int prefabIndex = (int)props[&quot;prefab_index&quot;];
            string id = player.UserId;

            // Create a new marker
            OnlineMapsMarker3D marker = OnlineMapsMarker3DManager.CreateItem(longitude, latitude, prefabs[prefabIndex]);
            marker.label = player.NickName;
            otherPlayers.Add(id, marker);
        }

        /// &lt;summary&gt;
        /// Called when the client is connected to the Master Server and ready for matchmaking and other tasks
        /// &lt;/summary&gt;
        public override void OnConnectedToMaster()
        {
            // Create a new room or connect to an existing one
            RoomOptions roomOptions = new RoomOptions();
            roomOptions.IsVisible = false;
            roomOptions.MaxPlayers = 4;
            roomOptions.PublishUserId = true;
            PhotonNetwork.JoinOrCreateRoom(&quot;Test Room&quot;, roomOptions, TypedLobby.Default);

            double tlx, tly, brx, bry;
            map.GetCorners(out tlx, out tly, out brx, out bry);

            // Create current player marker
            int prefabIndex = Random.Range(0, prefabs.Length);
            double longitude = Random.Range((float)tlx, (float)brx);
            double latitude = Random.Range((float)bry, (float)tly);
            OnlineMapsMarker3D marker = OnlineMapsMarker3DManager.CreateItem(longitude, latitude, prefabs[prefabIndex]);
            marker.label = &quot;My Player&quot;;

            // Make a marker draggable, and subscribe to the drag event
            marker.SetDraggable();
            marker.OnDrag += OnDrag;

            // Center the map on the marker
            map.position = marker.position;

            // Create initial properties
            Hashtable hashtable = new Hashtable
            {
                {&quot;prefab_index&quot;, prefabIndex},
                {&quot;longitude&quot;, longitude},
                {&quot;latitude&quot;, latitude}
            };
            PhotonNetwork.SetPlayerCustomProperties(hashtable);
        }

        /// &lt;summary&gt;
        /// Called when dragging a player marker
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;marker&quot;&gt;Player marker&lt;/param&gt;
        private void OnDrag(OnlineMapsMarkerBase marker)
        {
            // Update location in player properties
            double longitude, latitude;
            marker.GetPosition(out longitude, out latitude);
            Hashtable hashtable = new Hashtable
            {
                {&quot;longitude&quot;, longitude},
                { &quot;latitude&quot;, latitude}
            };

            PhotonNetwork.SetPlayerCustomProperties(hashtable);
        }

        /// &lt;summary&gt;
        /// Called when the LoadBalancingClient entered a room, no matter if this client created it or simply joined
        /// &lt;/summary&gt;
        public override void OnJoinedRoom()
        {
            // Create markers for other players.
            foreach (KeyValuePair&lt;int, Player&gt; pair in PhotonNetwork.CurrentRoom.Players)
            {
                Player player = pair.Value;
                if (player.IsLocal) continue;
                CreateOtherPlayer(player);
            }
        }

        /// &lt;summary&gt;
        /// Called when a remote player entered the room. This Player is already added to the playerlist
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;otherPlayer&quot;&gt;The player who entered the room&lt;/param&gt;
        public override void OnPlayerEnteredRoom(Player otherPlayer)
        {
            CreateOtherPlayer(otherPlayer);
        }

        /// &lt;summary&gt;
        /// Called when a remote player left the room or became inactive
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;otherPlayer&quot;&gt;The player who left the room&lt;/param&gt;
        public override void OnPlayerLeftRoom(Player otherPlayer)
        {
            OnlineMapsMarker3D marker;
            if (otherPlayers.TryGetValue(otherPlayer.UserId, out marker))
            {
                otherPlayers.Remove(otherPlayer.UserId);
                OnlineMapsMarker3DManager.RemoveItem(marker);
            }
        }

        /// &lt;summary&gt;
        /// Called when custom player-properties are changed
        /// &lt;/summary&gt;
        /// &lt;param name=&quot;targetPlayer&quot;&gt;Player that changed&lt;/param&gt;
        /// &lt;param name=&quot;changedProps&quot;&gt;Properties that changed&lt;/param&gt;
        public override void OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps)
        {
            if (targetPlayer.IsLocal) return;

            // Update player marker location
            double longitude = (double)changedProps[&quot;longitude&quot;];
            double latitude = (double)changedProps[&quot;latitude&quot;];

            string id = targetPlayer.UserId;
            OnlineMapsMarker3D marker;

            if (otherPlayers.TryGetValue(id, out marker))
            {
                marker.SetPosition(longitude, latitude);
                map.Redraw();
            }
        }

        private void Start()
        {
            map = OnlineMaps.instance;
            control = OnlineMapsTileSetControl.instance;
            otherPlayers = new Dictionary&lt;string, OnlineMapsMarker3D&gt;();

            // Connect to Photon as configured in the PhotonServerSettings file
            PhotonNetwork.LocalPlayer.NickName = &quot;Player &quot; + Random.Range(0, 100000);
            PhotonNetwork.ConnectUsingSettings();
        }
    }
}</code></pre></div><p>Edit (2019.10.11):<br />Updated script for Online Maps v3.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 07 Nov 2018 06:40:58 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?id=936&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Show Google Street View using Online Maps and uPano]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?id=885&amp;action=new</link>
			<description><![CDATA[<p><div class="fancy_video_tag_player"><iframe class="youtube-player" type="text/html" width="640" height="385" src="https://www.youtube.com/embed/d-evQ-6JUGg" frameborder="0"></iframe></div></p><p>Example of how to open Google Street View panorama using Online Maps and uPano.</p><p>uPano:<br /><a href="https://infinity-code.com/en/products/upano">https://infinity-code.com/en/products/upano</a><br /><a href="https://assetstore.unity.com/packages/tools/integration/upano-126396">https://assetstore.unity.com/packages/t … ano-126396</a></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 10 Sep 2018 20:01:36 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?id=885&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Tile Counter]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?id=827&amp;action=new</link>
			<description><![CDATA[<p><a href="http://tools.infinity-code.com/TileCounter/"><span class="postimg"><img src="https://thumb.ibb.co/f5a4HS/img1.png" alt="https://thumb.ibb.co/f5a4HS/img1.png" /></span></a><br /><a href="http://tools.infinity-code.com/TileCounter/">http://tools.infinity-code.com/TileCounter/</a></p><p>Free online utility for calculating the number and size of tiles in the specified area.<br />Useful if you plan to make an offline application.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 20 Apr 2018 22:22:28 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?id=827&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Search for a route using Bolt]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?id=821&amp;action=new</link>
			<description><![CDATA[<p>An example of how to find and draw a route in Online Maps using Bolt.</p><p><div class="fancy_video_tag_player"><iframe class="youtube-player" type="text/html" width="640" height="385" src="https://www.youtube.com/embed/8t0aH269yQ4" frameborder="0"></iframe></div></p><p>Online Maps Bolt Integration Kit:<br /><a href="http://forum.infinity-code.com/viewtopic.php?pid=3535">http://forum.infinity-code.com/viewtopic.php?pid=3535</a></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 09 Apr 2018 02:53:46 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?id=821&amp;action=new</guid>
		</item>
		<item>
			<title><![CDATA[Online Maps Bolt Integration Kit]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?id=820&amp;action=new</link>
			<description><![CDATA[<p>An example of how to integrate Online Maps and Bolt.</p><p><div class="fancy_video_tag_player"><iframe class="youtube-player" type="text/html" width="640" height="385" src="https://www.youtube.com/embed/e5_i-K5i8Ao" frameborder="0"></iframe></div></p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 09 Apr 2018 00:05:12 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?id=820&amp;action=new</guid>
		</item>
	</channel>
</rss>
