Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a class that inherits from BaseDynamicLayer and I override the DrawDynamicLayer() method. Is there something special that needs to be done for a successful inDynamicDisplay.DrawPolygon(poly) call? The method crashes every time I call it with a "Exception from HRESULT: 0x80040218." I can use the same point collection to create a Polyline and call DrawPolyline(polyLine) without a problem. I can also successfully use all the other draw commands, like DrawMarker() & DrawRectangle().

share|improve this question

Is your polygon a simple geometry? You may need to invoke simplify and then try to draw it.

Here's an example of simplifying a polygon

//Set the IsKnownSimple property to false, 
//otherwise simplification will not take place.
ITopologicalOperator2 topoOp = geometry as ITopologicalOperator2;
topoOp.IsKnownSimple_2 = true;
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.