Clustering help

James

I've switched from using the DynamicLayer to the VirtualizationLayer so I can cluster my map icons in an effort to increase performance. I'm currently at the stage with the VirtualizationLayer as I was with the DynamicLayer and am about to tackle the clustering. I've got custom UserControls which I use for map icons and by looking at this example (http://demos.telerik.com/silverlight/#Map/ClusterVirtualization) it seems to only provide an option to async load shape files? I've also noticed the example here which seems more in sync with what I want to achieve. Finally to my question - can the virtualizationlayer cluster my data for me or will I manually have to work out which of my map icons will be hidden in the same group?

Hope I've made it clear if not I can provide some clarification.

Thanks guys!

Petar Mladenov

I guess you mean Visualization Layer and not Virtualization Layer. With it you can use both async readers and manually adding items via code behind or data binding. You can check tha attached clustering sample in which the data is loaded in code behind and no asyn shapes readers are used.

The Visualization Layer automatically creates clusters depending on the zoom level, the locations of the items and several properties which are described in the Map Clustering Help Article. If you need anything additional / custom behavior, could you please describe it in details, this way we would be better able to advice you ? Thank you in advance for your cooperation.

Regards,
Petar Mladenov
Telerik

Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.

James

Thanks that example helped me a lot and it's pretty much working as intended at the moment. One thing additionally that I'd like to fix is after you set the ItemsSource to the map collection if there are any clusteres with only a single item in them they still show the clustered icon with a "1" on it (I've attached a screenshot). This is fixed when you zoom or click on it (it will swap to the actual map icon) but is there any way I can avoid clustering of singular items?

Petar Mladenov

It is strange that you experience such issue. What is your telerik assemblies version ? Are you reproducing it with our latest official binaries ? Are you able to reproduce it in the project I sent you here or in the Clustering SDK sample ? We can change this thread to "General Feedback" and you will be able to send us an isolated sample that we can investigate locally if needed.

Regards,
Petar Mladenov
Telerik

Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.

Petar Mladenov

Your version is old and we have released several official versions after it. Most probably you have hit an issue that is already fixed in our latest official binaries. Is it possible for you to try your project with our latest bits ?

Regards,
Petar Mladenov
Telerik

Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.

James

I'll get the new binaries today and try it out. Another thing I was wondering was if there was a way that I can access the cluster data from the visualization layer after a zoom event? What I want to do is color the clusters based on the count property.

Regards,

James

Petar Mladenov

The ClusterData object which has Count property is actually the DataContext of the Cluster and therefore it is also a DataContext of what you define in the ClusterTemplate. This means that you can bind the Color of the Cluster to the ClusterData with Converter, for example like so:

Parker

I am on the most recent version of Telerik controls (2014.2.729) and I'm having the same issue. Specifically I'm clustering my points on the map and I'm getting clusters of 1. If I zoom in or out they will reset to the item image that I want.

How do I make the map stop clustering single items?

Thanks

Petar Mladenov

We are unable to reproduce such issue as mentioned before. Is it possible for you to open a new support thread with an isolated project attached, which reproduces such issue. This will help us identify it and log it in our bug tracking system. Thank you in advance for your cooperation.

Regards,
Petar Mladenov
Telerik

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Petar Mladenov

Thank you for these details. They helped us reproduce the issue and we logged it as a bug in our feedback portal where you can track its status. We updated your telerik account points as a thanks for your cooperation.
As a workaround you can try expanding the clusters manually. For example like so:

this.VisualizationLayer1.Items.Add(pinpoint);

var cluster = this.VisualizationLayer1.GetClusterForItem(pinpoint);

if (cluster != null && cluster.Children.Count() == 1)

{

cluster.ClusterState = ClusterState.Expanded;

}

Let us know if this fits well in your scenario.

Regards,
Petar Mladenov
Telerik

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.