using System; using System.Text; using System.Collections.ObjectModel; 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; namespace displaymap { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { // Map1.MapTools.Logo.Enabled = false; // Map1.MapTools.Logo.ImageUri = new Uri("http://www.google.com/images/logos/ps_logo2.png"); DisplayMap(); StringBuilder contentHtml = new StringBuilder(); contentHtml.Append("The BARC(Bhabha Atomic Research Centre) is India's primary nuclear research facility.It has a number of nuclear reactors,all of which are used for India's nuclear power and research programme."); contentHtml.Append("BARC was started in 1954,as the ATOMIC ENERGY ASTABLISHMENT,TROMBAY(AEET) , and beame India's primary nuclear research centre."); contentHtml.Append("After HOMI . J . BHABHA's death in 1966 , the centre was renamed as the BHABHA ATOMIC RESEARCH CENTRE."); Map1.MarkerOverlay.Features.Add("MArker1", new Feature(72.92028, 19.04457)); Map1.MarkerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.WebImage = new WebImage("../../theme/default/img/marker_blue.gif", 21, 25); Map1.MarkerOverlay.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; Map1.MarkerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.ContentHtml = contentHtml.ToString(); Map1.MarkerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.HasCloseButton = true; Map1.MarkerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.OffsetXInPixels = 50; Map1.MarkerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.OffsetYInPixels = 50; Map1.MarkerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.Width = 450; Map1.MarkerOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.Height = 200; } } ShapeFileFeatureLayer MumbaiMajorRoadsShapeLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\roads.shp"); ShapeFileFeatureLayer MumbaiWaterShapeLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\waterbodies.shp"); ShapeFileFeatureLayer MumbaiAdminShapeLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\administrative.shp"); ShapeFileFeatureLayer indiaDistrictsLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\India\indiadistricts.shp"); ShapeFileFeatureLayer indiaCitiesLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\India\indiacities.shp"); ShapeFileFeatureLayer indiaStatesLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\India\indiastates.shp"); ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\World\cntry02.shp"); public void DisplayMap() { Map1.MapBackground.BackgroundBrush = new GeoSolidBrush(GeoColor.FromHtml("#94aac6")); Map1.CurrentExtent = new RectangleShape(-140, 60, 140, -60); Map1.MapTools.ScaleLine.Enabled = true; Map1.MapUnit = GeographyUnit.DecimalDegree; Map1.MapTools.MouseCoordinate.MouseCoordinateType = MouseCoordinateType.LongitudeLatitude; Map1.MapTools.MouseCoordinate.Enabled = true; Map1.Cursor = CursorType.Pointer; worldLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.County1; worldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; Map1.StaticOverlay.Layers.Add(worldLayer); ShapeFileFeatureLayer worldLabelLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\World\cntry02.shp"); worldLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.Country1("CNTRY_NAME"); worldLabelLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; worldLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.GridSize = 10; Map1.DynamicOverlay.Layers.Add(worldLabelLayer); ShapeFileFeatureLayer capitalLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\World\capital.shp"); capitalLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.City7; capitalLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; Map1.StaticOverlay.Layers.Add(capitalLayer); ShapeFileFeatureLayer capitalLabelLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\World\capital.shp"); capitalLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.City7("CITY_NAME"); capitalLabelLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; capitalLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.GridSize = 10; Map1.DynamicOverlay.Layers.Add(capitalLabelLayer); ShapeFileFeatureSource.BuildIndexFile(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\India\indiastates.shp", BuildIndexMode.DoNotRebuild); indiaStatesLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.State1; indiaStatesLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; Map1.StaticOverlay.Layers.Add(indiaStatesLayer); ShapeFileFeatureLayer indiaStatesLabelLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\India\indiastates.shp"); indiaStatesLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.City5("STATE"); indiaStatesLabelLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; indiaStatesLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; indiaStatesLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.GridSize = 10; Map1.DynamicOverlay.Layers.Add(indiaStatesLabelLayer); ShapeFileFeatureSource.BuildIndexFile(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\India\indiadistricts.shp", BuildIndexMode.DoNotRebuild); ShapeFileFeatureLayer indiaDistrictsLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\India\indiadistricts.shp"); indiaDistrictsLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.County2; indiaDistrictsLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; Map1.StaticOverlay.Layers.Add(indiaDistrictsLayer); ShapeFileFeatureSource.BuildIndexFile(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\India\indiacities.shp", BuildIndexMode.DoNotRebuild); ShapeFileFeatureLayer indiaCitiesLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\India\indiacities.shp"); indiaCitiesLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.City1; indiaCitiesLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; indiaCitiesLayer.DrawingMarginPercentage = 50; Map1.StaticOverlay.Layers.Add(indiaCitiesLayer); ShapeFileFeatureLayer indiaCitiesLabelLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\India\indiacities.shp"); indiaCitiesLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.City1("CITY_NAME"); indiaCitiesLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.PointPlacement = PointPlacement.UpperRight; indiaCitiesLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.SuppressPartialLabels = false; indiaCitiesLabelLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; indiaCitiesLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.GridSize = 10; Map1.DynamicOverlay.Layers.Add(indiaCitiesLabelLayer); MumbaiAdminShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Urban1; MumbaiAdminShapeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; Map1.StaticOverlay.Layers.Add(MumbaiAdminShapeLayer); ShapeFileFeatureLayer MumbaiAdminLabelLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\administrative.shp"); MumbaiAdminLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.Urban1("NAME"); MumbaiAdminLabelLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; MumbaiAdminLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.Font = new GeoFont("Verdana", 8); Map1.DynamicOverlay.Layers.Add(MumbaiAdminLabelLayer); ShapeFileFeatureSource.BuildIndexFile(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\waterbodies.shp", BuildIndexMode.DoNotRebuild); MumbaiWaterShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = AreaStyles.Water1; MumbaiWaterShapeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; Map1.StaticOverlay.Layers.Add(MumbaiWaterShapeLayer); ShapeFileFeatureLayer MumbaiWaterLabelLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\waterbodies.shp"); MumbaiWaterLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.Water1("NAME"); MumbaiWaterLabelLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; MumbaiWaterLabelLayer.DrawingMarginPercentage = 200; MumbaiWaterLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.Font = new GeoFont("Verdana", 8); MumbaiWaterLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.FittingPolygon = true; Map1.DynamicOverlay.Layers.Add(MumbaiWaterLabelLayer); ShapeFileFeatureSource.BuildIndexFile(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\roads.shp", BuildIndexMode.DoNotRebuild); MumbaiMajorRoadsShapeLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(LineStyles.MajorRoad1); MumbaiMajorRoadsShapeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; MumbaiMajorRoadsShapeLayer.DrawingMarginPercentage = 10; Map1.StaticOverlay.Layers.Add(MumbaiMajorRoadsShapeLayer); ShapeFileFeatureLayer MumbaiMajorRoadsLabelLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\roads.shp"); MumbaiMajorRoadsLabelLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; TextStyle textStyle = TextStyles.MajorRoad1("NAME"); textStyle.TextLineSegmentRatio = double.MaxValue; textStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; textStyle.ForceHorizontalLabelForLine = false; textStyle.FittingLineInScreen = true; textStyle.BestPlacement = true; textStyle.GridSize = 10; textStyle.XOffsetInPixel = 1; textStyle.YOffsetInPixel = 1; textStyle.SplineType = SplineType.StandardSplining; MumbaiMajorRoadsLabelLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(textStyle); MumbaiMajorRoadsLabelLayer.DrawingMarginPercentage = 200; Map1.DynamicOverlay.Layers.Add(MumbaiMajorRoadsLabelLayer); ShapeFileFeatureSource.BuildIndexFile(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\railway line.shp", BuildIndexMode.DoNotRebuild); ShapeFileFeatureLayer MumbairailwaylineShapeLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\railway line.shp"); MumbairailwaylineShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = LineStyles.Railway1; MumbairailwaylineShapeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; Map1.StaticOverlay.Layers.Add(MumbairailwaylineShapeLayer); ShapeFileFeatureSource.BuildIndexFile(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\railway stations.shp", BuildIndexMode.DoNotRebuild); ShapeFileFeatureLayer MumbairailwaystnShapeLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\railway stations.shp"); MumbairailwaystnShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.City1; MumbairailwaystnShapeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; Map1.StaticOverlay.Layers.Add(MumbairailwaystnShapeLayer); ShapeFileFeatureLayer MumbairailwaystnLabelLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\railway stations.shp"); MumbairailwaystnLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.City7("NAME"); MumbairailwaystnLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; MumbairailwaystnLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.GridSize = 10; MumbairailwaystnLabelLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; Map1.DynamicOverlay.Layers.Add(MumbairailwaystnLabelLayer); ShapeFileFeatureSource.BuildIndexFile(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\hospitals.shp", BuildIndexMode.DoNotRebuild); ShapeFileFeatureLayer MumbaiHospitalShapeLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\hospitals.shp"); MumbaiHospitalShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.City7; MumbaiHospitalShapeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; Map1.StaticOverlay.Layers.Add(MumbaiHospitalShapeLayer); ShapeFileFeatureLayer MumbaiHospitalLabelLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\hospitals.shp"); MumbaiHospitalLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.City7("NAME"); MumbaiHospitalLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.XOffsetInPixel = 10F; MumbaiHospitalLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.YOffsetInPixel = 5F; MumbaiHospitalLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; MumbaiHospitalLabelLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; MumbaiHospitalLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.SplineType = SplineType.StandardSplining; MumbaiHospitalLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.PointPlacement = PointPlacement.UpperRight; MumbaiHospitalLabelLayer.DrawingMarginPercentage = 500; MumbaiHospitalLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.GridSize = 10; MumbaiHospitalLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.Font = new GeoFont("Verdana", 5); Map1.DynamicOverlay.Layers.Add(MumbaiHospitalLabelLayer); ShapeFileFeatureSource.BuildIndexFile(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\wards_point.shp", BuildIndexMode.DoNotRebuild); ShapeFileFeatureLayer MumbaiWardPointShapeLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\wards_point.shp"); MumbaiWardPointShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.City3; MumbaiWardPointShapeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; Map1.StaticOverlay.Layers.Add(MumbaiWardPointShapeLayer); ShapeFileFeatureLayer MumbaiWardPointLabelLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\wards_point.shp"); MumbaiWardPointLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.City7("AREA_NAME"); MumbaiWardPointLabelLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; Map1.DynamicOverlay.Layers.Add(MumbaiWardPointLabelLayer); ShapeFileFeatureLayer MumbaiLandMarksShapeLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\landmarks.shp"); MumbaiLandMarksShapeLayer.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = PointStyles.Capital1; MumbaiLandMarksShapeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; Map1.StaticOverlay.Layers.Add(MumbaiLandMarksShapeLayer); ShapeFileFeatureLayer MumbaiLandMarksLabelLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\landmarks.shp"); MumbaiLandMarksLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle = TextStyles.City7("NAME"); MumbaiLandMarksLabelLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; MumbaiLandMarksLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.OverlappingRule = LabelOverlappingRule.NoOverlapping; MumbaiLandMarksLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.GridSize = 10; MumbaiLandMarksLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.Font = new GeoFont("Verdana", 5); MumbaiLandMarksLabelLayer.ZoomLevelSet.ZoomLevel01.DefaultTextStyle.PointPlacement = PointPlacement.LowerRight; Map1.DynamicOverlay.Layers.Add(MumbaiLandMarksLabelLayer); ZoomLevelSet zoomLevelSet = new ZoomLevelSet(); Map1.ZoomToScale(100000000); } protected void zoom_in_india_Click(object sender, EventArgs e) { Map1.CurrentExtent = new RectangleShape(60, 45, 95, -2.5); ZoomLevelSet zoomLevelSet = new ZoomLevelSet(); Map1.ZoomToScale(17550000); } protected void zoom_in_mumbai_Click(object sender, EventArgs e) { Map1.CurrentExtent = new RectangleShape(72.630, 19.11, 73.2, 19); ZoomLevelSet zoomLevelSet = new ZoomLevelSet(); Map1.ZoomToScale(20000); } protected void zoom_out_Click(object sender, EventArgs e) { Map1.CurrentExtent = new RectangleShape(-140, 60, 140, -60); ZoomLevelSet zoomLevelSet = new ZoomLevelSet(); Map1.ZoomToScale(100000000); } protected void pan_left_Click(object sender, EventArgs e) { Map1.Pan(PanDirection.Left, 10); } protected void pan_right_Click(object sender, EventArgs e) { Map1.Pan(PanDirection.Right, 10); } protected void pan_up_Click(object sender, EventArgs e) { Map1.Pan(PanDirection.Up, 10); } protected void pan_down_Click(object sender, EventArgs e) { Map1.Pan(PanDirection.Down, 10); } protected void ok_Click(object sender, EventArgs e) { if (option1.Selected) { Map1.MapTools.MouseMapTool.Enabled = option1.Selected; pan_left.Enabled = true; pan_right.Enabled = true; pan_up.Enabled = true; pan_down.Enabled = true; } else if (option2.Selected) { Map1.MapTools.KeyboardMapTool.Enabled = option2.Selected; pan_left.Enabled = false; pan_right.Enabled = false; pan_up.Enabled = false; pan_down.Enabled = false; } } protected void Map1_Click(object sender, MapClickedEventArgs e) { Collection FeatureSelected = new Collection(); foreach (Layer layer in Map1.DynamicOverlay.Layers) { layer.Open(); { Collection selectedFeatures = ((FeatureLayer)layer).QueryTools.GetFeaturesNearestTo(e.Position,GeographyUnit.DecimalDegree,1,ReturningColumnsType.AllColumns); foreach (Feature feature in selectedFeatures) { BaseShape currentShape = feature.GetShape(); if (currentShape is AreaBaseShape) { if (currentShape.Contains(e.Position)) { Collection selectedFeatures1 = ((FeatureLayer)layer).QueryTools.GetFeaturesContaining(e.Position, ReturningColumnsType.AllColumns); if (FeatureSelected.Count > 0) { Collection columns = ((FeatureLayer)layer).QueryTools.GetColumns(); DataTable table = new DataTable(); foreach (FeatureSourceColumn column in columns) { table.Columns.Add(column.ColumnName); } foreach (Feature feature1 in selectedFeatures1) { DataRow row = table.NewRow(); for (int i = 0; i < table.Columns.Count; i++) { row[i] = feature.ColumnValues[table.Columns[i].ColumnName]; } table.Rows.Add(row); } this.FeaturesGridView.DataSource = table; this.FeaturesGridView.DataBind(); break; } } } if (currentShape is PointBaseShape) { if (currentShape.Contains(e.Position)) { Collection selectedFeatures2 = ((FeatureLayer)layer).QueryTools.GetFeaturesNearestTo(e.Position, GeographyUnit.DecimalDegree, 1, ReturningColumnsType.AllColumns); if (FeatureSelected.Count > 0) { Collection columns = ((FeatureLayer)layer).QueryTools.GetColumns(); DataTable table = new DataTable(); foreach (FeatureSourceColumn column in columns) { table.Columns.Add(column.ColumnName); } foreach (Feature feature1 in selectedFeatures2) { DataRow row = table.NewRow(); for (int i = 0; i < table.Columns.Count; i++) { row[i] = feature.ColumnValues[table.Columns[i].ColumnName]; } table.Rows.Add(row); } this.FeaturesGridView.DataSource = table; this.FeaturesGridView.DataBind(); break; } } } if (currentShape is LineBaseShape) { if (currentShape.Contains(e.Position)) { Collection selectedFeatures3 = ((FeatureLayer)layer).QueryTools.GetFeaturesContaining(e.Position, ReturningColumnsType.AllColumns); if (FeatureSelected.Count > 0) { Collection columns = ((FeatureLayer)layer).QueryTools.GetColumns(); DataTable table = new DataTable(); foreach (FeatureSourceColumn column in columns) { table.Columns.Add(column.ColumnName); } foreach (Feature feature1 in selectedFeatures3) { DataRow row = table.NewRow(); for (int i = 0; i < table.Columns.Count; i++) { row[i] = feature.ColumnValues[table.Columns[i].ColumnName]; } table.Rows.Add(row); } this.FeaturesGridView.DataSource = table; this.FeaturesGridView.DataBind(); break; } } } } layer.Close(); } } } } }