diff --git a/GisDevelop_Exp/GisDevelop_Exp.csproj b/GisDevelop_Exp/GisDevelop_Exp.csproj index a4d043f..c2916e9 100644 --- a/GisDevelop_Exp/GisDevelop_Exp.csproj +++ b/GisDevelop_Exp/GisDevelop_Exp.csproj @@ -11,6 +11,9 @@ + + 100.15.0 + 200.5.0 diff --git a/GisDevelop_Exp/MainWindow.xaml b/GisDevelop_Exp/MainWindow.xaml index 9e2f539..24e4b1d 100644 --- a/GisDevelop_Exp/MainWindow.xaml +++ b/GisDevelop_Exp/MainWindow.xaml @@ -150,6 +150,8 @@ - + + + \ No newline at end of file diff --git a/GisDevelop_Exp/MainWindow.xaml.cs b/GisDevelop_Exp/MainWindow.xaml.cs index 85d0dd0..90321d4 100644 --- a/GisDevelop_Exp/MainWindow.xaml.cs +++ b/GisDevelop_Exp/MainWindow.xaml.cs @@ -51,6 +51,7 @@ enum CURRENTOPERATION DelFeature, AddPolygonFeature, ModifyFeature, + SketchEdit } namespace GisDevelop_Exp @@ -92,17 +93,17 @@ namespace GisDevelop_Exp private readonly Dictionary _basemapOptions = new Dictionary() { - { "Streets (Raster)", new Basemap(BasemapStyle.OSMStreets) }, - { "Streets (Vector)", new Basemap(BasemapStyle.OSMStreetsRelief) }, - { "Streets - Night (Vector)", new Basemap(BasemapStyle.ArcGISStreetsNight) }, - { "Imagery (Raster)", new Basemap(BasemapStyle.ArcGISImagery) }, - { "Imagery with Labels (Raster)", new Basemap(BasemapStyle.ArcGISImageryLabels) }, - { "Imagery with Labels (Vector)", new Basemap(BasemapStyle.ArcGISImageryStandard) }, - { "Dark Gray Canvas (Vector)", new Basemap(BasemapStyle.ArcGISDarkGray) }, - { "Light Gray Canvas (Raster)", new Basemap(BasemapStyle.ArcGISLightGray) }, - { "Light Gray Canvas (Vector)", new Basemap(BasemapStyle.ArcGISLightGrayBase) }, - { "Navigation (Vector)", new Basemap(BasemapStyle.ArcGISNavigation) }, - { "OpenStreetMap (Raster)", new Basemap(BasemapStyle.OSMNavigation) } + { "OSMStreets", new Basemap(BasemapStyle.OSMStreets) }, + { "OSMStreetsRelief", new Basemap(BasemapStyle.OSMStreetsRelief) }, + { "ArcGISStreetsNight", new Basemap(BasemapStyle.ArcGISStreetsNight) }, + { "ArcGISImagery", new Basemap(BasemapStyle.ArcGISImagery) }, + { "ArcGISImageryLabels", new Basemap(BasemapStyle.ArcGISImageryLabels) }, + { "ArcGISImageryStandard", new Basemap(BasemapStyle.ArcGISImageryStandard) }, + { "ArcGISDarkGray", new Basemap(BasemapStyle.ArcGISDarkGray) }, + { "ArcGISLightGray", new Basemap(BasemapStyle.ArcGISLightGray) }, + { "ArcGISLightGrayBase", new Basemap(BasemapStyle.ArcGISLightGrayBase) }, + { "ArcGISNavigation", new Basemap(BasemapStyle.ArcGISNavigation) }, + { "OSMNavigation", new Basemap(BasemapStyle.OSMNavigation) } }; private CURRENTOPERATION m_CurOper; @@ -951,8 +952,7 @@ namespace GisDevelop_Exp aMap.InitialViewpoint = geodatabaseViewPoint; MainMapView.Map = aMap; } - - AddLayerNameToList(); + // AddLayerNameToList(); } private void LayerListBox_OnPreviewMouseMove(object sender, MouseEventArgs e) @@ -1456,11 +1456,8 @@ namespace GisDevelop_Exp private async void SetClassBreaksRender(FeatureLayer pLayer, string sFieldName, int ClassifyCount = 5, List pSymbolList = null) { - //ClassBreaksRenderer ClassBreaksRenderer pCBRenderer = new ClassBreaksRenderer(); - //设置字段名 pCBRenderer.FieldName = sFieldName; - //设置统计查询条件, StatisticDefinition statDefinitionMin = new StatisticDefinition(sFieldName, StatisticType.Minimum, ""); StatisticDefinition statDefinitionMax = new StatisticDefinition(sFieldName, StatisticType.Maximum, ""); List statDefinitions = new List @@ -1469,13 +1466,10 @@ namespace GisDevelop_Exp statDefinitionMax, }; StatisticsQueryParameters pQueryPara = new StatisticsQueryParameters(statDefinitions); - //执行统计查询 StatisticsQueryResult queryResult = await pLayer.FeatureTable.QueryStatisticsAsync(pQueryPara); - //从统计结果中获取最大值,获取最小值 string str; object max = null, min = null; double dMax, dMin; - //获取该字段的最大值,最小值,为后续分级做准备 IReadOnlyDictionary sResult = queryResult.First().Statistics; for (int i = 0; i < sResult.Count; i++) { @@ -1485,14 +1479,11 @@ namespace GisDevelop_Exp if (str.Contains("MIN")) min = sResult.Values.ElementAt(i); } - dMax = (double)(max); dMin = (double)(min); - //计算并设置分级中每一级别的范围,以及符号 for (int i = 0; i < ClassifyCount; i++) { ClassBreak pClassBreak = new ClassBreak(); - //每一级别范围的最大值、最小值 if (i == 0) pClassBreak.MinValue = dMin; else @@ -1500,16 +1491,12 @@ namespace GisDevelop_Exp ; pClassBreak.MaxValue = dMin + (dMax - dMin) * (i + 1) / ClassifyCount; Color tempColor = Color.FromArgb(i * 50 + 10, 255, 255); - //创建符号,这里图层为面层,直接创建面符号,注意若图层为 点层、线层,需创建对应的点符号、线符号 SimpleLineSymbol tempSymbol2 = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Gray, 1); Symbol pSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, tempColor, tempSymbol2); pClassBreak.Symbol = pSymbol; - //将设置好的ClassBreak放入ClassBreaksRenderer中。 pCBRenderer.ClassBreaks.Add(pClassBreak); } - - //将创建好的ClassBreaksRenderer 赋值给图层 pLayer.Renderer = pCBRenderer; } @@ -1639,6 +1626,7 @@ namespace GisDevelop_Exp { try { + m_CurOper = CURRENTOPERATION.SketchEdit; BtnCancel.IsEnabled = true; BtnRedo.IsEnabled = true; BtnUndo.IsEnabled = true;