protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#E5E3DF")); Map1.MapUnit = GeographyUnit.Meter; Map1.CurrentExtent = new RectangleShape(3848760.07468664, 3782311.88564604, 6314186.62275073, 1849220.15276955); LayerOverlay overlay = new LayerOverlay(); overlay.IsBaseOverlay = false; AddShapeFile(@"Iqrad\Iqrad\App_Data\KSA_Adminbndy\Adminbndy4.shp", overlay); AddShapeFile(@"Iqrad\Iqrad\App_Data\KSA_Adminbndy\Adminbndy5.shp", overlay); AddShapeFile(@"Iqrad\Iqrad\App_Data\KSA_Adminbndy\Adminbndy1.shp", overlay); AddShapeFile(@"Iqrad\Iqrad\App_Data\KSA_Adminbndy\Adminbndy3.shp", overlay); GoogleOverlay google = new GoogleOverlay("Google Map"); google.JavaScriptLibraryUri = new Uri(ConfigurationManager.AppSettings["GoogleUriV3"]); google.GoogleMapType = GoogleMapType.Normal; google.IsBaseOverlay = true; Map1.CustomOverlays.Add(overlay); Map1.CustomOverlays.Add(google); Map1.MapTools.OverlaySwitcher.Enabled = true; } } private void AddShapeFile(string path, LayerOverlay overlay) { ShapeFileFeatureLayer layer = new ShapeFileFeatureLayer(path); layer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.CreateSimpleAreaStyle(GeoColor.FromArgb(50, GeoColor.StandardColors.Green)); layer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; ManagedProj4Projection proj = new ManagedProj4Projection(); proj.InternalProjectionParametersString = ManagedProj4Projection.ConvertPrjToProj4("GEOGCS[\"GCS_WGS_1984\",DATUM[\"D_WGS_1984\",SPHEROID[\"WGS_1984\",6378137,298.257223563]],PRIMEM[\"Greenwich\",0],UNIT[\"Degree\",0.017453292519943295]]"); proj.ExternalProjectionParametersString = ManagedProj4Projection.GetGoogleMapParametersString(); layer.FeatureSource.Projection = proj; overlay.Layers.Add(layer); }