<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Draw Line from GPX]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=279&amp;type=atom" />
	<updated>2016-09-22T08:24:57Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=279</id>
		<entry>
			<title type="html"><![CDATA[Re: Draw Line from GPX]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=1287#p1287" />
			<content type="html"><![CDATA[<p>Wow, excellent thanks :-)</p>]]></content>
			<author>
				<name><![CDATA[nigel.moore]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=51</uri>
			</author>
			<updated>2016-09-22T08:24:57Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=1287#p1287</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Draw Line from GPX]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=1283#p1283" />
			<content type="html"><![CDATA[<p>Hello.</p><p>We have implemented this feature, and the next update (v2.5.0.8 beta, will be available this week through the built-in update system) will contain it.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2016-09-21T19:17:50Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=1283#p1283</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Draw Line from GPX]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=1278#p1278" />
			<content type="html"><![CDATA[<p>Thanks for the reply. It would be really really great if this functionality could be implemented <img src="https://forum.infinity-code.com/img/smilies/smile.png" width="15" height="15" alt="smile" /></p>]]></content>
			<author>
				<name><![CDATA[nigel.moore]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=51</uri>
			</author>
			<updated>2016-09-21T08:29:38Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=1278#p1278</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Draw Line from GPX]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=1262#p1262" />
			<content type="html"><![CDATA[<p>Hello.</p><p>In the current version - no, the line has not HitTest method, and all events and tooltips will be ignored.<br />If you really need events for the line, we can try to implement it.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2016-09-15T12:48:36Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=1262#p1262</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Draw Line from GPX]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=1261#p1261" />
			<content type="html"><![CDATA[<p>Thanks Alex, sorted it now :-)</p><p>I am trying to capture user interaction (clicks initially) along the line that&#039;s being drawn and get some information back such as name of line and location along the path - is this possible? Also I can&#039;t seem to implement a tooltip for a line either, is this also possible?</p><p>Thanks</p>]]></content>
			<author>
				<name><![CDATA[nigel.moore]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=51</uri>
			</author>
			<updated>2016-09-15T12:38:53Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=1261#p1261</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Draw Line from GPX]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=1254#p1254" />
			<content type="html"><![CDATA[<p>Hello.</p><p>segment.points - is List &lt;OnlineMapsGPXObject.Waypoint&gt;.<br />OnlineMapsDrawingLine uses IEnumerable, where elements is Vector2, float or double.</p><p>The correct way:<br /></p><div class="codebox"><pre><code>OnlineMaps.instance.AddDrawingElement(new OnlineMapsDrawingLine(segment.points.Select(p =&gt; new Vector2((float)p.lon, (float)p.lat)), Color.red));</code></pre></div><p>or<br /></p><div class="codebox"><pre><code>OnlineMaps.instance.AddDrawingElement(new OnlineMapsDrawingLine(segment.points.SelectMany(p =&gt; new [] {p.lon, p.lat}), Color.red));</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2016-09-14T12:36:08Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=1254#p1254</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Draw Line from GPX]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=1253#p1253" />
			<content type="html"><![CDATA[<p>Ok, so found out what was going on so thought I&#039;d post here in case its of use to anyone else -- The points in the GPX file are stored as {lat,long} but the list of Vectors required for OnlineMapsDrawingLine need to be {long,lat} ;-)</p>]]></content>
			<author>
				<name><![CDATA[nigel.moore]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=51</uri>
			</author>
			<updated>2016-09-14T11:40:12Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=1253#p1253</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Draw Line from GPX]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=1252#p1252" />
			<content type="html"><![CDATA[<p>Hi Alex,</p><p>Am having trouble drawing a line on a tileset map from points in a GPX file. File is parsed fine, I pass the </p><div class="codebox"><pre><code>OnlineMapsGPXObject.TrackSegment.points</code></pre></div><p> into </p><div class="codebox"><pre><code>OnlineMapsDrawingLine</code></pre></div><p> and I even get a </p><div class="codebox"><pre><code>true</code></pre></div><p> returned for </p><div class="codebox"><pre><code>path.visible</code></pre></div><p> but there remains no line drawn across the tileset? Here&#039;s the code I&#039;m using ...</p><div class="codebox"><pre><code>if(File.Exists(pathToGPX))
        {
            // Load data from file into string
            string data = File.ReadAllText(pathToGPX, Encoding.UTF8);

            // Attempt to load data as GPX object
            gpx = OnlineMapsGPXObject.Load(data);

            foreach(OnlineMapsGPXObject.Track route in gpx.tracks)
            {
                Debug.LogFormat(&quot;Bike Track - {0}&quot;,route.name);
                foreach(OnlineMapsGPXObject.TrackSegment segment in route.segments)
                {
                    Debug.LogFormat(&quot;Route {0}, points {1}&quot;,route.name,segment.points.ToString());

                    for(int i=0; i&lt;segment.points.Count;i++) Debug.LogFormat(&quot;Waypoint - {0},{1}&quot;,segment.points[i].lat, segment.points[i].lon);

                    OnlineMapsDrawingLine path = new OnlineMapsDrawingLine(segment.points, Color.red);

                    api.AddDrawingElement(path);
//                    api.Redraw();

                    Debug.Log(&quot;path is visible?? &quot;+path.visible);
                }</code></pre></div><p>Am I missing something really obvious / stupid??&nbsp; Help please ;-)</p>]]></content>
			<author>
				<name><![CDATA[nigel.moore]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=51</uri>
			</author>
			<updated>2016-09-14T11:22:20Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=1252#p1252</id>
		</entry>
</feed>
