Topic: 3D Marker Clustering


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...

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,


Re: 3D Marker Clustering


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

The usage example is the same as for Online Maps v2. … 1911#p1911

Post's attachments

Attachment icon Clustering3DMarkers.cs 21.19 kb, 4 downloads since 2019-05-16 

Kind Regards,
Infinity Code Team.

Do not know the best way to thank the developer? Rate the asset in Asset Store!

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
   = 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

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?



Re: 3D Marker Clustering

Please send a video showing the problem.
Or send your scene as a package to us for testing (

Kind Regards,
Infinity Code Team.

Do not know the best way to thank the developer? Rate the asset in Asset Store!

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.