ThinkGeo.com    |     Documentation    |     Premium Support

Problem in the function

Hi ,


I downloaded Map Suite Desktop edition BETA 2 the evaluation version ,and then Istarted the tutorial in this link


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


and there is no problems but when I copy and paste this code :


 


private void Form1_Load(object sender, EventArgs e)

    {

        // Set the Map Unit. The reason for setting it to DecimalDegrees is that is what the shapefile's unit of measure is inherently in.

        winformsMap1.MapUnit = GeographyUnit.DecimalDegree;



        // We create a new Layer and pass the path to a Shapefile into its constructor. 

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

        

        // Set the worldLayer with a preset Style, as AreaStyles.Country1 has YellowGreen background and black border, our worldLayer will have the same render style.  

        worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Country1;

        

        // This setting will apply from ZoonLevel01 to ZoomLevel20, that means we can see the world the same style with ZoomLevel01 all the time no matter how far we zoom out/in. 

        worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

        

        // We need to add the world layer to Map's Static Overlay.

        winformsMap1.StaticOverlay.Layers.Add(worldLayer);

        

        // Set a proper extent for the Map.  

        winformsMap1.CurrentExtent = new RectangleShape(0, 78, 30, 26);

        

        // We now need to call the Refresh() method of the Map control so that the Map can redraw based on the data that has been provided.

        winformsMap1.Refresh();

    }

 


 


It occurs an error and I submit the error through attachment


note:I downloaded the suite to this directory


"C:\Program Files\ThinkGeo\Map Suite Desktop Evaluation Edition 3.0 (BETA)\")


another note:Countries02.idx is missing when I downloaded the suite


 



536-p.doc (55.5 KB)

Jennifer, 
  
 Welcome to the community and hope you enjoy learning and sharing here! 
  
 The exception shows the file (@“C:\Program Files\ThinkGeo\Map Suite Desktop Full Edition 3.0 (BETA)\Samples\SampleData\Data\Countries02.shp”) does not exist. Can you double check if the file(.shp, .dbf and .shx) is there? Also as you mentioned Countries02.idx is missing, can you recreated that index by opening the Map suite Explorer (Start->All Programs ->ThinkGeo ->Map Suite Desktop full Edition 3.0 (BETA) → MapSuiteExplorer), and drag / drop Countries02.shp to it? It will ask if you’d like to rebuild index and just click yes. 
  
 Thanks, 
  
 Ben