<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — DrawingPoly Fill with Elevation]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=498&amp;type=atom" />
	<updated>2017-04-18T23:10:27Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=498</id>
		<entry>
			<title type="html"><![CDATA[Re: DrawingPoly Fill with Elevation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2247#p2247" />
			<content type="html"><![CDATA[<p>Thank you. We added additional checks for the arrays.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-04-18T23:10:27Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2247#p2247</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: DrawingPoly Fill with Elevation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2245#p2245" />
			<content type="html"><![CDATA[<p>Got the updated package from my counterpart, version 2.5.7.1 with the checkMapBoundaries variable.<br />Setting it to false throws a runtime error:</p><div class="quotebox"><blockquote><p>IndexOutOfRangeException: Array index is out of range.<br />OnlineMapsDrawingPoly.DrawOnTileset (.OnlineMapsTileSetControl control, Int32 index) (at Assets/Infinity Code/Online maps/Scripts/Drawing/OnlineMapsDrawingPoly.cs:275)<br />OnlineMapsTileSetControl.UpdateControl () (at Assets/Infinity Code/Online maps/Scripts/Controls/OnlineMapsTileSetControl.cs:1250)<br />OnlineMaps.CheckBufferComplete () (at Assets/Infinity Code/Online maps/Scripts/OnlineMaps.cs:876)<br />OnlineMaps.LateUpdate () (at Assets/Infinity Code/Online maps/Scripts/OnlineMaps.cs:1137)</p></blockquote></div><p>Appears that...<br />internalPoints is a size-one array and is having its only point removed.</p><p>I do initially set the polygon&#039;s points as an array of Vector2.zero, but they do get modified later.<br />Adding if (fillTriangles.Length == 0) return; fixes things.</p>]]></content>
			<author>
				<name><![CDATA[Draco18s]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=429</uri>
			</author>
			<updated>2017-04-18T14:40:39Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2245#p2245</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: DrawingPoly Fill with Elevation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2235#p2235" />
			<content type="html"><![CDATA[<p>I will see about doing that. I will need to talk with my team and insure that the update doesn&#039;t cause issues somewhere else.</p>]]></content>
			<author>
				<name><![CDATA[Draco18s]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=429</uri>
			</author>
			<updated>2017-04-14T13:55:53Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2235#p2235</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: DrawingPoly Fill with Elevation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2234#p2234" />
			<content type="html"><![CDATA[<p>Just update Online Maps using Unity Asset Store or the built-in update system.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-04-14T13:52:20Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2234#p2234</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: DrawingPoly Fill with Elevation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2230#p2230" />
			<content type="html"><![CDATA[<p>Right, but the version of Online Maps I have does not seem to have it.<br />Thanks though.</p>]]></content>
			<author>
				<name><![CDATA[Draco18s]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=429</uri>
			</author>
			<updated>2017-04-14T13:20:14Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2230#p2230</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: DrawingPoly Fill with Elevation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2226#p2226" />
			<content type="html"><![CDATA[<p>As I wrote earlier this way is not recommended for use.<br />Currently, the best way is drawElement.checkMapBoundaries = false.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-04-13T18:53:37Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2226#p2226</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: DrawingPoly Fill with Elevation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2223#p2223" />
			<content type="html"><![CDATA[<p>Holy cow, the performance on that is <em>awful</em>. Even a single 16-segment circle has noticable lag-behind time (just barely, but as this project is going to have multi-kilometer wide circles, I have the segments variable set up at 64 and the script execution time on that is 200ms!)</p>]]></content>
			<author>
				<name><![CDATA[Draco18s]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=429</uri>
			</author>
			<updated>2017-04-13T15:25:10Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2223#p2223</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: DrawingPoly Fill with Elevation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2222#p2222" />
			<content type="html"><![CDATA[<p>When using drawing as overlay, after you have changed your drawing elements, you need to invoke OnlineMapsDrawingElement.MarkChanged.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-04-13T15:10:22Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2222#p2222</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: DrawingPoly Fill with Elevation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2220#p2220" />
			<content type="html"><![CDATA[<p>OnlineMapsTilesetDrawingMode.overlay sorta works (I do not appear to be on 2.5.5.1, that field doesn&#039;t exist), except that when I move the marker around, the polygon that is anchored to it doesn&#039;t update when I drag the marker around, only when I zoom in and out.</p><p>This is being called from LateUpdate():</p><div class="codebox"><pre><code>private int lastZoom = -1;
    private void UpdateRadioLocations()
    {
        float step = 360f / SEGMENTS;
        double x, y;

        Vector2 distance = OnlineMapsUtils.DistanceBetweenPoints(OnlineMaps.instance.topLeftPosition, OnlineMaps.instance.bottomRightPosition);
        float convertToKm = 1;

        float scaleX = convertToKm / distance.x * OnlineMaps.instance.tilesetSize.x;
        float scaleY = convertToKm / distance.y * OnlineMaps.instance.tilesetSize.y;
        float scale = (scaleX + scaleY) / 2;

        foreach (RadioPlacement radio in radioList)
        {
            if (radio.marker.position != radio.lastPosition || lastZoom != zoom) //this check fails on marker drag
            {
                lastZoom = zoom;
                float r = radio.radius * 2 / OnlineMapsUtils.tileSize * scale;
                radio.lastPosition = radio.marker.position;
                radio.marker.GetPosition(out x, out y);
                OnlineMapsProjection projection = OnlineMaps.instance.projection;
                projection.CoordinatesToTile(x, y, OnlineMaps.instance.zoom, out x, out y);

                for (int i = 0; i &lt; SEGMENTS; i++)
                {
                    double px = x + Mathf.Cos(step * i * Mathf.Deg2Rad) * r;
                    double py = y + Mathf.Sin(step * i * Mathf.Deg2Rad) * r;

                    projection.TileToCoordinates(px, py, OnlineMaps.instance.zoom, out px, out py);

                    radio.points[i] = new Vector2((float)px, (float)py);
                }
                OnlineMaps.instance.Redraw();
            }
        }
    }</code></pre></div><p>There&#039;s no reason changing the drawing mode should cause the marker&#039;s position to not update properly.</p>]]></content>
			<author>
				<name><![CDATA[Draco18s]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=429</uri>
			</author>
			<updated>2017-04-13T15:04:58Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2220#p2220</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: DrawingPoly Fill with Elevation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2189#p2189" />
			<content type="html"><![CDATA[<p>Hello.</p><p>You have two ways to achieve this:<br />1. Available from Online Maps v2.5.5.1.<br />drawingElement.checkMapBoundaries = false<br />2. (Not recommended) Drawing as overlay.<br />OnlineMapsTileSetControl.drawingMode = OnlineMapsTilesetDrawingMode.overlay.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-04-12T22:12:54Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2189#p2189</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[DrawingPoly Fill with Elevation]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2180#p2180" />
			<content type="html"><![CDATA[<p>I&#039;ve been pulled into a project so I&#039;m not sure how much of the Online Maps code has been modified, however, in the code that I have, the draw-poly with fill has the code for the fill area commented out.</p><p>In poking around with it uncommented I noticed that the fill ignores elevation values, however the project I&#039;m working on requires both the fill AND elevation.</p><p>How can I achieve this?</p>]]></content>
			<author>
				<name><![CDATA[Draco18s]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=429</uri>
			</author>
			<updated>2017-04-12T15:23:43Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2180#p2180</id>
		</entry>
</feed>
