ThinkGeo.com    |     Documentation    |     Premium Support

Problems with Web Edition versiion 3.0.2

In version 3.0.0 could load the shape, but with version 3.0.2 does not load the map. We have already started a new project on a PC clean and error continues. Is there a different procedure of version 3.0.0?

Helio,  
  
 The method for loading the map in 3.0.2 is the same as for 3.0.0. Are you receiving an exception?

Ryan,


Does not happen any exception or error message. Not only shows the map.
I'm using this code:
 

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;

using


 ThinkGeo.MapSuite.WebEdition;

public


{


 


{


 


{


Map1.MapUnit =


 


municipio.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle =


municipio.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel =


Map1.StaticLayers.Add(municipio);


Map1.CurrentExtent =


Map1.BackgroundFillBrush =


}


}


 partial class _Default : System.Web.UI.Page protected void Page_Load(object sender, EventArgs e)

if (!IsPostBack)GeographyUnit.Meter;ShapeFileLayer municipio = new ShapeFileLayer(@"C:\inetpub\wwwroot\prototipo\Mapas\MUNICIPIO.shp", ShapeFileReadWriteMode.ReadOnly);AreaStyles.Country1;ApplyUntilZoomLevel.Level20;new RectangleShape(0, 100000, 100000, 0);new GeoSolidBrush(GeoColor.StandardColors.LightSteelBlue);




Helio,  
  
 Are you loading a shapefile that is in the Geodetic projection or some other projection? 
  
 ThinkGeo Support

Ryan


The shape has the following settings:
 
Projected Coordinate System: SAD_1969_UTM_Zone_23S

Projection: Transverse_Mercator

False_Easting: 500000,00000000

False_Northing: 10000000,00000000

Central_Meridian: -45,00000000

Scale_Factor: 0,99960000

Latitude_Of_Origin: 0,00000000

Linear Unit:  Meter
 
Geographic Coordinate System: GCS_South_American_1969

Datum:  D_South_American_1969

Prime Meridian:  Greenwich

Angular Unit:  Degree
 
Attached follows the code and the shape.
 
Please the file shape.txt, rename to shape.rar.
 
Thanks

37-Code.txt (1.22 KB)
38-shape.txt (26.3 KB)

Helio,  
  
 There is a known issue where shapefiles in a projection other than Geodetic cannot be displayed by Map Suite 3.0 unless the projection of the shapefile is specified in code.  
  
 Using the following code the shapefile will load because we are specifiying the projection. Here we are loading a shapefile with an ESPG of 27700: 
  
 protected void Page_Load(object sender, EventArgs e) 
         { 
             if (!Page.IsPostBack) 
             { 
                 Map1.BackgroundFillBrush = new GeoSolidBrush(GeoColor.FromHtml("#B3C6D4")); 
  
                 ShapeFileLayer worldLayer = new ShapeFileLayer(MapPath(@"/App_Data/testshapfile.shp")); 
                  
                 // you can set projection like this, 
             worldLayer.FeatureSource.Projection = new Proj4Projection(27700, 27700); 
                                  
                 worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.GetSimpleAreaStyle(GeoColor.FromArgb(255, 243, 239, 228), GeoColor.FromArgb(255, 218, 193, 163), 1); 
                 worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; 
  
                 Map1.StaticLayers.Add(worldLayer);

My problem is the same and I do it in VB but nonetheless it does not load one *.SHP my code is the following one 
 It does not go out alone mistake loads the page but it does not show me the map. 
  
 You can help me? 
  
  
  
 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 
  
         If (Not Page.IsPostBack) Then 
  
  
             Map1.BackgroundFillBrush = New GeoSolidBrush(GeoColor.FromHtml("#B3C6D4")) 
             Map1.CurrentExtent = New RectangleShape(-114.34, 75.27, 108.79, -70.23) 
             Map1.MapUnit = GeographyUnit.DecimalDegree 
  
             Dim mapanavarra As ShapeFileLayer 
             mapanavarra = New ShapeFileLayer(“c:\navarra\Navarra.shp”) 
             
             'you can set projection like this,  
             'Map1.FeatureSource.Projection = New Proj4Projection(27700, 27700) 
  
             mapanavarra.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.GetSimpleAreaStyle(GeoColor.FromArgb(255,243, 239, 228), GeoColor.FromArgb(255, 218, 193, 163), 1) 
             mapanavarra.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20 
  
             Map1.StaticLayers.Add(“MapaNavarra”, mapanavarra) 
  
             Map1.ScaleLine.Enabled = True 
             Map1.PanZoomBar.Enabled = True 
             Map1.MousePosition.Enabled = True 
             Map1.LayerSwitcher.Enabled = True 
             Map1.Overview.Enabled = True 
            
         End If 
  
          
  
  
  
     End Sub

And as exchange this line in vb 

It does not show me the shp (map)


worldLayer.FeatureSource.Projection = new Proj4Projection(27700, 27700); 

 


my code is :



 


(Not Page.IsPostBack) Then New GeoSolidBrush(GeoColor.FromHtml("#B3C6D4"))New RectangleShape(-114.34, 75.27, 108.79, -70.23)Dim mapanavarra As ShapeFileLayerNew ShapeFileLayer("c:\navarra\Navarra.shp")'you can set projection like this, 

 


'Map1.FeatureSource.Projection = New Proj4Projection(27700, 27700)

mapanavarra.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.GetSimpleAreaStyle(GeoColor.FromArgb(255, 243, 239, 228), GeoColor.FromArgb(255, 218, 193, 163), 1)


mapanavarra.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20


mapanavarra.DrawingQuality = DrawingQuality.HighQuality


Map1.StaticLayers.Add(


 


"MapaNavarra", mapanavarra)'Map1.DynamicLayers.Add("MapaNavarra", mapanavarra)

 


Map1.ScaleLine.Enabled =


True

Map1.PanZoomBar.Enabled =


True

Map1.MousePosition.Enabled =


True

Map1.LayerSwitcher.Enabled =


True

Map1.Overview.Enabled =


True

 


 


End If

wait for your help


 


 



Map1.BackgroundFillBrush =


Map1.CurrentExtent =


Map1.MapUnit = GeographyUnit.Meter


 


 


mapanavarra =


 



If



Ryan


I added the following code:
 
________________________


ShapeFileLayer



 municipio = new ShapeFileLayer(@"C:\inetpub\wwwroot\prototipo\Mapas\municipio.shp", ShapeFileReadWriteMode.ReadOnly);new Proj4Projection(29183, 29183);

___________________________


and now load the map without problems.
 
Thanks


municipio.FeatureSource.Projection =



Helio, 



Glad it is working for you and thanks for sharing your code. 



ThinkGeo Support