Topic: 3D Marker Clustering

Hello,

I am looking to introduce clustering on my 3D markers. I am using the 3DMarkerManager to handle the 3D markers. I found this post from a couple of years ago which has a sample script for clustering...

http://forum.infinity-code.com/viewtopic.php?id=377

Is this the best available solution for clustering in Online Maps? Is it still useable with the latest versions? If so, I a have attached it to my map GameObject and once the markers have been added I am calling Clustering3DMarkers.UpdatePositions();

I have attached a Group Prefab.

However, I am not getting any clustering behaviour happening, my markers are not visible and there are no errors in the console.

Any advice or input would be amazing.

Much thanks,

Sam

Re: 3D Marker Clustering

Hello.

I adapted Clustering3DMarkers for Online Maps v3.
The updated script is attached.

The usage example is the same as for Online Maps v2.
http://forum.infinity-code.com/viewtopi … 1911#p1911

Post's attachments

Attachment icon Clustering3DMarkers.cs 21.17 kb, 103 downloads since 2021-05-14 

Kind Regards,
Infinity Code Team.

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

3 (edited by sambrick 2019-05-16 09:28:55)

Re: 3D Marker Clustering

Thanks so much Alex! I really appreciate it.

My markers are currently being created using the OnlineMapsMarker3DManager....

ChargeRecord[] records = APILoader.Instance.CarChargingResponse.records;

        foreach (ChargeRecord record in records)
        {
            // Assign prefab a unique ID
            carChargingPrefab.name = record.recordid;

            // Extract coordinates
            double[] coordinates = record.geometry.coordinates;
            Vector2 location = new Vector2((float)coordinates[0], (float)coordinates[1]);

            // Pass prefab + location to OnlineMaps
            OnlineMapsMarker3D marker = OnlineMapsMarker3DManager.CreateItem(location, carChargingPrefab);
            marker["record"] = record;
            
            // Init marker tool tips
            markerToolTip.OnDataLoaded(marker);
        }

I swapped this out to work similarly to the TestClustering.cs script you provided in the linked thread and it seems to work pretty well..... however, markers and cluster prefabs disappear and reappear in quite a glitchy way if you zoom and pan the map. Specifically when you zoom to a new level, some of the clusters might disappear but if you pan around a bit they might come back. There are no console errors (apart from switching a legacy method DestroyImmediate out to Destroy - which I did) I know it is hard to say but do you know what might be happening here?

Thanks,

Sam

Re: 3D Marker Clustering

Please send a video showing the problem.
Or send your scene as a package to us for testing (support@infinity-code.com).

Kind Regards,
Infinity Code Team.

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

Re: 3D Marker Clustering

Thanks Alex... am up against a super tight deadline so am not sure I will be able to implement clustering yet.... will post here if I do. Thanks again.

Re: 3D Marker Clustering

Alex Vertax wrote:

Hello.

I adapted Clustering3DMarkers for Online Maps v3.
The updated script is attached.

The usage example is the same as for Online Maps v2.
http://forum.infinity-code.com/viewtopi … 1911#p1911

Hello, is this script the last version ?

My 3D makers disappear if I zoom in or out, the Group Prefab is not displayed and when I zoom out my markers don't show again.

With OLMaps 3.7.11.1

Best regards
Phil

Re: 3D Marker Clustering

Yes, this is the latest version of the script.
I just tested this again and did not see any problems with zoom in and out.

Kind Regards,
Infinity Code Team.

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

Re: 3D Marker Clustering

OK thanks I will try harder...

Best regards
Phil