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 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
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

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.