<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — Multi  polygon can't Draw]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1494&amp;type=atom" />
	<updated>2020-04-21T21:30:28Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=1494</id>
		<entry>
			<title type="html"><![CDATA[Re: Multi  polygon can't Draw]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6162#p6162" />
			<content type="html"><![CDATA[<p>Thanks thanks thanks alot<br />problem solve</p>]]></content>
			<author>
				<name><![CDATA[al_afani]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1263</uri>
			</author>
			<updated>2020-04-21T21:30:28Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6162#p6162</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Multi  polygon can't Draw]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6160#p6160" />
			<content type="html"><![CDATA[<p>Just create a new list for each polygon, or convert the list to an array:<br /></p><div class="codebox"><pre><code>polygon = new OnlineMapsDrawingPoly(Polygon_LatLong.ToArray(), Color.blue, 2, new Color(1, 1, 1, 0.3f));</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2020-04-21T19:40:43Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6160#p6160</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Multi  polygon can't Draw]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6159#p6159" />
			<content type="html"><![CDATA[<p>Thanks for replay</p><p>I have&nbsp; got your point ,but I need more clearance<br />your main should be make&nbsp; every polygon&nbsp; one array like this </p><p>&nbsp; &nbsp; public OnlineMaps map;&nbsp; //<br />&nbsp; &nbsp; public Texture2D markerTexture;<br />&nbsp; &nbsp; public List&lt;OnlineMapsMarker&gt; markers = new List&lt;OnlineMapsMarker&gt;();//<br />&nbsp; &nbsp; public OnlineMapsDrawingPoly polygon;//<br />&nbsp; &nbsp; public List&lt;OnlineMapsDrawingPoly&gt; Polygon_S = new List&lt;OnlineMapsDrawingPoly&gt;();</p><p>&nbsp; &nbsp; public List&lt;Vector2&gt; Polygon_LatLong;<br />&nbsp; &nbsp; public List&lt;Vector2&gt; Polygon_LatLong2;</p><p>&nbsp; &nbsp; &nbsp; &nbsp;Polygon_LatLong.Add(new Vector2(58.23256f, 23.59701f));<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong.Add(new Vector2(58.23246f, 23.59685f));<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong.Add(new Vector2(58.23221f, 23.59699f));<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong.Add(new Vector2(58.23231f, 23.59715f));</p><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; OnlineMaps api = OnlineMaps.instance;<br />&nbsp; &nbsp; &nbsp; &nbsp; polygon = new OnlineMapsDrawingPoly(Polygon_LatLong, Color.blue, 2, new Color(1, 1, 1, 0.3f));<br />&nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsDrawingElementManager.AddItem(polygon);</p><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong2.Clear();<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong2.Add(new Vector2(58.2326f, 23.59728f));<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong2.Add(new Vector2(58.2326f, 23.59707f));<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong2.Add(new Vector2(58.23256f, 23.59701f));<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong2.Add(new Vector2(58.23231f, 23.59715f));<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong2.Add(new Vector2(58.23231f, 23.59728f));</p><p>&nbsp; &nbsp; &nbsp; &nbsp; polygon = new OnlineMapsDrawingPoly(Polygon_LatLong2, Color.red, 2, new Color(1, 1, 1, 0.3f));<br />&nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsDrawingElementManager.AddItem(polygon);</p><br /><br /><p>but if&nbsp; I have 1000&nbsp; polygons how to deal with that<br />I try make&nbsp; list in list but only draw only one Polygon</p>]]></content>
			<author>
				<name><![CDATA[al_afani]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1263</uri>
			</author>
			<updated>2020-04-21T18:29:10Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6159#p6159</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: Multi  polygon can't Draw]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6158#p6158" />
			<content type="html"><![CDATA[<p>Hello.</p><p>The polygon and line store reference to original IEnumerable (in this case, the list) that you passed them.<br />You reuse the list, so you have two polygon with the same points, because both polygons refer to the same list.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2020-04-21T16:56:35Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6158#p6158</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Multi  polygon can't Draw]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=6157#p6157" />
			<content type="html"><![CDATA[<p>I am using Unity application&nbsp; &nbsp;I try to Draw multi polygon&nbsp; but only&nbsp; show last poly in array<br /> This is my code </p><br /><p>using System.Collections;<br />using System.Collections.Generic;<br />using UnityEngine;</p><p>public class MPolygon : MonoBehaviour<br />{</p><p>&nbsp; &nbsp; public OnlineMaps map;&nbsp; //<br />&nbsp; &nbsp; public Texture2D markerTexture;<br />&nbsp; &nbsp; public List&lt;OnlineMapsMarker&gt; markers = new List&lt;OnlineMapsMarker&gt;();//<br />&nbsp; &nbsp; public OnlineMapsDrawingPoly polygon;//<br />&nbsp; &nbsp; public List&lt;OnlineMapsDrawingPoly&gt; Polygon_S = new List&lt;OnlineMapsDrawingPoly&gt;();</p><p>&nbsp; &nbsp; public List&lt;Vector2&gt; Polygon_LatLong;</p><p>&nbsp; &nbsp; // Start is called before the first frame update<br />&nbsp; &nbsp; void Start()<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp;<br />&nbsp; &nbsp; &nbsp; &nbsp; Vector2 cursorCoords;<br />&nbsp; &nbsp; &nbsp; &nbsp; // Frist Poly<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong.Clear();<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong.Add(new Vector2(58.23256f, 23.59701f));<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong.Add(new Vector2(58.23246f, 23.59685f));<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong.Add(new Vector2(58.23221f, 23.59699f));<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong.Add(new Vector2(58.23231f, 23.59715f));</p><p>&nbsp; &nbsp; &nbsp; &nbsp; polygon = new OnlineMapsDrawingPoly(Polygon_LatLong, Color.blue, 2, new Color(1, 1, 1, 0.3f));<br />&nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsDrawingElementManager.AddItem(polygon);<br />&nbsp; &nbsp; &nbsp; &nbsp; //Polygon_S.Add(polygon);<br />&nbsp; &nbsp; &nbsp; &nbsp; //OnlineMapsDrawingElementManager.AddItems(Polygon_S);</p><p>&nbsp; &nbsp; &nbsp; &nbsp; ///&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;&#039;<br />&nbsp; &nbsp; &nbsp; &nbsp; ///Second Poly<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong.Clear();<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong.Add(new Vector2(58.2326f, 23.59728f));<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong.Add(new Vector2(58.2326f, 23.59707f));<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong.Add(new Vector2(58.23256f, 23.59701f));<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong.Add(new Vector2(58.23231f, 23.59715f));<br />&nbsp; &nbsp; &nbsp; &nbsp; Polygon_LatLong.Add(new Vector2(58.23231f, 23.59728f));</p><p>&nbsp; &nbsp; &nbsp; &nbsp; polygon = new OnlineMapsDrawingPoly(Polygon_LatLong, Color.red, 2, new Color(1, 1, 1, 0.3f));<br />&nbsp; &nbsp; &nbsp; &nbsp; OnlineMapsDrawingElementManager.AddItem(polygon);<br />&nbsp; &nbsp; &nbsp; &nbsp; //Polygon_S.Add(polygon);<br />&nbsp; &nbsp; &nbsp; &nbsp;// //OnlineMapsDrawingElementManager.AddItems(Polygon_S);</p><br /><br /><p>&nbsp; &nbsp; &nbsp; &nbsp; Vector2 center = new Vector2(58.2326f, 23.59728f);<br />&nbsp; &nbsp; &nbsp; &nbsp; int zoom = 10;<br />&nbsp; &nbsp; &nbsp; &nbsp; OnlineMaps.instance.position = center;<br />&nbsp; &nbsp; &nbsp; &nbsp; OnlineMaps.instance.zoom = zoom;<br />&nbsp; &nbsp; }</p><br /><p>My code is file attched</p><p>Please I need help Guys</p>]]></content>
			<author>
				<name><![CDATA[al_afani]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=1263</uri>
			</author>
			<updated>2020-04-21T16:22:14Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=6157#p6157</id>
		</entry>
</feed>
