ThinkGeo.com    |     Documentation    |     Premium Support

Adding shape file

Hi,


I just downloaded MapSuite 3.0 desktop for the first time and playing with it. It is really cool. I am currently evaluating MapSuite to replace MapObjects 2.4 from our application.


I am trying to add a shape file to winformMap control but nothing is visible. I am sure, I am doing something wrong. Could someone please help me out.


Here is my code.


 ShapeFileFeatureLayer austinLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Desktop Evaluation Edition 3.0 (BETA)\Samples\SampleData\Data\Austinstreets.shp");

 Thank you, Suresh.



austinLayer.Open();


winformsMap1.CurrentExtent = austinLayer.FeatureSource.GetBoundingBox();


winformsMap1.StaticOverlay.Layers.Add(austinLayer);


winformsMap1.Refresh();



Suresh,


You are missing one important piece of the puzzle, a GeoStyle that tells the map how to draw the streets.


I would recommend that you take a look at our Quick Start Guide (gis.thinkgeo.com/Support/Dis...ault.aspx)


and our sample applications to see how to use GeoStyles, but here is some code that will get you started.


 


 


ShapeFileFeatureLayer austinLayer = newShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Desktop Full Edition 3.0 (BETA)\Samples\SampleData\Data\Austinstreets.shp"); 
 
austinLayer.Open();
             
austinLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.LocalRoad3;


austinLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;


winformsMap1.StaticOverlay.Layers.Add(austinLayer);
winformsMap1.CurrentExtent = austinLayer.FeatureSource.GetBoundingBox();

winformsMap1.Refresh();

Thanks Ryan. It worked. Now I could display the shape file.


But the link you provided for quick start guide is not working. Can you post the correct link?


Thanks,


Suresh



Suresh,


Here is the link: 

gis.thinkgeo.com/Support/Dis...fault.aspx