<?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 — Online Maps Marker Manager]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=915</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=915&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Online Maps Marker Manager.]]></description>
		<lastBuildDate>Mon, 26 Nov 2018 10:40:51 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Online Maps Marker Manager]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4302#p4302</link>
			<description><![CDATA[<p>I agree your solution is better after all, finally I did implemeneted it like you suggested, but at that point I didn&#039;t had time to spare on this marker issue and had to move on <img src="https://forum.infinity-code.com/img/smilies/smile.png" width="15" height="15" alt="smile" /> thanks for your help.</p>]]></description>
			<author><![CDATA[null@example.com (bartosz.wolski)]]></author>
			<pubDate>Mon, 26 Nov 2018 10:40:51 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4302#p4302</guid>
		</item>
		<item>
			<title><![CDATA[Re: Online Maps Marker Manager]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4049#p4049</link>
			<description><![CDATA[<p>Why not?</p><p>For example, how to make a central marker on top (without modification of the asset code):<br /></p><div class="codebox"><pre><code>using System.Collections.Generic;
using System.Linq;
using UnityEngine;

public class TilesetMarkerDepthExample2 : MonoBehaviour
{
    /// &lt;summary&gt;
    /// Defines a new comparer.
    /// &lt;/summary&gt;
    public class MarkerComparer : IComparer&lt;OnlineMapsMarker&gt;
    {
        public int Compare(OnlineMapsMarker m1, OnlineMapsMarker m2)
        {
            object m1f = m1[&quot;isFront&quot;];
            object m2f = m2[&quot;isFront&quot;];
            bool m1_front = m1f != null? (bool) m1f: false;
            bool m2_front = m2f != null? (bool) m2f: false;
            if (m1_front &amp;&amp; !m2_front) return 1;
            if (m2_front &amp;&amp; !m1_front) return -1;

            if (m1.position.y &gt; m2.position.y) return -1;
            if (m1.position.y &lt; m2.position.y) return 1;
            return 0;
        }
    }

    private void Start()
    {
        OnlineMaps map = OnlineMaps.instance;

        // Create markers.
        OnlineMapsMarkerManager.CreateItem(new Vector2(0, 0.01f));
        OnlineMapsMarker frontMarker = OnlineMapsMarkerManager.CreateItem(new Vector2(0, 0));
        frontMarker[&quot;isFront&quot;] = true;
        OnlineMapsMarkerManager.CreateItem(new Vector2(0, -0.01f));

        // Sets a new comparer.
        OnlineMapsMarkerFlatDrawer drawer = OnlineMapsTileSetControl.instance.markerDrawer as OnlineMapsMarkerFlatDrawer;
        if (drawer != null) drawer.markerComparer = new MarkerComparer();

        // Get the center point and zoom the best for all markers.
        Vector2 center;
        int zoom;
        OnlineMapsUtils.GetCenterPointAndZoom(OnlineMapsMarkerManager.instance.ToArray(), out center, out zoom);

        // Change the position and zoom of the map.
        map.position = center;
        map.zoom = zoom;
    }
}</code></pre></div><p>You will lose your changes when updating and you will need to do it again.<br />So I do not recommend making changes that will not included to the asset.<br />Follow this recommendation or not, everyone makes the decision himself.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 17 Oct 2018 13:52:13 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4049#p4049</guid>
		</item>
		<item>
			<title><![CDATA[Re: Online Maps Marker Manager]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4048#p4048</link>
			<description><![CDATA[<p>I am using beta, so well I wasn&#039;t able to use that code from example.</p><p>But I modified slightly the script in case anyone will need it so for beta version :</p><p>OnlineMapsMarkerFlatDrawer.cs :</p><p>around line (150) :</p><p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int extraValue = m.needToBeInFront ? 999 : 0;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; double mx, my;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; m.GetPosition(out mx, out my);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return 90 - my + extraValue;</p><br /><p>and on OnlineMapsMarker.cs :</p><p>add :</p><p>public bool needToBeInFront.</p><p>Thanks Alex for guiding me to this script thanks to that I was easly able to add my required modification.</p>]]></description>
			<author><![CDATA[null@example.com (bartosz.wolski)]]></author>
			<pubDate>Wed, 17 Oct 2018 11:56:53 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4048#p4048</guid>
		</item>
		<item>
			<title><![CDATA[Re: Online Maps Marker Manager]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4047#p4047</link>
			<description><![CDATA[<p>Thanks! <br />I thought its longitude but I am glad I was close enought to finding at least how they are drawn.</p><p>I will check that example out <img src="https://forum.infinity-code.com/img/smilies/smile.png" width="15" height="15" alt="smile" /> thank you in advance.</p>]]></description>
			<author><![CDATA[null@example.com (bartosz.wolski)]]></author>
			<pubDate>Wed, 17 Oct 2018 11:20:12 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4047#p4047</guid>
		</item>
		<item>
			<title><![CDATA[Re: Online Maps Marker Manager]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4046#p4046</link>
			<description><![CDATA[<p>Hello.</p><p>Online Maps draws markers not in the order in which they go in the inspector.<br />By default, markers are sorted by latitude.</p><p>Example of how to change the order of the markers is in:<br />Assets / Infinity Code / Online Maps / Examples (API usage) / TilesetMarkerDepthExample.cs.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 17 Oct 2018 10:52:49 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4046#p4046</guid>
		</item>
		<item>
			<title><![CDATA[Online Maps Marker Manager]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=4045#p4045</link>
			<description><![CDATA[<p>I am using onlineMaps newest beta version.</p><p>And I have problem when I have 2 markers close to each other.<br />I am changing &#039;active&#039; marker (since user can select one), and switching its texture but it appear behind other markers.</p><p>I made a code so that selected marker is removed and added again (to be at the end of childern in marker manager), but it doesn&#039;t change anything.</p><p>Then I noticed to change it so my marker will be last there are 2 solutions :</p><p>1) draw is as last element ( no idea how to do that except what I did).<br />2) change the &quot;Render Queue&quot; from 3000 to 3001 for example.</p><p>I am attaching 2 screenshots showing the situation</p><p>Maybe maps are redrawing markers by longitude? or something similar.</p><p>Is there any function in markerManagers or some script I could use to fix this issue?</p><p>Or am I forced to get that markersMesh as componenet, compare textures and if I see my texture used I will change renger queue each time? (I wish to avoid this since it seems like dirty hack, that might bring more problems in the future).</p>]]></description>
			<author><![CDATA[null@example.com (bartosz.wolski)]]></author>
			<pubDate>Wed, 17 Oct 2018 09:31:08 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=4045#p4045</guid>
		</item>
	</channel>
</rss>
