This project has moved. For the latest updates, please go here.

How do I add a shapefile layer?

Use the ShapeFile Provider:
SharpMap.Layers.VectorLayer layWorld = new SharpMap.Layers.VectorLayer("World");
//Specifing true will save the spatial index to a file which will make it load quicker the next time
layWorld.DataSource = new SharpMap.Providers.ShapeFile(@"C:\Data\Countries.shp", true); 
myMap.Layers.Add(layWorld);

Last edited Aug 31, 2012 at 11:50 AM by FObermaier, version 7