ThinkGeo.com    |     Documentation    |     Premium Support

Quick Start Guide Questions

Hi,


I have problems with the Quick Start Guide. I follow the steps in the guide, but the proyect not Run.


Help please!!



Hi, 
  
   We can help but we will need more information. 
  
 1.Are you using VS 2008 or VS 2008 or and Express Edition? 
 2.Are you using C# or VB.NET
 3.Were you able to run the sample code in the “How Do I Samples”? 
 4.Can you describe the issue, do you get an error a blank map or what? 
 5.What level of experience do you have in development with .NET? 
 6.Can you copy and past your code exactly like you have it? 
  
 The more information you can provide the better. 
  
 David

OK, excuse me...


1.- I´m using Visual Basic 2008 professional


2.- with C#


3.- the example is running in default VS path, "C:\Documents and Settings\Angelical\Mis documentos\Visual Studio 2008\WebSites\WebSite1".


4.- error:


 

 


Error de servidor en la aplicación '/WebSite1'. 


The file specified does not exist.



 


 


Descripción: Excepción no controlada al ejecutar la solicitud Web actual. Revise el seguimiento de la pila para obtener más información acerca del error y dónde se originó en el código. 



Detalles de la excepción: System.IO.FileNotFoundException: The file specified does not exist.



Error de código fuente: 




    
        
            Se ha generado una excepción no controlada durante la ejecución de la solicitud Web actual. La información sobre el origen y la ubicación de la excepción pueden identificarse utilizando la excepción del seguimiento de la pila siguiente.
        
    



Seguimiento de la pila: 




    
        
            
            
[FileNotFoundException: The file specified does not exist.]
   ThinkGeo.MapSuite.Core.x547f91e235e84727.x953aa6f421de639c(String xb7e651c2a049d183) +70
   ThinkGeo.MapSuite.Core.xe3df2a142a9f8d9e.Open(FileAccess fileAccess) +84
   ThinkGeo.MapSuite.Core.ShapeFileFeatureSource.OpenCore() +264

[FileLoadException: There was a problem opening the file.]
   ThinkGeo.MapSuite.Core.ShapeFileFeatureSource.OpenCore() +793
   ThinkGeo.MapSuite.Core.FeatureSource.Open() +128
   ThinkGeo.MapSuite.Core.VectorLayer.OpenCore() +27
   ThinkGeo.MapSuite.Core.Layer.Open() +23
   ThinkGeo.MapSuite.Core.MapEngine.OpenAllLayers() +158
   ThinkGeo.MapSuite.WebEdition.Map.SaveViewState() +891
   System.Web.UI.Control.SaveViewStateRecursive() +59
   System.Web.UI.Control.SaveViewStateRecursive() +156
   System.Web.UI.Control.SaveViewStateRecursive() +156
   System.Web.UI.Page.SaveAllState() +466
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2357

            

        
    


 



5.- My experience in VS is Medium, but i´ve very experience in other lenguajes.


 





6.- The Souce code is:


 


using



 System;

using


 System.Configuration;

using


 System.Data;

using


 System.Linq;

using


 System.Web;

using


 System.Web.Security;

using


 System.Web.UI;

using


 System.Web.UI.HtmlControls;

using


 System.Web.UI.WebControls;

using


 System.Web.UI.WebControls.WebParts;

using


 System.Xml.Linq;

using


 


 ThinkGeo.MapSuite.Core; 

public


{


 


{


 


{


 


 partial class _Default : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e)if (!IsPostBack)// We set the unit of measurement to DecimalDegree because this is the inherent unit in the "cntry02.shp" file. 

Map1.MapUnit =


 


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

 


 


ShapeFileLayer layer = new ShapeFileLayer(@"C:\Archivos de Programa\ThinkGeo\Map Suite Web Edition 3.0 (Beta)\Samples\CSharp Samples\SampleData\World\cntry02.shp", ShapeFileReadWriteMode.ReadOnly);// Set the worldLayer with a preset Style, as AreaStyles.Country1 has YellowGreen background and black border, our worldLayer will have the same render style. 

layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle =


 


AreaStyles.Country1;// This setting will apply from ZoonLevel01 to ZoomLevel20, that means we can see the world all the time no matter how far we zoom out/in. 

layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel =


 


ApplyUntilZoomLevel.Level20;// We need to add the world layer to map's Static Layer collection. 

Map1.StaticLayers.Add(layer);


 


// Set a proper extent for the map, that's the place you want it to display. 

Map1.CurrentExtent =


}


}


}


new RectangleShape(0, 78, 30, 26);

 




Thanks for all the information, the error message is really helpful.  I will try a sample myself however can you try a quick test for me?  Can you insert some code right before you load the layer?  The code is something like File.Exisits(@"C:\Archivos de Programa\ThinkGeo\Map Suite Web Edition 3.0 (Beta)\Samples\CSharp Samples\SampleData\World\cntry02.shp") and put a break point to see the result of the method call to see if the file really exisits there.  Actually I am fairly sure it does exisit however I want to make sure the ASP.NET can find the file during runtime.  Anytime you have data outside of the running path of the website sometime filesystem permissions come into play and you may not be able to ‘see’ the file though it does really exisit on the file system.  If you cannot find the file there you may want to move the directory that has the files under the directory of your website.  While you do that I will check with a sample myself and see what I find.  Thanks again for all the information!  We will get to the bottom of this. 
  
 David

One more thing, can you check to see if the shape file is really called cntry02.shp.  i think that maybe we changed it to Countries02.shp at some point and maybe we didnt update our samples.  This is just a hunch on my part. 
  
 David

OK, Thank you. 
  
 The problem is solve!

Great, 
  
   What was the exact problem?  I am personally curious if it was the shape file name being changed or it was a file system permission issue.   
  
 David 
 

OK,


 


The problem is the path of the SHP file, is incorrect!!.


 


Uuups!



I hate it when that happens :), let us know if you run into any other issues with the Quick Start Guide.