How to handdle Shapefile.

Topics: General Topics
Jan 5, 2007 at 8:19 AM

I'm testing SharpMap which is a really good framework. Good job guys ;-)

I have a question : I have a Winform application with a pictureBox to display a map with SharpMap.
I 'load' a shapefile like this :

SharpMap.Layers.VectorLayer myLayer = new SharpMap.Layers.VectorLayer("My layer");
myLayer.DataSource = new ShapeFile(@"sample.shp");

There is no problem, the map displays correctly in the pictureBox with this snippet :

pictureBox1.Image = myMap.GetMap();

The shapefile contains more polygons. I want each polygon changes fillColor when user click on this polygon. Here is my problem cause I don't know how to access to polygons of my shapefile.

I hope my post is clear. Sorry for my english.