Clustering of moving map markers

9 posts, 0 answers
  1. David
    David avatar
    1 posts
    Member since:
    Aug 2015

    Posted 22 Sep 2015 Link to this post

    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

     

     

  2. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2420 posts

    Posted 25 Sep 2015 Link to this post

    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
  3. Peter
    Peter avatar
    64 posts
    Member since:
    Oct 2016

    Posted 21 Nov 2019 in reply to Martin Ivanov Link to this post

    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

  4. Peter
    Peter avatar
    64 posts
    Member since:
    Oct 2016

    Posted 21 Nov 2019 in reply to Peter Link to this post

    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.
  5. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2420 posts

    Posted 22 Nov 2019 Link to this post

    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.
  6. Peter
    Peter avatar
    64 posts
    Member since:
    Oct 2016

    Posted 22 Nov 2019 in reply to Martin Ivanov Link to this post

    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

  7. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2420 posts

    Posted 27 Nov 2019 Link to this post

    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.
  8. Peter
    Peter avatar
    64 posts
    Member since:
    Oct 2016

    Posted 02 Dec 2019 in reply to Martin Ivanov Link to this post

    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.

  9. Martin Ivanov
    Admin
    Martin Ivanov avatar
    2420 posts

    Posted 05 Dec 2019 Link to this post

    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.
Back to Top