First of all , Hello !
Im using maps and i have question about clustering. Currently im manipulating with 1000 objects and displaying them on my map and clustering them( of course).
But on zoom level 7 i have arround 100 clusters. How can i set that on zoom level 7 i have maybe 5 clusters . Or can you give me idea or example where you are setting different condition for clusters
in attachment is picture on zoomLevel=7 and clusters
10 Answers, 1 is accepted
VisualizationLayer has IClusterGenerator instance member which is responsible for the clustering behavior. It has predefined distances for all zoom levels which participate in the calculations whether item belongs to cluster or not. To change this predefined list of distances you can use the following code:
I have pasted the default numbers used internally.
To better understand the cluster calculations , I will paste the CloseDistance property and IsItemInClusterRegion method of the DefaultClusterGenerator class:
In future, we will aim at describing this generator in our documentation.
can you maybe send example of implementing it so i can see it on example ?
Please find the attached project in which I have changed the clustering distance for level 3:
In the result picture you will notice the difference. Increasing the cluster distance means objects go into cluster easier and the number of total clusters decrease.
I hope this will help you move forward.
i see the point.
But i have one problem
I need to put zoom level really high (<15) so my zoom level (1-15) will work
<telerik:RadMap x:Name="radMap" Grid.Row="1" ZoomLevel="10">
if i put zoom level=1 Clustering close distance WONT work . iF i put zoomLevel=15 Clustering close distance will work
If i delete zoomLevel and put it by default Clustering CloseDistance also doesnt work
really weird .
Maybe Bug ??
In the attached project, default close distance for zoom level 1 is 20. If you increase it to 200, you will notice there will be single cluster on zoomlevel 1. If you decrease it to 0.02 there will be practically no clusters. You can see the results in the attached pictures. Could you please elaborate a bit more on your scenario and why zoomlevel 1 is problematic. Can you send us some real data (locations) and clsuter distances that we can debug locally and double check for an issue in RadMap's internal code. Thank you in advance.
In the attached project, default close distance for zoom level 1 is 20. If you increase it to 200, you will notice there will be single cluster on zoomlevel 1. If you decrease it to 0.02 there will be practically no clusters. You can see the results in the attached pictures. Could you please elaborate a bit more on your scenario and why zoomlevel 1 is problematic. Can you send us some real data (locations) and cluster distances that we can debug locally and double check for an issue in RadMap's internal code. Thank you in advance.
I think you didnt understand me.
i attached pictures of 2 scenario.
1 scenario when i put grid zoom level=15 and then i zoom out and see clustering okay.
2 scenario: if i put grid zoom level=1 then clustering is not working .. also if i delete grid zoom level clustering doesnt work .
We understand that by some reason clustering feature does not create clusters in your scenario for initial zoom level 1. Can you send us you RadMap code - its XAML and code behind and some of your locations displayed on the map. Probably this will help us better investigate and give an appropriate advice for your business case. Meanwhile, you can take a quick look at the following list of properties for configuring the cluster generation:
RadMap VisualizationLayer clustering
Can you double check if you use the default values of these properties ?
link to download 2 files because i canot post rar or zip inside reply
The file is missing (error 404).
What I could suggest in order to prevent sharing your project publicly is to open a new support ticket from your telerik.com account.