ThinkGeo.com    |     Documentation    |     Premium Support

S57FeatureLayer Sample Test

Hello.

I have any question.

I looked at the code sample.(thinkgeo.com/forums/MapSuite…t.aspx#s57)

But this code is desktop application.

I want MVC code sample.

So it was a convert test. (desktop application project -> MVC Code Project)

But it did not work.

Please check if there code are mistakes.

Best regards.



--------- code -----------



    

        @{

            Html.ThinkGeo().Map(“Map1”, new System.Web.UI.WebControls.Unit(100, System.Web.UI.WebControls.UnitType.Percentage), 510)

                .MapBackground(new BackgroundLayer(new GeoSolidBrush(GeoColor.GeographicColors.ShallowOcean)))

                .MapUnit(GeographyUnit.DecimalDegree)

                .CurrentExtent(-162.94, 24.08, -154.81, 20.20)//(122.0, 42.7, 134.0, 34.0)

                .CustomOverlays(overlays =>

                {

                    S57FeatureLayer layer = new S57FeatureLayer("~/App_Data/s57/US1HA02M.000");

                    layer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(ThinkGeoSampleProject.S57StyleFactory.GetMaritimeStyle());

                    layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

                    overlays.LayerOverlay().Layer(layer);


                }).Render();               

        }

    



Hi Binary, 
  
 I think your path is incorrect, please use the code as below: 
  
 S57FeatureLayer layer = new S57FeatureLayer(Server.MapPath("~/App_Data/US1HA02M.000")); 
  
 Regards, 
  
 Don

The problem was solved by your advice.

Thank you.

Best regards.

 

Hi Binary, 
  
 I am glad to hear that works. 
  
 Regards, 
  
 Don