Hello,I have add an ultraGeographicMap control to our form.It appears to cause slowness and hanging of our application.
This hanging happens either when loading a new position into the map and centering on it, or when zooming in or out.
Is there anything that can be done to prevent the application from loosing responsiveness?
I have implemented the map as follows:
public void PlotPoints(List<LatitudeLongitude> points, bool centerOn = false, double scaleFactor = 0.1) { var template = new CustomRenderTemplate(); template.Render = new DataTemplateRenderHandler(templateRenderHandler); var series = new GeographicSymbolSeries() { LongitudeMemberPath = "X", LatitudeMemberPath = "Y", MarkerTemplate = template }; var brush = new Infragistics.Win.DataVisualization.SolidColorBrush(); brush.Color = System.Drawing.Color.WhiteSmoke; series.Brush = brush; series.MarkerBrush = brush; var outline = new Infragistics.Win.DataVisualization.SolidColorBrush(); outline.Color = System.Drawing.Color.FromArgb(21, 115, 255); series.MarkerOutline = outline; series.IsHighlightingEnabled = true; series.MouseOverEnabled = true; series.Thickness = 0.5; var geoLocations = new List<Infragistics.Win.DataVisualization.Point>(); foreach (var point in points) { var infraPoint = new Infragistics.Win.DataVisualization.Point() { X = point.DoubleLongitude, Y = point.DoubleLatitude }; geoLocations.Add(infraPoint); } series.DataSource = geoLocations; this.ultraGeographicMap1.Series.Add(series); // if only one point passed in, center on the given position - not sure if this is correct - should probably be in own method? if (centerOn && points.Count == 1) { this.CentreOnPoint(points.First().DoubleLongitude, points.First().DoubleLatitude, scaleFactor); } }
It seems to freeze when switching to a lower detail level:
Hello Dj,
My team and I have done an initial investigation into this post, and I am curious about the contents of your “templateRenderHandler” that is being passed into the DataTemplateRenderHandler, and whether it may be doing anything expensive. I ask, as each time you zoom in, out, or load a new position on the map, the contents of this DataTemplateRenderHandler will be evaluated.
Something you might be able to do as a simple test is to comment out the setting of the MarkerTemplate to your CustomRenderTemplate. If the hanging still exists, this eliminates this as the cause, but if it does, this tells us that this would be the cause, and I will need to see the “templateRenderHandler” in this case to be able to tell what may be wrong.
Please let me know if you have any other questions or concerns on this matter.
Thanks for the response. We have tested this and still produced the hanging behavior.(the map/application hangs, becomes unresponsive. If left for a long enough (multiple minutes) it will become responsive again)We commented the following code out and still had this issue:
private void templateRenderHandler(DataTemplateRenderInfo info) { System.Drawing.Graphics graphics = info.Context as System.Drawing.Graphics; if (graphics != null) { graphics.DrawImage(Properties.Resources.map_pin_01, (float)info.XPosition - (Properties.Resources.map_pin_01.Width / 2) + 1.2f, (float)info.YPosition - (Properties.Resources.map_pin_01.Height - 4f), 24, 32); } }
We believe that we have tracked the hanging code down to the following location:
I have been further investigating the freezing effect you are seeing with similar code to what you have provided, and being that you have commented out the “templateRenderHandler” and the behavior still happens, I feel that we can rule that out.
I now have a few questions for you on this matter. Can you please provide some information regarding the following?
1. I see that version 18.1 is referenced within the stack trace that you have provided. What is the specific version of 18.1 that you are using? This number can be found on the details of the DLL and will look like 18.1.20181.XXXX.
2. Approximately how many points are you plotting within the UltraGeographicMap?
3. Is there anything in the Output Window in Visual Studio when zooming in and out? I am able to see quite a few handled System.ObjectDisposedExceptions in the Output window happening at times when zooming. Are you seeing the same behavior? With that said, this only causes a very brief hang (less than 1 second), and only in Debug mode, so this may be something different.
For reference, I am attaching the sample project I used to test this.
UltraGeoMapPerformanceTest.zip
I was able to hang this test application twice.I made some very small changes to it when trying to reproduce.
I don't believe that these changes affected the program crashing or not.I was eventually able to crash the program simply by zooming in and out on cities and panning around.
I was NOT in debug mode.
We are using 18.1.20181.88.
3021.UltraGeoMapPerformanceTest.zip
Thank you for your update on this matter. With the sample project you have sent me, I have been able to hang the application, although it’s only really when zooming and panning “wildly.” Changing the application to be full screen and zooming and panning on it then tends to more reliably reproduce it though.
I have switched the application to use version 2019.1, which is the most recent version currently receiving active development, and I was able to reproduce this behavior there as well. This behavior is unexpected, and as such, I have asked our engineering staff to examine it further.
To ensure this issue receives attention, I have logged it in our internal tracking systems with a development ID of 267456. I have also created a private support case for you that I will link this development issue to. This case has an ID of CAS-205128-W8N8K6 and you can access it at https://ko.infragistics.com/my-account/support-activity.