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

MappEllipseViews don't appear until end of zoom

6 Answers 54 Views
Map
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 19 Jan 2017, 05:05 PM

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

6 Answers, 1 is accepted

Sort by
0
Petar Mladenov
Telerik team
answered on 24 Jan 2017, 12:07 PM
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.
0
Chris
Top achievements
Rank 1
answered on 17 Feb 2017, 04:40 PM

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).

0
Chris
Top achievements
Rank 1
answered on 17 Feb 2017, 04:48 PM
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.
0
Chris
Top achievements
Rank 1
answered on 17 Feb 2017, 05:13 PM
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
0
Chris
Top achievements
Rank 1
answered on 17 Feb 2017, 05:29 PM
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.
0
Petar Mladenov
Telerik team
answered on 21 Feb 2017, 10:07 AM
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.
Tags
Map
Asked by
Chris
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Chris
Top achievements
Rank 1
Share this question
or