<?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 — [SOLVED] Drawing a square from top left and bottom right coords?]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=1832</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=1832&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in [SOLVED] Drawing a square from top left and bottom right coords?.]]></description>
		<lastBuildDate>Mon, 13 Sep 2021 18:26:42 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: [SOLVED] Drawing a square from top left and bottom right coords?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=7692#p7692</link>
			<description><![CDATA[<p>I wasn&#039;t able to figure out how to use what you referenced for my need, but this was my solution:</p><div class="codebox"><pre><code>List&lt;Vector2&gt; squareCorners = new List&lt;Vector2&gt;();

//grab the 2 I know of
Vector2 NWcorner = new Vector2( (float)NW.longitude, (float)NW.latitude);
Vector2 SEcorner = new Vector2( (float)SE.longitude, (float)SE.latitude);

// now get the other 2
Vector2 NEcorner = new Vector2( Math.Max(NWcorner.x, SEcorner.x), Math.Max(NWcorner.y, SEcorner.y );
Vector2 SWcorner = new Vector2( Math.Min(NWcorner.x, SEcorner.x), Math.Min(NWcorner.y, SEcorner.y );

// add them all to the list
squareCorners.Add(NWcorner);
squareCorners.Add(NEcorner);
squareCorners.Add(SEcorner);
squareCorners.Add(SWcorner);

// create the poly
OnlineMapsDrawingPoly mySquare = new OnlineMapsDrawingPoly(squareCorners, Color.gree, 1.0f, Color.cyan);
// add it to the map
OnlineMapsDrawingElementManager.AddItem(mySquare);</code></pre></div><p>This does work.</p><p>Now I&#039;m on to making it clickable, which I think I can handle</p>]]></description>
			<author><![CDATA[null@example.com (mcb)]]></author>
			<pubDate>Mon, 13 Sep 2021 18:26:42 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=7692#p7692</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Drawing a square from top left and bottom right coords?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=7691#p7691</link>
			<description><![CDATA[<p>Thanks for the response.</p><p>Basically, I&#039;m going to draw a square and make it clickable, and allow the user to easily jump to this location.&nbsp; <br />There could be several of these squares drawn at once.</p><p>I have a simple 2d map that will serve as a context map of sorts, and it will have these &quot;buttons&quot; on it representing all of the important areas.</p><p>I&#039;m using data provided to me from a 3rd party and all they give are the TL and BR coords for each area.</p><p>A 2nd 3D map will display the zoomed in version of these selected areas</p>]]></description>
			<author><![CDATA[null@example.com (mcb)]]></author>
			<pubDate>Mon, 13 Sep 2021 15:09:34 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=7691#p7691</guid>
		</item>
		<item>
			<title><![CDATA[Re: [SOLVED] Drawing a square from top left and bottom right coords?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=7688#p7688</link>
			<description><![CDATA[<p>Hello.</p><p>There are many ways to do this for example OnlineMapsDrawingRect + OnlineMaps.GetCorners.<br /><a href="https://infinity-code.com/doxygen/online-maps/classOnlineMapsDrawingRect.html">https://infinity-code.com/doxygen/onlin … gRect.html</a><br /><a href="https://infinity-code.com/doxygen/online-maps/classOnlineMaps.html#acd05d23678cd37919b32b5d91edd9f1c">https://infinity-code.com/doxygen/onlin … d91edd9f1c</a></p><p>The best way depends a lot on what this square is for.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Sat, 11 Sep 2021 20:35:55 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=7688#p7688</guid>
		</item>
		<item>
			<title><![CDATA[[SOLVED] Drawing a square from top left and bottom right coords?]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=7684#p7684</link>
			<description><![CDATA[<p>I just wanted to see if there was a method I was missing, or maybe if you knew of a good way that I could draw a square on the map based on top left and bottom right coordinates?</p><p>I figured I could try to find the center point between them and draw a square, but then how do I figure out the scale so the square stops are the coordinates?</p><p>or maybe you have a better approach?</p><p>Thanks in advance</p>]]></description>
			<author><![CDATA[null@example.com (mcb)]]></author>
			<pubDate>Fri, 10 Sep 2021 17:53:53 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=7684#p7684</guid>
		</item>
	</channel>
</rss>
