1 (edited by luke.carelsen 2016-04-01 22:07:05)

Topic: What is the total amount of markers that can be created?

Hey Peeps

I am currently working on an extremely interesting project. If everything goes well and our app is a success we expect over a million markers to be generated on our map. And i would like to know if ive gotten in over my head here. Could someone please explain to me how the markers are managed? Is a million even possible? is there a cap?

Any information would be appreciated, or maybe just point me in the right direction.

kind regards
Luke

Re: What is the total amount of markers that can be created?

Hello.

The total number of markers is not limited.
But with a million markers it will work VERY slow.

You need to make your own marker manager, and only use the markers that you really need right now.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: What is the total amount of markers that can be created?

Hey Alex

Thanks for getting back to me. i will have to test it and see what happens. thanks for your input. i will def make a manager if it fails during testing phase. will get back to you on the progress.

Kind Regards

4 (edited by luke.carelsen 2016-05-03 10:06:18)

Re: What is the total amount of markers that can be created?

Hey Alex.

so I finally got around to test it. and it seems that 10,000 markers is way way way to much.

So i was thinking how would we solve this problem? The only thing that came to mind was maybe clustering them, i don't know what do you think?

something like: For every maker in a specify area make a big marker, then remove them for the map and then according to zoom level generate them again?

I could really use your thoughts on this.

Thank you for your time.
Kind Regards

Re: What is the total amount of markers that can be created?

Hello.

There are many ways to use more markers.
Just for fun, I created a script that works with a million markers (attached).
I'm not saying that this is the best solution. It's just one of the ways.

Post's attachments

Attachment icon OneMillionMarkers.cs 2.77 kb, 182 downloads since 2016-05-04 

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: What is the total amount of markers that can be created?

Oh thank you so much. I'm quickly going to play with it and give you an update. really appreciate the support.

7 (edited by luke.carelsen 2016-05-04 12:36:05)

Re: What is the total amount of markers that can be created?

Hey Alex

I played around a bit. and the instal code didn't work but i think i managed to fix that with:

            float longitude = Random.Range(-180f, 180f);
            float latitude = Random.Range(-90f, 90f);

            Vector2 geoVect = new Vector2 (longitude, latitude);


            marker.position = geoVect;

So countMarkers = 1, 000, 000 and that doesn't work at all, unity bombs out. so i made it 10, 000, 00 and that seems to still draw all 10, 000, 00 markers.

or am i missing something?

Re: What is the total amount of markers that can be created?

1. What version of Online Maps are you using?
If you use Online Maps v2.3, then update to the latest beta version.
Online Maps v2.4 has a huge code optimization.

2. What control do you use?
I tested it using tileset.
For "drawing to texture" it will not work, because it will use a lot of memory.

3. At what zoom level you tested?
Of course when zoom level = 3, will work slowly.
But zoom level = 7+ work fast. I have a 60-80 fps, for zoom level = 7.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: What is the total amount of markers that can be created?

Hey Alex,

i was meaning to get around in changing it to tileset. my apologies, i will get back to you once I've tested it with the new settings. thanks for the info.

Re: What is the total amount of markers that can be created?

oh, how can i get the beta from you? must i pm my invoice number?

Re: What is the total amount of markers that can be created?

Component / Infinity Code / Online Maps / Check Updates

or

Online Maps Inspector / Help / Check Updates

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: What is the total amount of markers that can be created?

Alex Vertax wrote:

Component / Infinity Code / Online Maps / Check Updates

or

Online Maps Inspector / Help / Check Updates


ohhhh coooool. very cool!

thanks signing up right now.

13 (edited by luke.carelsen 2016-05-05 10:23:36)

Re: What is the total amount of markers that can be created?

sorry alex i just updated to the latest beta and when converting the uiimage/map from texture to tile set produces a umber of errors

NullReferenceException: Object reference not set to an instance of an object
OnlineMaps.GetMarkerFromScreen (Vector2 screenPosition) (at Assets/Infinity Code/Online maps/Scripts/OnlineMaps.cs:1087)
OnlineMaps.ShowMarkersTooltip (Vector2 screenPosition) (at Assets/Infinity Code/Online maps/Scripts/OnlineMaps.cs:1678)
OnlineMapsControlBase.Update () (at Assets/Infinity Code/Online maps/Scripts/Controls/OnlineMapsControlBase.cs:694)

Re: What is the total amount of markers that can be created?

You are using an incorrect control.
For "target - tileset" you need to use a tileset control.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: What is the total amount of markers that can be created?

sorry do you have a tutorial on how to set up a UIIImage with tileset because when adding the tiles controller nothing happens. I've connected the camera but i think its trying to access the renderer which a uiImage doesn't have. or is it only available for 3d maps?

Re: What is the total amount of markers that can be created?

No, it's two different modes. You can not combine it.

Tileset much faster and has many additional features.
«Drawing to texture» - is a universal mode. You can show the map anywhere (almost).

If you configure the scene and the camera, Tileset can look like UIImage.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: What is the total amount of markers that can be created?

ok cool, i thought i would have to go that approach if it is only in 3d. all good i will start working on the new solution. thanks for putting up with all my question.

kind regards

Re: What is the total amount of markers that can be created?

Yo Alex

Finally tested with your recommend settings and it works perfectly, except for one thing. when i change the count to another number except for 1 million, like 3. i receive the following errors:

ArgumentNullException: Argument cannot be null.
Parameter name: collection
System.Collections.Generic.List`1[OnlineMapsMarker].CheckCollection (IEnumerable`1 collection) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:435)
System.Collections.Generic.List`1[OnlineMapsMarker].AddRange (IEnumerable`1 collection) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:136)
OneMillionMarkers.UpdateMarkers () (at Assets/OneMillionMarkers.cs:86)
OneMillionMarkers.Start () (at Assets/OneMillionMarkers.cs:59)

The issue here is that we won't have a million markers right at the launch of our app. instead they will build up to a million. meaning as our app installs increase so will our marker count. How can we fix this?

could i also maybe ask for comments on the code as I'm finding it difficult to understand whats happening.

Kind Regards
Luke Carelsen

Re: What is the total amount of markers that can be created?

Hello.

Modify line 86:
if (markers[cx + y] != null) ms.AddRange(markers[cx + y]);

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.

Re: What is the total amount of markers that can be created?

Hey Alex

Thanks that did the trick.

still not entirely sure how it all works exactly but it works. thank you so much.

kind Regards

Re: What is the total amount of markers that can be created?

Hey Alex

The script works perfectly if one uses it with the old GUI label tooltip method. but for some reason trying to implement it with this method  uGUICustomTooltipOnClick.cs http://forum.infinity-code.com/viewtopic.php?id=122 I'm having major issues.

can you please assist?

Re: What is the total amount of markers that can be created?

sorry here is the code that generates the marker. its basically the replacement of the GenerateMarkers() function in the example given.

if (x.Status == AzureServicesForUnity.CallBackResult.Success)
{
    foreach (var userDataObj in x.Result.results)
    {
        //Debug.Log(string.Format("ID is {0},score is {1}", item.id, item.hwsh_user_popular ));
        marker = map.AddMarker(new Vector2(userDataObj.hwsh_user_loc_geox, userDataObj.hwsh_user_loc_geoy), null, userDataObj.fb_user_name);
        // Create new XML and store it in customData.
        OnlineMapsXML customXML = new OnlineMapsXML("MarkerData");
        customXML.Create("UserName", userDataObj.fb_user_name);
        customXML.Create("UserFBID", userDataObj.fb_user_id);
        customXML.Create("UserDBID", userDataObj.id);
        customXML.Create("PostID", userDataObj.fb_user_post_id);
        customXML.Create("UserPopularity", userDataObj.hwsh_user_popular);
        customXML.Create("UserRank", myRank);
        marker.customData = customXML;
        MakeToolTips();


        marker.Init();
        int my = (int) (( userDataObj.hwsh_user_loc_geoy + 90) / 10); ///lat
        int mx = (int) (( userDataObj.hwsh_user_loc_geox + 180) / 10); //long

        int index = mx * 18 + my;

        if (markers[index] == null) markers[index] = new List<OnlineMapsMarker>(32);
        else if (markers[index].Count == markers[index].Capacity) markers[index].Capacity += 32;
        markers[index].Add(marker);

        TotalX += 1;
        myRank += 1;
    }
    if (includeTotalCount)
    {
        Debug.Log(string.Format("Brought {0} rows out of {1}", TotalX, x.Result.count));
    }
    else
    {
        Debug.Log(string.Format("Brought {0} rows", x.Result.results.Count()));
    }
}

Re: What is the total amount of markers that can be created?

Hello.

It is very difficult to say what wrong using small piece of code, without any error messages, etc.
Please describe your problem in detail.
If possible, please send your project to support (support@infinity-code.com).
We will check this and give you advice how to fix it.

Kind Regards,
Infinity Code Team.

Boost your productivity a lot and immediately using Ultimate Editor Enhancer. Trial and non-commerce versions available.