using System; 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) { Map1.MapTools.Logo.Enabled = false; //Map1.MapTools.Logo.ImageUri = new Uri(@"C:\Users\Administrator\Documents\Visual Studio 2008\Projects\displaymap\displaymap\zoom_in.jpg"); DisplayMap(); } 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; ShapeFileFeatureLayer worldLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\World\cntry02.shp"); 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); ShapeFileFeatureLayer indiaStatesLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\India\indiastates.shp"); 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); ShapeFileFeatureLayer MumbaiAdminShapeLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\administrative.shp"); 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); ShapeFileFeatureLayer MumbaiWaterShapeLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\waterbodies.shp"); 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); ShapeFileFeatureLayer MumbaiMajorRoadsShapeLayer = new ShapeFileFeatureLayer(@"C:\Program Files\ThinkGeo\Map Suite Web Full Edition 3.0\Samples\CSharp Samples\SampleData\Mumbai-layers\roads.shp"); MumbaiMajorRoadsShapeLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(LineStyles.MajorRoad1); MumbaiMajorRoadsShapeLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level15; 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.Level15; 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.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); Map1.StaticOverlay.Redraw(); } protected void zoom_in_mumbai_Click(object sender, EventArgs e) { Map1.CurrentExtent = new RectangleShape(72.650, 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) { foreach (Layer layer in Map1.StaticOverlay.Layers) { if (layer is FeatureLayer) { layer.Open(); Collection selectedFeatures = ((FeatureLayer)layer).QueryTools.GetFeaturesContaining(e.Position, ReturningColumnsType.AllColumns); if (selectedFeatures.Count > 0) { Collection columns = ((FeatureLayer)layer).QueryTools.GetColumns(); DataTable table = new DataTable(); foreach (FeatureSourceColumn column in columns) { table.Columns.Add(column.ColumnName); } foreach (Feature feature in selectedFeatures) { 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(); } } } } }