Qingge,
Welcome to the community, hope you enjoy sharing and learning here!
Your data is not in DecimalDegree and so the current extent “(-140, 60, 140, -60)” doesn’t work. Change the code like this and everything will be fine.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Map1.MapBackground.BackgroundBrush = New GeoSolidBrush(GeoColor.FromHtml("#B3C6D4"))
Map1.MapUnit = GeographyUnit.Feet
’ The following two lines of code enable the client and server caching.
’ If you enable these features it will greatly increase the scalability of your
’ mapping application however there some side effects that may be counter intuitive.
’ Please read the white paper on web caching or the documentation regarding these methods.
’ Map1.StaticOverlay.ClientCache.CacheId = “WorldOverlay”
’ Map1.StaticOverlay.ServerCache.CacheDirectory = MapPath("~/ImageCache/" + Request.Path)
Dim worldLayer As New ShapeFileFeatureLayer(“C:\shapefiles\aldata\mnsfield.shp”)
worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(255, 243, 239, 228), GeoColor.FromArgb(255, 218, 193, 163), 1)
worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
Map1.StaticOverlay.Layers.Add(worldLayer)
worldLayer.Open()
’ set the current extent to layer’s boundingbox
Map1.CurrentExtent = worldLayer.GetBoundingBox()
worldLayer.Close()
End If
End Sub
Here is a quick trick that to check if a shape file is correct, just drag and drop it to Map Suite Explorer (along with the product) and see if it shows well there.
Thanks,
Ben