<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Infinity Code Forum — How to modify a certain group 2D of markers?]]></title>
	<link rel="self" href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=670&amp;type=atom" />
	<updated>2017-10-05T18:20:45Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.infinity-code.com/viewtopic.php?id=670</id>
		<entry>
			<title type="html"><![CDATA[Re: How to modify a certain group 2D of markers?]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2894#p2894" />
			<content type="html"><![CDATA[<p>The first example for markers with a tag.<br />The second example for markers with information in customData.</p><p>1. Example:<br /></p><div class="codebox"><pre><code>OnlineMapsMarker marker = OnlineMaps.instance.AddMarker(lng, lat);
marker.tags.Add(&quot;mytag&quot;);</code></pre></div><p>2. OnlineMapsMarkerBase.enabled.<br />Example:<br /></p><div class="codebox"><pre><code>OnlineMapsMarker marker = OnlineMaps.instance.AddMarker(lng, lat);
marker.enabled = false;</code></pre></div><p>3. If you want to remove the markers that have the specified tag, use OnlineMaps.RemoveMarkersByTag.<br />You have direct access to the array of markers, so you can implement the rule of removing markers of any complexity.</p>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-10-05T18:20:45Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2894#p2894</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to modify a certain group 2D of markers?]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2893#p2893" />
			<content type="html"><![CDATA[<p>Thank you, Alex Vertax, for very interesting examples...<br />Talking about the LINQ example - this way we can iterate through the array of markers and &quot;do something&quot; with markers with a specific tag, right?</p><p>1) How can I assign a tag to a marker (probably we should somehow do it during its creation via OnlineMaps.AddMarker)?<br />2) Is there a way to &quot;disable&quot; and &quot;enable&quot; 2D markers? Or we should remove/create them instead?<br />3)How can I pass the markers (which I can select using the LINQ example) to the OnlineMaps.RemoveMarker() function in order to remove them?</p><p>Thank you!</p>]]></content>
			<author>
				<name><![CDATA[Rumata]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=537</uri>
			</author>
			<updated>2017-10-05T18:03:37Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2893#p2893</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[Re: How to modify a certain group 2D of markers?]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2882#p2882" />
			<content type="html"><![CDATA[<p>Hello.</p><p>You can use OnlineMapsMarkerBase.tags or OnlineMapsMarkerBase.customData to store the group ID (or other information that you need to define a marker group).<br />You have direct access to the array of markers, so you can easily make a selection, for example (LINQ):<br /></p><div class="codebox"><pre><code>foreach (OnlineMapsMarker marker in OnlineMaps.instance.markers.Where(m =&gt; m.tags.Contains(&quot;mytag&quot;)))
{
    // do something
}</code></pre></div><p>or<br /></p><div class="codebox"><pre><code>string groupID = &quot;mygroup&quot;;
var markers = OnlineMaps.instance.markers.Where(delegate(OnlineMapsMarker marker)
{
    // It does not matter what CData class is here. 
    // You can store any object in customData.
    CData data = marker.customData as CData;
    return data != null &amp;&amp; data.group == groupID;
});
foreach (OnlineMapsMarker marker in markers)
{
    // do something
}</code></pre></div>]]></content>
			<author>
				<name><![CDATA[Alex Vertax]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=2</uri>
			</author>
			<updated>2017-10-02T23:28:18Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2882#p2882</id>
		</entry>
		<entry>
			<title type="html"><![CDATA[How to modify a certain group 2D of markers?]]></title>
			<link rel="alternate" href="https://forum.infinity-code.com/viewtopic.php?pid=2879#p2879" />
			<content type="html"><![CDATA[<p>Hello,</p><p>Is there a way to display/hide/modify(change color) of a certain group of 2D markers and not all of them?</p><p>Is it possible to do this with 2D markers created through the inspector, or in this case markers should be created through the code?</p><p>I think as an option I could create the markers via the script and add a specific tag to them in order to manipulate them later. <br />Is there another way designed for Online Maps?</p><p>Thank you!</p>]]></content>
			<author>
				<name><![CDATA[Rumata]]></name>
				<uri>https://forum.infinity-code.com/profile.php?id=537</uri>
			</author>
			<updated>2017-10-02T21:26:53Z</updated>
			<id>https://forum.infinity-code.com/viewtopic.php?pid=2879#p2879</id>
		</entry>
</feed>
