<?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 — Multiple 3D Marker Lat/Long Set]]></title>
		<link>https://forum.infinity-code.com/viewtopic.php?id=791</link>
		<atom:link href="https://forum.infinity-code.com/extern.php?action=feed&amp;tid=791&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Multiple 3D Marker Lat/Long Set.]]></description>
		<lastBuildDate>Mon, 02 Apr 2018 23:03:38 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Multiple 3D Marker Lat/Long Set]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3514#p3514</link>
			<description><![CDATA[<p>It&#039;s alright I ended up finding a solution to my issue, i simply assigned the captured values manually to the marker prefab before instantiation/adding to control, so this way i get the specific info for each marker created. So dummy 1 values (active image, id, etc.) and dummy 2 values (active image, id, etc.) set properly on the custom script.</p><p>Afterwards I clear the set values when the scene resets/stops/etc.</p><div class="codebox"><pre><code>                    
                    OnlineMapsControlBase3D control = OnlineMapsControlBase3D.instance;

                if (locationMarker == null) locationMarker = new Dictionary&lt;string, OnlineMapsMarker3D&gt;();

                    for (int i = 0; i &lt; CombuManager.localUser.pendingRequests.Length; ++i) {
                        
                        User userReSe = (User)CombuManager.localUser.pendingRequests[i];
                        
                        string markerID = userReSe.userName;
                        
                        string userID = userReSe.id;
                        
                        string actImg = userReSe.customData[&quot;ActiveImage&quot;].ToString();

                        float lat = float.Parse(userReSe.customData[&quot;latitude&quot;].ToString());
                        float lng = float.Parse(userReSe.customData[&quot;longitude&quot;].ToString());

                        OnlineMapsMarker3D marker;
    
                    if (locationMarker.TryGetValue(markerID, out marker)) {
                        
                        marker.SetPosition(lng, lat);
                        
                    } else {
                        
                        markerPrefab.GetComponent&lt;MapMakerHandler&gt;().userName = markerID;
                        markerPrefab.GetComponent&lt;MapMakerHandler&gt;().userID = userID;
                        markerPrefab.GetComponent&lt;MapMakerHandler&gt;().activeImage = actImg;
                        
                        locationMarker.Add(markerID, control.AddMarker3D(lng, lat, markerPrefab));
                        
            }

                Debug.Log(&quot;Friend Requests Sent = &quot; + CombuManager.localUser.pendingRequests[i].userName);

            }

            Debug.Log(&quot;Friend Requests Sent = &quot; + CombuManager.localUser.pendingRequests.Length);


    //resets custom markerPrefab values after scene ends/resets
    void OnDestroy() {
     
        markerPrefab.GetComponent&lt;MapMakerHandler&gt;().userID = &quot;&quot;;
        markerPrefab.GetComponent&lt;MapMakerHandler&gt;().userName = &quot;&quot;;
        markerPrefab.GetComponent&lt;MapMakerHandler&gt;().activeImage = &quot;&quot;;
        
    }</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (dizzymediainc)]]></author>
			<pubDate>Mon, 02 Apr 2018 23:03:38 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3514#p3514</guid>
		</item>
		<item>
			<title><![CDATA[Re: Multiple 3D Marker Lat/Long Set]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3510#p3510</link>
			<description><![CDATA[<p>I&#039;m sorry if my answer seemed rude to you.<br />I never even tried to rude to you or anyone else.<br />I never wrote that you or someone else is stupid.</p><p>Perhaps the problem is that you did not correctly formulate your question (in fact, your post 7 did not contain the question at all).<br />What I see in the 7th post:<br />- Two pieces of code. <br />The first is most likely called when the server responds. <br />When called the second is absolutely not clear.<br />- A short description about problems with ID.<br />- Suggestion to implement something like in the third piece of code.<br />And this suggestion confuses me.<br />Really. This generates a million questions, for example:<br />1. Why this should be there?<br />2. Why do you need to create markers when loading profile pic?<br />3. Where should this be, because you do not create markers in the second script?</p><p>I&#039;ve been developing assets and providing support for many years, and have almost telepathic abilities by reading the description the problem.<br />Unfortunately, in your case this does not work.</p><p>Let&#039;s try to start from the beginning.<br />You explain in detail what and why you want to do.<br />I explain to you how to do this.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Mon, 02 Apr 2018 19:13:45 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3510#p3510</guid>
		</item>
		<item>
			<title><![CDATA[Re: Multiple 3D Marker Lat/Long Set]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3509#p3509</link>
			<description><![CDATA[<p>I lock it on purpose as if I don&#039;t, it grabs all the ID&#039;s and only displays the very last one, so that would be obvious if tested.</p><p>Sorry but you didn&#039;t answer my question and your response in short, is very rude and not helpful in any way.</p><p>What I expect is courteous customer support for a product you have for sale, this is common sense and as with any company or individual that provides customer service, patience and actual willingness to help solve the issue, is ideal.</p><p>Unfortunately I have met way too many asset developers who act the way you have been, which is that I should know how your system works right off the bat and if I don&#039;t and i&#039;m doing something in a way you wouldn&#039;t, i&#039;m stupid? lol that&#039;s how you present yourself and like i said, it&#039;s rude.</p><p>Thanks for your time anyways, even if it didn&#039;t assist in any way.</p>]]></description>
			<author><![CDATA[null@example.com (dizzymediainc)]]></author>
			<pubDate>Mon, 02 Apr 2018 17:24:24 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3509#p3509</guid>
		</item>
		<item>
			<title><![CDATA[Re: Multiple 3D Marker Lat/Long Set]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3504#p3504</link>
			<description><![CDATA[<p>Please read the first two lines of my previous post.<br />I directly pointed out to you why your script works only for the first ID.</p><p>In your scripts, only two methods are related to the map: AddMarker3D and SetPosition.<br />Do you have problems with these methods?! No, because you are asking about something else.</p><p>Everything else is just your scripts in which you are trying to implement the required behavior.<br />But it has no relation to the map.</p><p>It&#039;s not hard for me to look at your code and say what&#039;s wrong. And I did it.<br />In addition, I showed you the problems in your code that you did not ask about, just because I see them.<br />But I really do not understand what you want / expect more.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Fri, 30 Mar 2018 13:06:58 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3504#p3504</guid>
		</item>
		<item>
			<title><![CDATA[Re: Multiple 3D Marker Lat/Long Set]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3501#p3501</link>
			<description><![CDATA[<p>Like I said any suggestions would be great, acting like I understand every aspect of your system is not that helpful heh</p><p>As I am new to your system and still learning how it works, plus combining it with another system, i&#039;ll be going about things in various ways to make both work together.</p><p>So any suggestions in the right direction is definitely more ideal than telling me it doesn&#039;t make sense <img src="https://forum.infinity-code.com/img/smilies/tongue.png" width="15" height="15" alt="tongue" /></p><p>Yes as I mentioned I considered using TryGetValue but was unsure how to utilize it in my current situation, again, direction in the proper way to utilize this function would be ideal.</p><p>Thanks.</p>]]></description>
			<author><![CDATA[null@example.com (dizzymediainc)]]></author>
			<pubDate>Fri, 30 Mar 2018 01:32:01 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3501#p3501</guid>
		</item>
		<item>
			<title><![CDATA[Re: Multiple 3D Marker Lat/Long Set]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3500#p3500</link>
			<description><![CDATA[<p>You only get 25 because you use &quot;locked&quot;.<br />After the first iteration your code is blocked.</p><p>Also, why do you need to check the ID of each marker in the second script, if you can just use TryGetValue?!</p><div class="codebox"><pre><code>foreach(var key in MapMarkerHandler.instance.locationMarker)</code></pre></div><p>Maybe I&#039;m wrong, but you do not use key.Value.<br />You already have the key (markerID), so this loop does not make sense.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Thu, 29 Mar 2018 22:19:15 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3500#p3500</guid>
		</item>
		<item>
			<title><![CDATA[Re: Multiple 3D Marker Lat/Long Set]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3497#p3497</link>
			<description><![CDATA[<p>Alright well after some more tinkering i got it working:</p><div class="codebox"><pre><code>                    OnlineMapsControlBase3D control = OnlineMapsControlBase3D.instance;

                if (locationMarker == null) locationMarker = new Dictionary&lt;string, OnlineMapsMarker3D&gt;();

                    for (int i = 0; i &lt; CombuManager.localUser.pendingRequests.Length; ++i) {
                        
                        User userReSe = (User)CombuManager.localUser.pendingRequests[i];
                        
                        string markerID = userReSe.id;

                        float lat = float.Parse(userReSe.customData[&quot;latitude&quot;].ToString());
                        float lng = float.Parse(userReSe.customData[&quot;longitude&quot;].ToString());

                        OnlineMapsMarker3D marker;
    
                    if (locationMarker.TryGetValue(markerID, out marker)) {
                        
                        marker.SetPosition(lng, lat);
                        
                    } else {
                        
                        locationMarker.Add(markerID, control.AddMarker3D(lng, lat, markerPrefab));
                        
            }

                Debug.Log(&quot;Friend Requests Sent = &quot; + CombuManager.localUser.pendingRequests[i].userName);

            }</code></pre></div><p>Currently my issue is accessing the specific info based on the key name, in this instance i&#039;m using the id number of the user account, I tried the username but found that I was unable to access the ID number afterwords.</p><p>In this case the ID numbers are 25 and 33 but it seems to only return 25, I can load the profile pic but i&#039;d like to load the info based on the marker clicked on, which should coincide with the key name. Currently I grab the username, profile pic, etc. but only of ID 25.</p><br /><div class="codebox"><pre><code>    public void LoadMapProfPic(){
        
        OnlineMapsMarker3D marker;
        
        FilePathUrlInfo fileInfo = currentImage.GetComponent&lt;FilePathUrlInfo&gt;();
        
            //if pending requests is 0
            if(CombuManager.localUser.pendingRequests.Length == 0){
             
                Debug.Log(&quot;NO pendingRequests&quot;);
                
            } else {
                
               //update request sent int based on pending requests length
                CombuDemo.instance.requestSentGalInt = CombuManager.localUser.pendingRequests.Length;
                
                if the request sent list is empty, create a new list
                if(CombuDemo.instance.requestsSentList.Count == 0){
                    
                    //mapFileList = new List&lt;UserFile&gt;();
                    CombuDemo.instance.requestsSentList = new List&lt;UserFile&gt; ();
                }
                
                
                
            for (int i = 0; i &lt; CombuManager.localUser.pendingRequests.Length; ++i) {
                
                User userReSe = (User)CombuManager.localUser.pendingRequests[i];
                
                string markerID = userReSe.id;
                
                string actImage = &quot;&quot; + userReSe.customData[&quot;ActiveImage&quot;];
                
                if(!locked){
                


                    foreach(var key in MapMarkerHandler.instance.locationMarker){
                        
                        if (key.Key.Equals(markerID)){

                           //set username text
                            currentMapHandler.GetComponent&lt;MapMakerHandler&gt;().userNameText.text = key.Key;
                            
                            //load files based on key name
                            UserFile.Load (key.Key, false, 1, 6, (UserFile [] files, int recordCount, int pageCount, string error) =&gt; {
        
                                foreach (var file in files) {
        
                                    if (file.name == actImage) {
                                        
                                        if(CombuDemo.instance.requestsSentList.Count == 0){
                                        
                                            //add to request sent list
                                            CombuDemo.instance.requestsSentList.Add(file);
                                            Debug.Log(&quot;key.Key added to requestSentList&quot;);
                                        
                                            //load profile image
                                            fileInfo.LoadFilePathUrl(file);
                                            Debug.Log(&quot;load key.Key file&quot;);
                                            
                                        } else {
                                            
                                       //on re-check if file does not equal one that is already present, load a new file
                                        for (int r = 0; r &lt; CombuDemo.instance.requestsSentList.Count; ++r) {
                                            
                                            if(file.name != CombuDemo.instance.requestsSentList[r].name){
                                        
                                                CombuDemo.instance.requestsSentList.Add(file);
                                                Debug.Log(&quot;key.Key new added to requestSentList&quot;);
                                        
                                                fileInfo.LoadFilePathUrl(file);
                                                Debug.Log(&quot;load key.Key new file&quot;);
                                            }
                                                
                                        }
                                        }
                                        
                                    }
                                }
                            });

                            }
                        
                        }
                    
                
                locked = true;
                    
                }
            }
                
        }
    }</code></pre></div><p>i&#039;ve considered doing it the same way as you suggested for the marker set setup but am unsure what to replace for the marker set or create fields in order to get my desired effect.</p><div class="codebox"><pre><code>                    if (locationMarker.TryGetValue(markerID, out marker)) {
                        
                        marker.SetPosition(lng, lat);
                        
                    } else {
                        
                        locationMarker.Add(markerID, control.AddMarker3D(lng, lat, markerPrefab));
                        
            }</code></pre></div><br /><p>Any thoughts on this would be helpful, thanks!</p>]]></description>
			<author><![CDATA[null@example.com (dizzymediainc)]]></author>
			<pubDate>Wed, 28 Mar 2018 22:29:20 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3497#p3497</guid>
		</item>
		<item>
			<title><![CDATA[Re: Multiple 3D Marker Lat/Long Set]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3449#p3449</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>Yea I kind of figured that, that&#039;s why i added the manual lock.</p></blockquote></div><p>It does not work that way.<br />Of course it&#039;s not my business at all how you write your application.<br />But you showed me this code, and I see that this will not work.<br />I explained to you why this will not work, and showed the correct (theoretically) way.</p><div class="quotebox"><blockquote><p>Sure that makes sense although as i asked, what is it referencing to? As i see in your example code it doesn&#039;t show, so how would i create the base for this value and what is it assigned to? (float, int, string, etc.)</p></blockquote></div><p>This is just some variable that stores the user ID.<br />The type of this variable depends on how you store it in your database.<br />Usually this is an int or string.</p><div class="quotebox"><blockquote><p>Ok but that doesn&#039;t answer my question, is the way you have it actually grabbing the multiple values from the multiple users? As far as i see, it&#039;s singular and only grabbing one, therefore it would only assign that one set of floats to both users.</p></blockquote></div><p>I do not even know how to answer this.<br />Read something about local variables.<br />Or just add Debug.Log and check what these variables contain.</p><div class="quotebox"><blockquote><p>I did and you completely removed <br />foreach (var PendingRequests in CombuManager.localUser.pendingRequests)</p></blockquote></div><div class="codebox"><pre><code>for (int i = 0; i &lt; CombuManager.localUser.pendingRequests.Length; ++i)
{
    User userReSe = (User)CombuManager.localUser.pendingRequests[i];</code></pre></div><p>This is the same in 98% of the cases.<br />There are two cases where this is wrong:<br />1. If pendingRequests only implements IEnumerable.<br />2. If pendingRequests has some kind of very-very special indexer. I&#039;ve never seen this, but theoretically it&#039;s possible.<br />You already use it in such a way in the first loop, so this is not one of these two cases.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 28 Feb 2018 21:16:15 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3449#p3449</guid>
		</item>
		<item>
			<title><![CDATA[Re: Multiple 3D Marker Lat/Long Set]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3448#p3448</link>
			<description><![CDATA[<div class="quotebox"><cite>Alex Vertax wrote:</cite><blockquote><div class="quotebox"><blockquote><p>It does not matter when to set the position.</p></blockquote></div></blockquote></div><p>No, it matters when and where i grab the info from the pending friend requests</p><div class="quotebox"><blockquote><p>This creates 8 values, because longFloats contains 2 values, latFloats contains 2 values, and pendingRequests also contains 2 values. 2 * 2 * 2 = 8</p></blockquote></div><p>Yea I kind of figured that, that&#039;s why i added the manual lock.</p><div class="quotebox"><blockquote><p>You plan to only create markers, or update their position in the future.<br />If you plan to update the positions, how do you know which marker to update?<br />To do this, use some ID.</p></blockquote></div><p>Sure that makes sense although as i asked, what is it referencing to? As i see in your example code it doesn&#039;t show, so how would i create the base for this value and what is it assigned to? (float, int, string, etc.)</p><div class="quotebox"><blockquote><p>These are absolutely useless lists.</p></blockquote></div><p>Ok but that doesn&#039;t answer my question, is the way you have it actually grabbing the multiple values from the multiple users? As far as i see, it&#039;s singular and only grabbing one, therefore it would only assign that one set of floats to both users.</p><div class="quotebox"><blockquote><p>Look closely at the code.</p></blockquote></div><p>I did and you completely removed </p><p>foreach (var PendingRequests in CombuManager.localUser.pendingRequests){ </p><p>}</p><br /><p>This is there specifically to generate the proper amount of makers based on the amount of pending requests, so without it, it&#039;s merely generating one unless the example code you provided is somehow, finding out how many users are in pending requests and then instantiating them based on that value.</p>]]></description>
			<author><![CDATA[null@example.com (dizzymediainc)]]></author>
			<pubDate>Wed, 28 Feb 2018 20:23:35 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3448#p3448</guid>
		</item>
		<item>
			<title><![CDATA[Re: Multiple 3D Marker Lat/Long Set]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3447#p3447</link>
			<description><![CDATA[<div class="quotebox"><blockquote><p>Actually I have to call LoadFriends to get the pending friend requests data (being customData) BEFORE updating the positions or else, setting the marker position won&#039;t work properly unless it&#039;s set to 0,0 and then adjusted after marker creation, I found no good way to do this.</p></blockquote></div><p>It does not matter when to set the position.</p><div class="quotebox"><blockquote><p>If I don&#039;t block the position creation, it duplicates and creates 8 instead of 2, currently it creates 2 (which is what I want) but sets the values for both from the item 0 in the long/lat list.</p></blockquote></div><p>It is important not only the number of values, but also the values that you use.<br />This creates 8 values, because longFloats contains 2 values, latFloats contains 2 values, and pendingRequests also contains 2 values.<br />2 * 2 * 2 = 8.</p><p>Also, keep in mind that when you get the next response, you will have 40 markers, instead of the expected 4 markers.<br />4 * 4 * 2 + 8 = 40</p><div class="quotebox"><blockquote><p>I haven&#039;t tested this yet, will test it in a bit but looking it over I am confused at to what markerID is and where it came from or what to reference it to. Thoughts?</p></blockquote></div><p>You plan to only create markers, or update their position in the future.<br />If you plan to update the positions, how do you know which marker to update?<br />To do this, use some ID.<br />I do not know how this field is called in your class.<br />But in the correct structure of the application you are determined to have something like that.</p><div class="quotebox"><blockquote><p>Also why is lat/long floats singular?</p></blockquote></div><p>These are absolutely useless lists.<br />This makes some sense only for debugging purposes.<br />But in fact, there are better ways to debug the application.</p><div class="quotebox"><blockquote><p>What was the reason you decided to remove it in the suggested code?</p></blockquote></div><p>Look closely at the code.<br />It still uses CombuManager.localUser.pendingRequests.</p>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 28 Feb 2018 18:19:31 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3447#p3447</guid>
		</item>
		<item>
			<title><![CDATA[Re: Multiple 3D Marker Lat/Long Set]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3446#p3446</link>
			<description><![CDATA[<p>1. As far as I understand, the anonymous method from LoadFriends should be called when updating the position of friends. But you only create new markers, and do not update existing ones.</p><br /><p>Actually I have to call LoadFriends to get the pending friend requests data (being customData) BEFORE updating the positions or else, setting the marker position won&#039;t work properly unless it&#039;s set to 0,0 and then adjusted after marker creation, I found no good way to do this.</p><br /><p>3. In the second loop, where you create a list of items, you have errors in logic:<br />3.1. You add a lot of positions only from the values of longFloats[0] and latFloats[0].<br />3.2. Then you block the addition of positions using markerPosLock, and all next iterations do not work.</p><br /><p>3.1 The entire post is based around this section, it returns values from item 0 in the list and not both 0 and 1<br />3.2 If I don&#039;t block the position creation, it duplicates and creates 8 instead of 2, currently it creates 2 (which is what I want) but sets the values for both from the item 0 in the long/lat list.</p><br /><p>3.3. Even if you&#039;ll remove markerPosLock, this will work incorrectly, because you will first add a lot of the values of longFloats [0] and latFloats [0], then a lot of the values of {0, 1}, etc.</p><p>Actually i&#039;ve thoroughly tested this and it does work somewhat if I remove the markerPosLock, being that it creates 8 instead of 2 values, for some reason when it creates 8 values the long/lat values are set properly (so out of 8 it goes : 0,1,0,1,0,1,0,1)</p><br /><p>SUGGESTED CODE:</p><p>I haven&#039;t tested this yet, will test it in a bit but looking it over I am confused at to what markerID is and where it came from or what to reference it to. Thoughts?</p><p>Also why is lat/long floats singular? I need a list of the values being that there will probably be more than one user friend request.</p><br /><p>EDITS:</p><p>Being that this is one of the critical parts of the code (as it generates the proper amount based on friend requests):</p><p>foreach (var PendingRequests in CombuManager.localUser.pendingRequests){ }</p><p>What was the reason you decided to remove it in the suggested code?</p>]]></description>
			<author><![CDATA[null@example.com (dizzymediainc)]]></author>
			<pubDate>Wed, 28 Feb 2018 17:05:59 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3446#p3446</guid>
		</item>
		<item>
			<title><![CDATA[Re: Multiple 3D Marker Lat/Long Set]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3445#p3445</link>
			<description><![CDATA[<p>Hello.</p><p>I see quite a lot of problems in your code:<br />1. As far as I understand, the anonymous method from LoadFriends should be called when updating the position of friends. But you only create new markers, and do not update existing ones.<br />2. Why do you need so many lists? This only makes sense for debugging purposes. But again, you just add the elements, and do not check the values in the lists.<br />3. In the second loop, where you create a list of items, you have errors in logic:<br />3.1. You add a lot of positions only from the values of longFloats[0] and latFloats[0].<br />3.2. Then you block the addition of positions using markerPosLock, and all next iterations do not work.<br />3.3. Even if you&#039;ll remove markerPosLock, this will work incorrectly, because you will first add a lot of the values of longFloats [0] and latFloats [0], then a lot of the values of {0, 1}, etc.<br />This is completely wrong.</p><p>Theoretically (because I can not test this), the correct way:<br /></p><div class="codebox"><pre><code>OnlineMapsControlBase3D control = OnlineMapsControlBase3D.instance;

if (locationMarkers == null) locationMarkers = new Dictionary&lt;string, OnlineMapsMarker3D&gt;();

for (int i = 0; i &lt; CombuManager.localUser.pendingRequests.Length; ++i)
{
    User userReSe = (User)CombuManager.localUser.pendingRequests[i];

    float lat = float.Parse(userReSe.customData[&quot;latitude&quot;].ToString());
    float lng = float.Parse(userReSe.customData[&quot;longitude&quot;].ToString());

    OnlineMapsMarker3D marker;
    if (locationMarkers.TryGetValue(userReSe.markerID, out marker))
    {
        marker.SetPosition(lng, lat);
    }
    else
    {
        locationMarkers.Add(userReSe.markerID, control.AddMarker3D(lng, lat, markerPrefab));
    }

    Debug.Log(&quot;Friend Requests Sent = &quot; + CombuManager.localUser.pendingRequests[i].userName);

}

Debug.Log(&quot;Friend Requests Sent = &quot; + CombuManager.localUser.pendingRequests.Length);</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (Alex Vertax)]]></author>
			<pubDate>Wed, 28 Feb 2018 12:55:52 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3445#p3445</guid>
		</item>
		<item>
			<title><![CDATA[Multiple 3D Marker Lat/Long Set]]></title>
			<link>https://forum.infinity-code.com/viewtopic.php?pid=3444#p3444</link>
			<description><![CDATA[<p>Hello,</p><p>I am attempting to set the lat and long for each marker created though the code based on the variables saved. Currently it seems to work for the most part except I can only grab the first lat/long and not the 2nd, so when it creates the markers, it only grabs the first long/lat values and not the second pair (out of 2) from the float lists upon creating the new Vector2 values (what i see is the list count is returning 1 less than the actual list count when i go for (int i; i = 0, etc.))</p><p>The system is grabbing values from a user on a database based on user requests received, then saves the values to floats which then creates new Vector2 values in a list, in turn those Vector2 values are used to set the lat/long of the markers new Vector2 lat/long on marker creation.</p><p>I&#039;ve tried various ways to get it all to work properly but haven&#039;t come to a good conclusion, i tried in the update function, separate functions or IEnumerators with small gaps in between list addition/variable grabs. </p><p>Any thoughts on how to get this to work would be great, thanks! (if not, perhaps a way of setting each markers long/lat after creation?)</p><p>Here&#039;s the code:</p><div class="codebox"><pre><code>    [FoldoutGroup(&quot;Bools&quot;)]
    public bool markerPosLock;
    
    [FoldoutGroup(&quot;Bools&quot;)]
    public bool markerLock;

    [FoldoutGroup(&quot;Floats&quot;)]
    public List&lt;float&gt; latFloats;
    
    [FoldoutGroup(&quot;Floats&quot;)]
    public List&lt;float&gt; longFloats;

    [FoldoutGroup(&quot;Vector2&quot;)]
    public List&lt;Vector2&gt; markerPosition;

    [FoldoutGroup(&quot;Marker&quot;)]
    public List&lt;OnlineMapsMarker3D&gt; locationMarker;

    [FoldoutGroup(&quot;Marker&quot;)]
    public GameObject markerPrefab;


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///                                                                                                                                                                                                                   
///     Load user friend requests sent                                                                            
///                                                                                                                                                                                                         
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    public void UserFriendRequestsSentLoad() {

    if(!friendRequestsSentLoaded) {
    
        //contactError.text = &quot;Loading...&quot;;
        CombuManager.localUser.LoadFriends(eContactType.PendingRequest, (bool success) =&gt; { 
             
    
            if (success) {
            
                Debug.Log(success);
                
                if (CombuManager.localUser.pendingRequests.Length == 0) {
                    
                    friendRequestsSentLoaded = true;

                    UserFriends();
                    Debug.Log(&quot;No Sent Friend Requests&quot;);
                
                } else {
                    
                    OnlineMapsControlBase3D control = OnlineMapsControlBase3D.instance;
  
                    locationMarker = new List&lt;OnlineMapsMarker3D&gt;();
                    
                
            for (int i = 0; i &lt; CombuManager.localUser.pendingRequests.Length; ++i) {

                    User userReSe = (User)CombuManager.localUser.pendingRequests[i];

                    latFloats.Add(float.Parse(userReSe.customData[&quot;latitude&quot;].ToString()));
                    longFloats.Add(float.Parse(userReSe.customData[&quot;longitude&quot;].ToString()));
                    
                Debug.Log(&quot;Friend Requests Sent = &quot; + CombuManager.localUser.pendingRequests[i].userName);
                     
                }
                    
                Debug.Log(&quot;Friend Requests Sent = &quot; + CombuManager.localUser.pendingRequests.Length);
                    
                    
            for (int f = 0; f &lt; longFloats.Count; ++f) {
                            
                for (int f2 = 0; f2 &lt; latFloats.Count; ++f2) {
                        
                    if(!markerPosLock){
                        
                        foreach (var PendingRequests in CombuManager.localUser.pendingRequests){
                            
                            markerPosition.Add(new Vector2(longFloats[f], latFloats[f2]));
                            
                        }
                        
                        markerPosLock = true;
                    }
                }
            }                

                    
            
            for (int m = 0; m &lt; markerPosition.Count; ++m) {
                        
                if(!markerLock){    
                    
                    foreach (var PendingRequests in CombuManager.localUser.pendingRequests){
                            
                            locationMarker.Add(control.AddMarker3D(markerPosition[m].x, markerPosition[m].y, markerPrefab));
                        
                        }
                    
                        markerLock = true;
                    }   
                }
                    
                    friendRequestsSentLoaded = true;
                    UserFriends();
                
               }
            
            } else {
            
                Debug.Log(&quot;Failed to load sent friend requests&quot;);
            }
        });
        
    //end friendRequestsGalLoaded    
    } else {
    
        Debug.Log(&quot;Friend Requests Already Loaded&quot;);
    }
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (dizzymediainc)]]></author>
			<pubDate>Wed, 28 Feb 2018 03:28:00 +0000</pubDate>
			<guid>https://forum.infinity-code.com/viewtopic.php?pid=3444#p3444</guid>
		</item>
	</channel>
</rss>
