Take the 2-minute tour ×

I have a completely empty dynamic layer

public class CustDynamicLayer2 : BaseDynamicLayer
public override void DrawDynamicLayer(esriDynamicDrawPhase DynamicDrawPhase, IDisplay iDisplay, IDynamicDisplay iDynamicDisplay) { }

I add a shape file with these four calls:

gcs = srFactory.CreateGeographicCoordinateSystem((int)esriSRGeoCSType.esriSRGeoCS_WGS1984);
mapControl.SpatialReference = gcs; 
mapControl.Map.AddLayer(new CustDynamicLayer2()); //without this my shapefile is badly distorted
mapControl.AddShapeFile(fileDir, fileName);

Basically if I don't add that empty class CustDynamicLayer2, the shapefile is distorted. This makes no sense to me because the class doesn't do anything.

share|improve this question
Sounds like a projection issue. Is the shapefile projected to a different coordinate system than you're used to using? –  Michael Todd Oct 27 '10 at 20:20
@Michael Todd, I looked into that. I tried it with the same projection as the shapefile, esriSRGeoCS_NAD1983HARN, and got the same results –  patrick Oct 27 '10 at 20:28
Are your geometries simple/valid (outer rings counter-clockwise, inner rings clockwise)? –  Jim B Oct 28 '10 at 18:24
add comment

1 Answer

up vote 0 down vote accepted

The problem went away, now if I load the shapefile its distorted, but if I hit full extent it readjusts itself. So I think the drawing got interrupted or something.

share|improve this answer
add comment

Your Answer


