2

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.

3
  • 1
    Sounds like a projection issue. Is the shapefile projected to a different coordinate system than you're used to using? Commented Oct 27, 2010 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
    Commented Oct 27, 2010 at 20:28
  • Are your geometries simple/valid (outer rings counter-clockwise, inner rings clockwise)?
    – Jim B
    Commented Oct 28, 2010 at 18:24

1 Answer 1

0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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