MappEllipseViews don't appear until end of zoom

7 posts, 0 answers
  1. Chris
    Chris avatar
    7 posts
    Member since:
    Dec 2015

    Posted 19 Jan Link to this post

    Hello,

    I have a VisualizationLayer bound to a collection of objects. I've defined a MapEllipseView for (some of) the objects in the collection via an ItemTemplateSelector.
    The issue I have is that when I add items to the collection the ellipses are only rendered on the map at the completion of a zoom animation.

    How can I get them to appear straight away after they are added in the collection?

    Thanks,
    Chris

  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2928 posts

    Posted 24 Jan Link to this post

    Hi Chris,

    We tried to replicate your scenario. Please find an isolation where you can add viewmodels on a button click. VisualizationLayer is bound to collection of objects and based on the object type, the selector selects MapEllipseView-based template or MapPathView-based one. You can zoom with mouse and use Enter key (if the focus is on the button) to refresh the models. We didn't notice the ellipses waiting for zoom animation finished in order to render. 
    Is it possible for you to change the application in a way the behavior you describe is reproducible ?

    Regards,
    Petar Mladenov
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
  3. Chris
    Chris avatar
    7 posts
    Member since:
    Dec 2015

    Posted 17 Feb in reply to Petar Mladenov Link to this post

    Hi Petar,

    Thanks for looking into this. I downloaded your project, ran it without making any modifications and was presented with a map with no ellipses on. I then zoomed one step on my mouse's scroll wheel and several ellipses appeared, which is exactly the bug I am experiencing. I'm running this using VS 2015 on Windows 10 Pro and I've installed the latest version of Telerik (2017 R1).

  4. Chris
    Chris avatar
    7 posts
    Member since:
    Dec 2015

    Posted 17 Feb in reply to Chris Link to this post

    My apologies, I was using the wrong solution. Rather than the one you provided I think I was using the MapEllipseView example that's provided with the RadMap documentation; however, that solution recreates my exact problem so maybe you could see what behaviour you see with that project? I'm just trying to run the project you attached but I'm getting an InvalidOperationException.
  5. Chris
    Chris avatar
    7 posts
    Member since:
    Dec 2015

    Posted 17 Feb Link to this post

    The InvalidOperationException only happens randomly when launching the application, so it looks like there's a race condition somewhere. When it does run the ellipses do appear correctly, so I can look into what your example is doing differently and hopefully solve my problem. I can't actually remember where I downloaded the other project from that does have the bug. It's a much simpler version of your project with a hard-coded list of ten airports and two flights
  6. Chris
    Chris avatar
    7 posts
    Member since:
    Dec 2015

    Posted 17 Feb in reply to Chris Link to this post

    I've recreated the issue in the project you attached. If I change the width and height to bind to a Degrees property of the EllipseModel, which I randomly assign when it gets created, then *most* of the ellipses do not appear. Ellipses with negative coordinates, i.e., south of the equator and west of the Greenwich Meridian always appear, and all others don't appear until after a zoom.
  7. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2928 posts

    Posted 21 Feb Link to this post

    Hello Chris,

    Thank you for your details. This appears to be a regression issue we have introduced in R2 2016. We logged it in our feedback portal where you can track its status.

    If applicable in your scenario, you can try using and modifying EllipseData objects in code instead of databinding and MapEllipseViews. For example creating shape data objects on code behind would look like:

    for (int i = 0; i < 10; i++)
             {
                 EllipseData data = new EllipseData();
                 data.Width = 10;
                 data.Height = 20;
                 data.Location = new Location(r.Next(0, 40), r.Next(0, 60));
                 this.vislayer.Items.Add(data);
             }


    Regards,
    Petar Mladenov
    Telerik by Progress
    Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Back to Top