<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Simple gps navigator in the mobile application (Unity)]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1731&amp;type=atom" />
	<updated>2021-07-13T07:10:34Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1731</id>
		<entry>
			<title type="html"><![CDATA[Re: Simple gps navigator in the mobile application (Unity)]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7588#p7588" />
			<content type="html"><![CDATA[<p>using System;<br />using System.Collections.Generic;<br />using System.Linq;<br />using UnityEngine;<br />using System.Collections;<br />using UnityEngine.Android;<br />using UnityEngine.UI;</p><p>public class loc : MonoBehaviour<br />{<br />&nbsp; &nbsp; public bool lookToMarker = false;</p><p>&nbsp; &nbsp; /// &lt;summary&gt;<br />&nbsp; &nbsp; /// Orient marker on next point.<br />&nbsp; &nbsp; /// &lt;/summary&gt;<br />&nbsp; &nbsp; public bool orientMarkerOnNextPoint = false;</p><p>&nbsp; &nbsp; /// &lt;summary&gt;<br />&nbsp; &nbsp; /// Reference to marker<br />&nbsp; &nbsp; /// &lt;/summary&gt;<br />&nbsp; &nbsp; private OnlineMapsMarker marker;</p><p>&nbsp; &nbsp; /// &lt;summary&gt;<br />&nbsp; &nbsp; /// Array of route points<br />&nbsp; &nbsp; /// &lt;/summary&gt;<br />&nbsp; &nbsp; private OnlineMapsVector2d[] points;</p><p>&nbsp; &nbsp; /// &lt;summary&gt;<br />&nbsp; &nbsp; /// Current point index<br />&nbsp; &nbsp; /// &lt;/summary&gt;<br />&nbsp; &nbsp; private int pointIndex = -1;</p><p>&nbsp; &nbsp; /// &lt;summary&gt;<br />&nbsp; &nbsp; /// Current step progress<br />&nbsp; &nbsp; /// &lt;/summary&gt;<br />&nbsp; &nbsp; private double progress;<br />&nbsp; &nbsp; public float speed = 60;</p><br /><br /><p>&nbsp; &nbsp; private OnlineMapsMarker playerMarker;<br />&nbsp; &nbsp; public string googleAPIKey;<br />&nbsp; &nbsp; public Vector2 destination = new Vector2(83.316583f, 17.710500f);</p><p>&nbsp; &nbsp; private void Start()<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; if (string.IsNullOrEmpty(googleAPIKey)) Debug.LogWarning(&quot;Please specify Google API Key&quot;);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsLocationService.instance.OnLocationInited += OnLocationInited;<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; private void OnLocationInited()<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsGoogleDirections request = new OnlineMapsGoogleDirections(<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; googleAPIKey,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsLocationService.instance.position,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; destination);<br />&nbsp; &nbsp; &nbsp; &nbsp; request.OnComplete += OnRequestComplete;<br />&nbsp; &nbsp; &nbsp; &nbsp; request.Send();<br />&nbsp; &nbsp; }</p><p>&nbsp; &nbsp; private void OnRequestComplete(string response)<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; Debug.Log(&quot;OnComplete&quot;);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsGoogleDirectionsResult result = OnlineMapsGoogleDirections.GetResult(response);<br />&nbsp; &nbsp; &nbsp; &nbsp; if (result == null || result.routes.Length == 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Debug.Log(&quot;Something wrong&quot;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Debug.Log(response);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return;<br />&nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsGoogleDirectionsResult.Route firstRoute = result.routes[0];<br />&nbsp; &nbsp; &nbsp; &nbsp; List&lt;OnlineMapsGoogleDirectionsResult.Step&gt; steps = firstRoute.legs.SelectMany(l =&gt; l.steps).ToList();</p><p>&nbsp; &nbsp; &nbsp; &nbsp; // Create a new marker in first point.<br />&nbsp; &nbsp; &nbsp; &nbsp; marker = OnlineMapsMarkerManager.CreateItem(steps[0].start_location, &quot;Car&quot;);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; // Gets points of route.<br />&nbsp; &nbsp; &nbsp; &nbsp; points = firstRoute.overview_polylineD;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; // Draw the route.<br />&nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsDrawingLine route = new OnlineMapsDrawingLine(points, Color.red, 3);<br />&nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsDrawingElementManager.AddItem(route);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; pointIndex = 0;<br />&nbsp; &nbsp; }</p><br /><p>&nbsp; &nbsp; private void Update()<br />&nbsp; &nbsp; {</p><br /><br /><br /><br /><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; //////////////////////////////<br />&nbsp; &nbsp; &nbsp; &nbsp; if (pointIndex == -1) return;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; // Start point<br />&nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsVector2d p1 = points[pointIndex];</p><p>&nbsp; &nbsp; &nbsp; &nbsp; // End point<br />&nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsVector2d p2 = points[pointIndex + 1];</p><p>&nbsp; &nbsp; &nbsp; &nbsp; // Total step distance<br />&nbsp; &nbsp; &nbsp; &nbsp; double dx, dy;<br />&nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsUtils.DistanceBetweenPoints(p1.x, p1.y, p2.x, p2.y, out dx, out dy);<br />&nbsp; &nbsp; &nbsp; &nbsp; double stepDistance = Math.Sqrt(dx * dx + dy * dy);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; // Total step time<br />&nbsp; &nbsp; &nbsp; &nbsp; double totalTime = stepDistance / speed * 3600;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; // Current step progress<br />&nbsp; &nbsp; &nbsp; &nbsp; progress += Time.deltaTime / totalTime;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsVector2d position;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if (progress &lt; 1)<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; position = OnlineMapsVector2d.Lerp(p1, p2, progress);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; marker.SetPosition(position.x, position.y);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Orient marker<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (orientMarkerOnNextPoint) marker.rotation = 1.25f - OnlineMapsUtils.Angle2D((Vector2)p1, (Vector2)p2) / 360f;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; position = p2;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; marker.SetPosition(position.x, position.y);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pointIndex++;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; progress = 0;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (pointIndex &gt;= points.Length - 1)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Debug.Log(&quot;Finish&quot;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pointIndex = -1;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Orient marker<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (orientMarkerOnNextPoint) marker.rotation = 1.25f - OnlineMapsUtils.Angle2D(p2, points[pointIndex + 1]) / 360;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; &nbsp; &nbsp; }</p><p>&nbsp; &nbsp; &nbsp; &nbsp; if (lookToMarker) OnlineMaps.instance.SetPosition(position.x, position.y);<br />&nbsp; &nbsp; &nbsp; &nbsp; OnlineMaps.instance.Redraw();<br />&nbsp; &nbsp; }</p><br /><p>}</p><br /><br /><p>while using the script , in the location services were on , when i deploy on my android device it was not showing any route empty map, but when i turned on find on find location my id it works but the location is 600km far from my my location.</p>]]></content>
			<author>
				<name><![CDATA[ashh21411]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1672</uri>
			</author>
			<updated>2021-07-13T07:10:34Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7588#p7588</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple gps navigator in the mobile application (Unity)]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7587#p7587" />
			<content type="html"><![CDATA[<p>Thank You So Much. my last question in car drive by route example <br />1) i need my car location to my gps location but the script which was there in that scene, the lat and long coordinated were derived from online maps where we enter our default lat and long points. so it was starting from the default point which we enter. though location service component is there. its not taking gps <br />2) my car moment should be the user moment. but by default its moving with our desired speed which we mentioned. </p><p>thanks a lot for your support.</p>]]></content>
			<author>
				<name><![CDATA[ashh21411]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1672</uri>
			</author>
			<updated>2021-07-13T06:27:38Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7587#p7587</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple gps navigator in the mobile application (Unity)]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7586#p7586" />
			<content type="html"><![CDATA[<p>Example:<br /></p><div class="codebox"><pre><code>using UnityEngine;

public class DirectionsFromLocation : MonoBehaviour
{
    public string googleAPIKey;
    public Vector2 destination = new Vector2(83.316583f, 17.710500f);

    private void Start()
    {
        if (string.IsNullOrEmpty(googleAPIKey)) Debug.LogWarning(&quot;Please specify Google API Key&quot;);

        OnlineMapsLocationService.instance.OnLocationInited += OnLocationInited;
    }

    private void OnLocationInited()
    {
        OnlineMapsGoogleDirections request = new OnlineMapsGoogleDirections(
            googleAPIKey, 
            OnlineMapsLocationService.instance.position, 
            destination);
        request.OnComplete += OnRequestComplete;
        request.Send();
    }

    private void OnRequestComplete(string response)
    {
        // Do something
    }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2021-07-13T00:28:35Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7586#p7586</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple gps navigator in the mobile application (Unity)]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7584#p7584" />
			<content type="html"><![CDATA[<p>i was an beginner to c#, how to Use OnLocationInited event, to determine the initialization of GPS. could you please provide an example code which may be helpful us </p><br /><br /><p>&nbsp; &nbsp; &nbsp;public OnlineMapsLocationServiceBase testscript;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; public Vector2 pos;</p><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; private void Start()<br />&nbsp; &nbsp; &nbsp; &nbsp; {</p><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;testscript.position = pos;</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Subscribe to the change location event.</p><br /><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (string.IsNullOrEmpty(googleAPIKey)) Debug.LogWarning(&quot;Please specify Google API Key&quot;);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Looking for a route between locations.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsGoogleDirections request = new OnlineMapsGoogleDirections(googleAPIKey, pos, new Vector2(83.316583f, 17.710500f));<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; request.OnComplete += OnComplete;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; request.Send();<br />&nbsp; &nbsp; &nbsp; &nbsp; }</p><br /><p>this is what i have wrote it was saying something wrong in log</p>]]></content>
			<author>
				<name><![CDATA[ashh21411]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1672</uri>
			</author>
			<updated>2021-07-12T12:54:04Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7584#p7584</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple gps navigator in the mobile application (Unity)]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7582#p7582" />
			<content type="html"><![CDATA[<p>Add Location Service component, use OnlineMapsLocationServiceBase.position to get GPS location, and use this location in request.<br /><a href="https://infinity-code.com/doxygen/online-maps/classOnlineMapsLocationServiceBase.html#a1ced3b12069bbb55866823444f547053">https://infinity-code.com/doxygen/onlin … 444f547053</a></p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2021-07-12T09:51:13Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7582#p7582</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple gps navigator in the mobile application (Unity)]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7581#p7581" />
			<content type="html"><![CDATA[<p>i was using move marker on route example script. </p><br /><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; private void Start()<br />&nbsp; &nbsp; &nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (string.IsNullOrEmpty(googleAPIKey)) Debug.LogWarning(&quot;Please specify Google API Key&quot;);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // Looking for a route between locations.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsGoogleDirections request = new OnlineMapsGoogleDirections(googleAPIKey, new Vector2(83.268809f, 17.655391f), new Vector2(83.316583f, 17.710500f));<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; request.OnComplete += OnComplete;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; request.Send();<br />&nbsp; &nbsp; &nbsp; &nbsp; }</p><br /><p>in this function <br />OnlineMapsGoogleDirections request = new OnlineMapsGoogleDirections(googleAPIKey, new Vector2(83.268809f, 17.655391f), new Vector2(83.316583f, 17.710500f));</p><p>i want to replace new vector2 coordinates with Gps location of user, how to get gps user location lat nd long co-ordinates and pass it on here.</p>]]></content>
			<author>
				<name><![CDATA[ash.go1411]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1674</uri>
			</author>
			<updated>2021-07-12T06:58:54Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7581#p7581</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple gps navigator in the mobile application (Unity)]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7578#p7578" />
			<content type="html"><![CDATA[<p>Example:<br /><a href="https://infinity-code.com/atlas/online-maps/pages/Marker_GPS_Example.html">https://infinity-code.com/atlas/online- … ample.html</a></p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2021-07-10T10:58:42Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7578#p7578</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple gps navigator in the mobile application (Unity)]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7576#p7576" />
			<content type="html"><![CDATA[<p>can from place can be replaced by user gps location? how to implement getting user location position dynamically via gps inside this script</p>]]></content>
			<author>
				<name><![CDATA[ashh21411]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1672</uri>
			</author>
			<updated>2021-07-09T13:46:53Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7576#p7576</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Simple gps navigator in the mobile application (Unity)]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7295#p7295" />
			<content type="html"><![CDATA[<p>Hello.</p><p>Something like this:<br /></p><div class="codebox"><pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

namespace InfinityCode.OnlineMapsExamples
{
    public class MoveMarkerOnRouteExample2 : MonoBehaviour
    {
        /// &lt;summary&gt;
        /// Start location name
        /// &lt;/summary&gt;
        public string fromPlace = &quot;Los Angeles&quot;;

        /// &lt;summary&gt;
        /// End location name
        /// &lt;/summary&gt;
        public string toPlace = &quot;Hollywood&quot;;

        /// &lt;summary&gt;
        /// Speed of movement (km/h).
        /// &lt;/summary&gt;
        public float speed = 60;

        /// &lt;summary&gt;
        /// Move map to marker position
        /// &lt;/summary&gt;
        public bool lookToMarker = false;

        /// &lt;summary&gt;
        /// Orient marker on next point.
        /// &lt;/summary&gt;
        public bool orientMarkerOnNextPoint = false;

        /// &lt;summary&gt;
        /// Reference to marker
        /// &lt;/summary&gt;
        private OnlineMapsMarker marker;

        /// &lt;summary&gt;
        /// Array of route points
        /// &lt;/summary&gt;
        private OnlineMapsVector2d[] points;

        /// &lt;summary&gt;
        /// Current point index
        /// &lt;/summary&gt;
        private int pointIndex = -1;

        /// &lt;summary&gt;
        /// Current step progress
        /// &lt;/summary&gt;
        private double progress;

        private List&lt;OnlineMapsVector2d&gt; linePoints;

        private void Start()
        {
            // Looking for a route between locations.
            OnlineMapsGoogleDirections request = OnlineMapsGoogleDirections.Find(new OnlineMapsGoogleDirections.Params(fromPlace, toPlace));
            request.OnComplete += OnComplete;
        }

        private void OnComplete(string response)
        {
            Debug.Log(&quot;OnComplete&quot;);

            OnlineMapsGoogleDirectionsResult result = OnlineMapsGoogleDirections.GetResult(response);
            if (result == null || result.routes.Length == 0)
            {
                Debug.Log(&quot;Something wrong&quot;);
                Debug.Log(response);
                return;
            }

            OnlineMapsGoogleDirectionsResult.Route firstRoute = result.routes[0];
            List&lt;OnlineMapsGoogleDirectionsResult.Step&gt; steps = firstRoute.legs.SelectMany(l =&gt; l.steps).ToList();

            // Create a new marker in first point.
            marker = OnlineMapsMarkerManager.CreateItem(steps[0].start_location, &quot;Car&quot;);

            // Gets points of route.
            points = steps.SelectMany(s =&gt; s.polylineD).ToArray();

            // Create a list of points that will be drawn and that will change when following a route
            linePoints = points.ToList();

            // Draw the route.
            OnlineMapsDrawingLine route = new OnlineMapsDrawingLine(linePoints, Color.red, 3);
            OnlineMapsDrawingElementManager.AddItem(route);

            pointIndex = 0;
        }

        private void Update()
        {
            if (pointIndex == -1) return;

            // Start point
            OnlineMapsVector2d p1 = points[pointIndex];

            // End point
            OnlineMapsVector2d p2 = points[pointIndex + 1];

            // Total step distance
            double dx, dy;
            OnlineMapsUtils.DistanceBetweenPoints(p1.x, p1.y, p2.x, p2.y, out dx, out dy);
            double stepDistance = Math.Sqrt(dx * dx + dy * dy);

            // Total step time
            double totalTime = stepDistance / speed * 3600;

            // Current step progress
            progress += Time.deltaTime / totalTime;

            OnlineMapsVector2d position;

            if (progress &lt; 1)
            {
                position = OnlineMapsVector2d.Lerp(p1, p2, progress);
                marker.SetPosition(position.x, position.y);

                // Updating the first point of the drawn line
                linePoints[0] = position;

                // Orient marker
                if (orientMarkerOnNextPoint) marker.rotation = 1.25f - OnlineMapsUtils.Angle2D((Vector2)p1, (Vector2)p2) / 360f;
            }
            else
            {
                position = p2;
                marker.SetPosition(position.x, position.y);

                // Remove the first point of the drawn line
                linePoints.RemoveAt(0);
                pointIndex++;
                progress = 0;
                if (pointIndex &gt;= points.Length - 1)
                {
                    Debug.Log(&quot;Finish&quot;);
                    pointIndex = -1;
                }
                else
                {
                    // Orient marker
                    if (orientMarkerOnNextPoint) marker.rotation = 1.25f - OnlineMapsUtils.Angle2D(p2, points[pointIndex + 1]) / 360;
                }
            }

            if (lookToMarker) OnlineMaps.instance.SetPosition(position.x, position.y);
            OnlineMaps.instance.Redraw();
        }
    }
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2021-03-23T09:03:53Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7295#p7295</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Simple gps navigator in the mobile application (Unity)]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=7288#p7288" />
			<content type="html"><![CDATA[<p>Good day. I would like to create a Gps navigator for a mobile application with a route starting from a point of a certain location to the end point of the created markers and so that as the user moves, the paved line is erased as the route traveled (as in the Google maps application). Is it possible to do this with OnlineMaps? What is the best way to implement this? Thanks. While slowly studying the asset.</p>]]></content>
			<author>
				<name><![CDATA[cilkamib]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1572</uri>
			</author>
			<updated>2021-03-22T19:30:09Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=7288#p7288</id>
		</entry>
</feed>
