Register  |  Login
ThinkGeo - GPS Tracking and Mapping Solutions  |  Visit the Wiki  |  Find us on: Twitter Facebook Google+ LinkedIn

Discussion Forums

The online community for users of Map Suite GIS components

Problem with EditOverlay
Last Post 07-25-2010 08:17 PM by Howard. 3 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
RaquiburUser is Offline
Level 3
Level 3
Posts:70
Avatar

--
07-22-2010 06:49 PM

Hi,

I am getting exceptions while working with the EditOverlay.  I have attached source code with this email. Click the button to see the exception.

 

Thanks

Raquib


001_Source_code.zip

HowardUser is Offline
MVP
MVP
Posts:1406
Avatar

--
07-22-2010 09:45 PM

Hi Raquibur,

This issue is not the issue from MapSuite, you know we are using NTS for the geometry spatial arithmetic; your geometry is too regular and NTS calculate the center of your geometry's x=infinity and y=NaN. That's why the exception happens.

You can try to get center point of your PolygonShape and you'll see what happens. This is an issue what we cannot handle recently. But I have a workaround for you, use the new EditOverlay below; and replace the edit overlay with this new one.

    public class NewEditInteractiveOverlay : EditInteractiveOverlay
    {
        public NewEditInteractiveOverlay()
            : base()
        { }

        protected override IEnumerable<Feature> CalculateDragControlPointsCore(Feature feature)
        {
            PointShape centerPointShape = feature.GetShape().GetCenterPoint();
            if (double.IsInfinity(centerPointShape.X) || double.IsInfinity(centerPointShape.Y) || double.IsNaN(centerPointShape.X) || double.IsNaN(centerPointShape.Y))
            {
                centerPointShape = feature.GetShape().GetBoundingBox().GetCenterPoint();
            }

            Feature dragPointFeature = new Feature(new Vertex(centerPointShape));

            Feature[] returnValues = new Feature[] { dragPointFeature };
            return returnValues;
        }
    }

Please let me know if you have more queries.

Thanks,
Howard



RaquiburUser is Offline
Level 3
Level 3
Posts:70
Avatar

--
07-23-2010 08:17 PM
Hi Howard,

This fix has solved my problem. Can you tell when we will get a stable version of this api. And also, will there be any build with this fix

Thanks
Raquib


HowardUser is Offline
MVP
MVP
Posts:1406
Avatar

--
07-25-2010 08:17 PM
Hi Raquibur,

It's actually an issue from the NTS. We can have a work around for this issue just as the previous Desktop Edition does which means if there is an issue from NTS, we will use upper-left point of its bounding box.

Basically, Wpf Desktop Edition's feature is designed based on the previous Desktop Edition, but some slim features or workaround is not integrated in. Also Wpf Desktop is in beta and we are working on testing the bugs and adding new features currently. MapSuite is going to have a big release in the beginning of November, I'm sure you will get final release of Wpf Desktop Edition then. Also, this fix will integrate in our today's build, please download and have a try tomorrow.

Thanks,
Howard


You are not authorized to post a reply.

Active Forums 4.2