This is a migrated thread and some comments may be shown as answers.

Clustering of moving map markers

10 Answers 51 Views
Map
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 22 Sep 2015, 09:31 PM

Hi

I am wondering if it is possible to use the clustering features available in RadMap to be able to group moving map markers?

For example 1) Two vehicles driving next to each other along a road show as a moving cluster

For example 2) Two vehicles driving towards each other on a road, cluster when close to each other, then separate when they have passed each other

 

In both examples, can the cluster(s) be recalculated when marker locations change so that the cluster marker moves / de-clusters as appropriate?

 

I understand that the clustering features work great with static markers (like in the 'airports' example) and I understand that clusters can be regenerated on a map zoom but I cannot see a way to regenerate, move and possibly break-up a cluster on a marker location change.

 

Am I missing something obvious?

 

Thanks

 

 

10 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 25 Sep 2015, 02:49 PM
Hi David,

The clustering is updated also when you change the Location of the items. Which means that if the clustering feature is adjusted properly when two or more items overlap one another they should be clustered automatically. For your convenience I prepared a sample project demonstrating such set up. Please give it a try and let me know if it works for you.

Regards,
Martin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Peter
Top achievements
Rank 1
Veteran
answered on 21 Nov 2019, 05:27 PM

Hi Martin,

I'm implementing clustering so I downloaded the sample app you attached (all I've done is replace the references with the no-xaml telerik dlls we are using). When I click the buttons the items seem to randomly disappear from the map? It looks like the map doesn't refresh correctly. I've attached my version of the sample (renamed as png).

What am I doing wrong?

Thanks

Pete

0
Peter
Top achievements
Rank 1
Veteran
answered on 21 Nov 2019, 06:07 PM
Update to my last post: It seems to be dependant on the zoom level. when I first run the app and click the buttons the markers seem to disappear on alternative clicks of the same button. When I zoom in one level and operate the button, the operation is correct.
0
Martin Ivanov
Telerik team
answered on 22 Nov 2019, 02:03 PM

Hello Peter,

It seems that this is an issue with the clustering feature of RadMap. I've logged it in our feedback portal where you can track its status. I also updated your Telerik points.

To work this around, you can reset the clustering when a shape's Location is updated.

private void Button_Click(object sender, RoutedEventArgs e)
{
	this.marker1.Location = new Location(this.marker1.Location.Latitude, this.marker1.Location.Longitude - 1);
	this.marker2.Location = new Location(this.marker2.Location.Latitude, this.marker2.Location.Longitude + 1);
	this.layer.ClusteringEnabled = false;
	this.layer.ClusteringEnabled = true;
}

Regards,
Martin Ivanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Peter
Top achievements
Rank 1
Veteran
answered on 22 Nov 2019, 03:12 PM

Hi Martin,

Thanks for responding so quickly. I'm glad to hear that it's a bug and will be fixed at some point. Please note however that in our application it is affecting any item type in the layer (not just map shapes)

Unfortunately your workaround may not work well for me. We have many layers on our map and the object with changing location does know which layer it is on. Furthermore the workaround affects all objects on that layer (there may be hundreds of affected objects). 

Thanks
Pete

0
Martin Ivanov
Telerik team
answered on 27 Nov 2019, 01:06 PM

Hello Pete,

I am afraid that at this point, this is the only workaround that I can suggest. We will further investigate the issue and try to fix it on our side as soon as possible, but we cannot bound to a timeframe for this. Stay tuned by following the feedback item in the portal.

Regards,
Martin Ivanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Peter
Top achievements
Rank 1
Veteran
answered on 02 Dec 2019, 02:11 PM

Hi Martin,

I added the two lines you suggested to the button click event of the sample. Although it seems to work for a bit, I can click the button sometimes and it generates a NullReferenceException which crashes the application. Please see attached image.

0
Martin Ivanov
Telerik team
answered on 05 Dec 2019, 11:42 AM

Hello Pete,

You are right. There is an error with this workaround. However, I am afraid that currently, there is no alternative solution that I can provide. What I can suggest you is to follow the feedback item and test the fix when it is available.

Regards,
Martin Ivanov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Peter
Top achievements
Rank 1
Veteran
answered on 21 Jan 2021, 07:15 AM

Hi Martin,

I posted a comment on the linked issue in your feedback portal. Not sure if comments on completed tickets get looked at so I'm reposting my question here: 

Can you please confirm what the resolution of this item was? Is the problem fixed in Release LIB 2020.1.210 (2/10/2020). Does this mean that the workaround is no longer required? 

Thanks,

Pete

0
Martin Ivanov
Telerik team
answered on 21 Jan 2021, 01:40 PM

Hello Pete,

I already replied in the feedback portal. Yes, this is fixed and you should not need the workaround anymore.

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Map
Asked by
David
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Peter
Top achievements
Rank 1
Veteran
Share this question
or