I have followed the QuickStart Guide and below is my code:
if (!IsPostBack)
{
// Set the Map Unit. The reason for setting it to DecimalDegrees is that is what the shapefile's unit of measure is inherently in.
Map1.MapUnit = GeographyUnit.DecimalDegree;
// We create a new Layer and pass the path to a Shapefile into its constructor.
ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(@"D:\Documents and Settings\Administrator\Desktop\KCDB1\EQPTROOM_lin.shp");
//ShapeFileFeatureLayer.BuildIndexFile(@"D:\Documents and Settings\Administrator\Desktop\KCDB1\EQPTROOM_lin.shp");
//worldLayer.RequireIndex = false;
// 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.
Map1.StaticOverlay.Layers.Add(worldLayer);
// Set a proper extent for the map, that's the place you want it to display.
Map1.CurrentExtent = new RectangleShape(5, 78, 30, 26);
}
Basically the code is the same as the guide except for the path to the shapefile. My shapefiles are custom-made and consists of only .dbf, .shp and .shx.
Hence I set RequireIndex to false and even after to use the BuildIndexFile method, the map was not displayed on the IE. However when I used the sampe shapefile cntry02.shp, the map was able to be displayed.
So any solution or suggestion will be welcomed. Thanks