Polygon/LineString hangs App in Digitizer

May 8, 2012 at 1:31 PM

Hi!
There is a massive error in Digitizer.
If You draw a Line or Polygon using Digitizer. Than drag/move Map in way that Your Objects will disappear on the top or the left side of Map View, all the App hangs.

The error thrown is: Value does not fall within the expected range.

The problem is within:
DeepEarth.Map.Core.Filters ->  Synchronizer

 // ISelfPositionings may not have an attached location so they are always part of the visual tree
 // This needs to be optimised. i.e. only arrange element if they are currently visible
 if (element is ISelfPositioning)
 {
       Point offset = new Point(-locatedPoint.X, -locatedPoint.Y);

        ((ISelfPositioning)element).Refresh(offset, 16848);
 }

witch call's:
DeepEarth.Toolkit.Geometry -> LineString

protected override void Refresh()
        {
            PathGeometry pg = new PathGeometry();
            var figures = ShapeHelper.CreateSafeFigures(Locations, LocationToPoint, false, MaxBound);

            foreach (var figure in figures)
            {
                pg.Figures.Add(figure);            
            }

            this.Data = pg;
        }

As I understand the "needed" optimization is the problem I described higher.
Funny is that if You move objects right or down over the bottom, App works fine.

I'm trying to find the place to start, but as so far, without any clue.

My first thought was that problem is the point 0,0 (top,left) and drawing over it. F.e. Point (-1,-1). BUT the PathGeometries are build from points like (450, -172) with success.

Problem occurs only if last visible on map point goes by the left or top line, all Path points takes negative values and then after UElement Updated Event -> AppException fires.

What have to be done?
Any one have the same problem?

Regards for Authors!

Marked as answer by _RuDy_ on 4/22/2014 at 1:58 PM
May 8, 2012 at 3:12 PM
Edited Apr 22, 2014 at 8:58 PM
.
May 9, 2012 at 10:36 AM

I think this problem has something to do with new version of Silverlight. In SL4, the objects while map is dragged/moved, don't generate an error. However, in SL5, this error starts occurring. The problem is that how can I control my users who automatically download the latest version of SL (5) and start getting errors.

I 'll try the solution posted by you. It seems that you have found one clever workaround (it looks like a good job done!).

Thanks.