Modify to Modern UI
This commit is contained in:
parent
45943b7e55
commit
a5c55fedc3
@ -3,8 +3,14 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:local="clr-namespace:GisDevelop_Exp"
|
xmlns:local="clr-namespace:GisDevelop_Exp"
|
||||||
Startup="Application_Startup"
|
Startup="Application_Startup"
|
||||||
StartupUri="MainWindow.xaml">
|
StartupUri="MainWindow.xaml"
|
||||||
|
xmlns:ui="http://schemas.modernwpf.com/2019">
|
||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<ResourceDictionary.MergedDictionaries>
|
||||||
|
<ui:ThemeResources />
|
||||||
|
<ui:XamlControlsResources />
|
||||||
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
</Application>
|
</Application>
|
||||||
|
|||||||
@ -5,23 +5,27 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:GisDevelop_Exp"
|
xmlns:local="clr-namespace:GisDevelop_Exp"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="按属性查询" Height="323" Width="422"
|
ResizeMode="NoResize"
|
||||||
Loaded="AttributeQuery_OnLoaded">
|
Title="按属性查询" Height="330" Width="422"
|
||||||
|
Loaded="AttributeQuery_OnLoaded"
|
||||||
|
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||||
|
ui:WindowHelper.UseModernWindowStyle="True"
|
||||||
|
ui:ThemeManager.RequestedTheme="Light">
|
||||||
<Canvas Margin="0,0,370,0">
|
<Canvas Margin="0,0,370,0">
|
||||||
<Label Content="选择图层" Canvas.Left="50" Canvas.Top="36"/>
|
<Label Content="选择图层" Canvas.Left="50" Canvas.Top="36"/>
|
||||||
<ComboBox x:Name="comboBoxLayers" Canvas.Left="121" Canvas.Top="40" Width="243" HorizontalAlignment="Left" VerticalAlignment="Center" SelectionChanged="ComboBoxLayers_OnSelectionChanged"/>
|
<ComboBox x:Name="comboBoxLayers" Canvas.Left="121" Canvas.Top="40" Width="243" HorizontalAlignment="Left" VerticalAlignment="Center" SelectionChanged="ComboBoxLayers_OnSelectionChanged"/>
|
||||||
<ListBox x:Name="listBoxFields" Height="108" Width="123" d:ItemsSource="{d:SampleData ItemCount=5}" HorizontalAlignment="Left" Canvas.Top="84" VerticalAlignment="Center" Canvas.Left="36" SelectionChanged="ListBoxFields_OnSelectionChanged" MouseDoubleClick="ListBoxFields_OnMouseDoubleClick"/>
|
<ListBox x:Name="listBoxFields" Height="108" Width="123" d:ItemsSource="{d:SampleData ItemCount=5}" HorizontalAlignment="Left" Canvas.Top="84" VerticalAlignment="Center" Canvas.Left="36" SelectionChanged="ListBoxFields_OnSelectionChanged" MouseDoubleClick="ListBoxFields_OnMouseDoubleClick"/>
|
||||||
<ListBox x:Name="listBoxFieldValue" Height="108" Width="124" d:ItemsSource="{d:SampleData ItemCount=5}" Canvas.Top="84" Canvas.Left="276" HorizontalAlignment="Left" VerticalAlignment="Center" MouseDoubleClick="ListBoxFieldValue_OnMouseDoubleClick"/>
|
<ListBox x:Name="listBoxFieldValue" Height="108" Width="124" d:ItemsSource="{d:SampleData ItemCount=5}" Canvas.Top="84" Canvas.Left="285" HorizontalAlignment="Left" VerticalAlignment="Center" MouseDoubleClick="ListBoxFieldValue_OnMouseDoubleClick"/>
|
||||||
<Button x:Name="buttonEqual" Content="=" Canvas.Left="179" Canvas.Top="105" HorizontalAlignment="Left" VerticalAlignment="Top" Width="21" Height="22" MouseDoubleClick="OperatorButtonClick"/>
|
<Button x:Name="buttonEqual" Content="=" Canvas.Left="168" Canvas.Top="84" VerticalAlignment="Top" Width="32" Height="32" MouseDoubleClick="OperatorButtonClick"/>
|
||||||
<Button x:Name="buttonNotEqual" Content="<>" Canvas.Left="200" Canvas.Top="105" Width="21" Height="22" HorizontalAlignment="Left" VerticalAlignment="Top" MouseDoubleClick="OperatorButtonClick"/>
|
<Button x:Name="buttonNotEqual" Content="<>" Canvas.Left="200" Canvas.Top="84" Width="32" Height="32" VerticalAlignment="Top" MouseDoubleClick="OperatorButtonClick"/>
|
||||||
<Button x:Name="buttonLike" Content="Like" Canvas.Left="221" Canvas.Top="105" Width="30" Height="22" HorizontalAlignment="Left" VerticalAlignment="Top" MouseDoubleClick="OperatorButtonClick"/>
|
<Button x:Name="buttonLike" Content="Like" Canvas.Left="232" Canvas.Top="84" Width="48" Height="32" MouseDoubleClick="OperatorButtonClick"/>
|
||||||
<Button x:Name="buttonLessThan" Content="<" Canvas.Left="179" Canvas.Top="127" Width="21" Height="22" HorizontalAlignment="Left" VerticalAlignment="Top" MouseDoubleClick="OperatorButtonClick"/>
|
<Button x:Name="buttonLessThan" Content="<" Canvas.Left="168" Canvas.Top="117" Width="32" Height="32" MouseDoubleClick="OperatorButtonClick" HorizontalAlignment="Center"/>
|
||||||
<Button x:Name="buttonLessEqual" Content="<=" Canvas.Left="200" Canvas.Top="127" Width="21" Height="22" HorizontalAlignment="Left" VerticalAlignment="Top" MouseDoubleClick="OperatorButtonClick"/>
|
<Button x:Name="buttonLessEqual" Content="<=" Canvas.Left="168" Canvas.Top="149" Width="32" Height="32" VerticalAlignment="Top" MouseDoubleClick="OperatorButtonClick"/>
|
||||||
<Button x:Name="buttonAnd" Content="And" Canvas.Left="221" Canvas.Top="127" Width="30" Height="22" HorizontalAlignment="Left" VerticalAlignment="Top" MouseDoubleClick="OperatorButtonClick"/>
|
<Button x:Name="buttonAnd" Content="And" Canvas.Left="232" Canvas.Top="117" Width="48" Height="32" MouseDoubleClick="OperatorButtonClick"/>
|
||||||
<Button x:Name="buttonGreaterThan" Content=">" Canvas.Left="179" Canvas.Top="149" Width="21" Height="22" HorizontalAlignment="Left" VerticalAlignment="Top" MouseDoubleClick="OperatorButtonClick"/>
|
<Button x:Name="buttonGreaterThan" Content=">" Canvas.Left="200" Canvas.Top="117" Width="32" Height="32" VerticalAlignment="Top" MouseDoubleClick="OperatorButtonClick"/>
|
||||||
<Button x:Name="buttonGreaterEqual" Content=">=" Canvas.Left="200" Canvas.Top="149" Width="21" Height="22" HorizontalAlignment="Left" VerticalAlignment="Top" MouseDoubleClick="OperatorButtonClick"/>
|
<Button x:Name="buttonGreaterEqual" Content=">=" Canvas.Left="200" Canvas.Top="149" Width="32" Height="32" MouseDoubleClick="OperatorButtonClick" VerticalAlignment="Top"/>
|
||||||
<Button x:Name="buttonOr" Content="Or" Canvas.Left="221" Canvas.Top="149" Width="30" Height="22" HorizontalAlignment="Left" VerticalAlignment="Top" MouseDoubleClick="OperatorButtonClick"/>
|
<Button x:Name="buttonOr" Content="Or" Canvas.Left="232" Canvas.Top="149" Width="48" Height="32" VerticalAlignment="Top" MouseDoubleClick="OperatorButtonClick"/>
|
||||||
<TextBox x:Name="textBoxWhere" Canvas.Left="36" TextWrapping="Wrap" Text="TextBox" Canvas.Top="212" Width="364" HorizontalAlignment="Left" VerticalAlignment="Center" Height="29"/>
|
<TextBox x:Name="textBoxWhere" Canvas.Left="36" TextWrapping="Wrap" Text="TextBox" Canvas.Top="216" Width="364" HorizontalAlignment="Center" VerticalAlignment="Top" Height="29"/>
|
||||||
<Button Content="确认" Canvas.Left="36" Canvas.Top="262" RenderTransformOrigin="-0.278,-0.098" HorizontalAlignment="Left" VerticalAlignment="Center" Width="72" Click="ButtonBase_OK_OnClick"/>
|
<Button Content="确认" Canvas.Left="36" Canvas.Top="262" RenderTransformOrigin="-0.278,-0.098" HorizontalAlignment="Left" VerticalAlignment="Center" Width="72" Click="ButtonBase_OK_OnClick"/>
|
||||||
<Button Content="取消" Canvas.Left="328" Canvas.Top="262" RenderTransformOrigin="-0.278,-0.098" Width="72" HorizontalAlignment="Left" VerticalAlignment="Center" Click="ButtonBase_Cancel_OnClick"/>
|
<Button Content="取消" Canvas.Left="328" Canvas.Top="262" RenderTransformOrigin="-0.278,-0.098" Width="72" HorizontalAlignment="Left" VerticalAlignment="Center" Click="ButtonBase_Cancel_OnClick"/>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
|
|||||||
@ -6,11 +6,15 @@
|
|||||||
xmlns:local="clr-namespace:GisDevelop_Exp"
|
xmlns:local="clr-namespace:GisDevelop_Exp"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="拉框选择结果窗口" Height="450" Width="316"
|
Title="拉框选择结果窗口" Height="450" Width="316"
|
||||||
Activated="LocationQueryResultsWindow_OnActivated">
|
Activated="LocationQueryResultsWindow_OnActivated"
|
||||||
|
ResizeMode="NoResize"
|
||||||
|
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||||
|
ui:WindowHelper.UseModernWindowStyle="True"
|
||||||
|
ui:ThemeManager.RequestedTheme="Light">
|
||||||
<Canvas>
|
<Canvas>
|
||||||
<ComboBox x:Name="comboBoxLayer" Canvas.Left="10" Canvas.Top="10" Width="164" HorizontalAlignment="Left" VerticalAlignment="Center" SelectionChanged="ComboBoxLayer_OnSelectionChanged"/>
|
<ComboBox x:Name="comboBoxLayer" Canvas.Left="10" Canvas.Top="10" Width="164" HorizontalAlignment="Left" VerticalAlignment="Center" SelectionChanged="ComboBoxLayer_OnSelectionChanged"/>
|
||||||
<ComboBox x:Name="comboBoxRecord" Canvas.Left="174" Canvas.Top="10" Width="132" HorizontalAlignment="Left" VerticalAlignment="Center" SelectionChanged="ComboBoxRecord_OnSelectionChanged"/>
|
<ComboBox x:Name="comboBoxRecord" Canvas.Left="174" Canvas.Top="10" Width="132" HorizontalAlignment="Left" VerticalAlignment="Center" SelectionChanged="ComboBoxRecord_OnSelectionChanged"/>
|
||||||
<DataGrid x:Name="dataGridContent" Height="377" Width="286" d:ItemsSource="{d:SampleData ItemCount=5}" HorizontalAlignment="Center" Canvas.Top="37" VerticalAlignment="Top" Canvas.Left="20"/>
|
<DataGrid x:Name="dataGridContent" Height="355" Width="296" d:ItemsSource="{d:SampleData ItemCount=5}" HorizontalAlignment="Left" Canvas.Top="59" VerticalAlignment="Center" Canvas.Left="10"/>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
|
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@ -11,9 +11,13 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Esri.ArcGISRuntime.Toolkit">
|
||||||
|
<Version>100.15.0</Version>
|
||||||
|
</PackageReference>
|
||||||
<PackageReference Include="Esri.ArcGISRuntime.WPF">
|
<PackageReference Include="Esri.ArcGISRuntime.WPF">
|
||||||
<Version>200.5.0</Version>
|
<Version>200.5.0</Version>
|
||||||
</PackageReference>
|
</PackageReference>
|
||||||
|
<PackageReference Include="ModernWpfUI" Version="0.9.6" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -7,11 +7,15 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="LocationQueryResultsWindow" Height="450" Width="316"
|
Title="LocationQueryResultsWindow" Height="450" Width="316"
|
||||||
Activated="LocationQueryResultsWindow_OnActivated"
|
Activated="LocationQueryResultsWindow_OnActivated"
|
||||||
Closed="LocationQueryResultsWindow_OnClosed">
|
Closed="LocationQueryResultsWindow_OnClosed"
|
||||||
|
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||||
|
ResizeMode="NoResize"
|
||||||
|
ui:WindowHelper.UseModernWindowStyle="True"
|
||||||
|
ui:ThemeManager.RequestedTheme="Light">
|
||||||
<Canvas>
|
<Canvas>
|
||||||
<ComboBox x:Name="comboBoxLayer" Canvas.Left="10" Canvas.Top="10" Width="164" HorizontalAlignment="Left" VerticalAlignment="Center" SelectionChanged="ComboBoxLayer_OnSelectionChanged"/>
|
<ComboBox x:Name="comboBoxLayer" Canvas.Left="10" Canvas.Top="10" Width="164" HorizontalAlignment="Left" VerticalAlignment="Center" SelectionChanged="ComboBoxLayer_OnSelectionChanged"/>
|
||||||
<ComboBox x:Name="comboBoxRecord" Canvas.Left="174" Canvas.Top="10" Width="132" HorizontalAlignment="Left" VerticalAlignment="Center" SelectionChanged="ComboBoxRecord_OnSelectionChanged"/>
|
<ComboBox x:Name="comboBoxRecord" Canvas.Left="174" Canvas.Top="10" Width="132" HorizontalAlignment="Left" VerticalAlignment="Center" SelectionChanged="ComboBoxRecord_OnSelectionChanged"/>
|
||||||
<DataGrid x:Name="dataGridContent" Height="377" Width="286" d:ItemsSource="{d:SampleData ItemCount=5}" HorizontalAlignment="Center" Canvas.Top="37" VerticalAlignment="Top" Canvas.Left="20"/>
|
<DataGrid x:Name="dataGridContent" Height="355" Width="296" d:ItemsSource="{d:SampleData ItemCount=5}" HorizontalAlignment="Left" Canvas.Top="59" VerticalAlignment="Center" Canvas.Left="10"/>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
|
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@ -6,12 +6,17 @@
|
|||||||
xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
|
xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
|
||||||
xmlns:local="clr-namespace:GisDevelop_Exp"
|
xmlns:local="clr-namespace:GisDevelop_Exp"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="GIS开发实验" Height="450" Width="800"
|
Title="GIS开发实验" Height="500" Width="800"
|
||||||
MouseLeftButtonDown="LayerListBox_OnPreviewMouseLeftButtonDown">
|
MaxHeight="500" MaxWidth="800"
|
||||||
|
ResizeMode="CanMinimize"
|
||||||
|
MouseLeftButtonDown="LayerListBox_OnPreviewMouseLeftButtonDown"
|
||||||
|
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||||
|
ui:WindowHelper.UseModernWindowStyle="True"
|
||||||
|
ui:ThemeManager.RequestedTheme="Light">
|
||||||
<Window.Resources>
|
<Window.Resources>
|
||||||
<local:MapViewModel x:Key="MapViewModel" />
|
<local:MapViewModel x:Key="MapViewModel" />
|
||||||
</Window.Resources>
|
</Window.Resources>
|
||||||
<Grid>
|
<ui:SimpleStackPanel>
|
||||||
<Menu x:Name="MenuContainer" Margin="0,0,0,0">
|
<Menu x:Name="MenuContainer" Margin="0,0,0,0">
|
||||||
<MenuItem x:Name="Menu_File" Header="文件">
|
<MenuItem x:Name="Menu_File" Header="文件">
|
||||||
<MenuItem x:Name="Menu_OpenShp" Header="打开Shp" Click="Menu_OpenShp_Click" />
|
<MenuItem x:Name="Menu_OpenShp" Header="打开Shp" Click="Menu_OpenShp_Click" />
|
||||||
@ -69,72 +74,33 @@
|
|||||||
<MenuItem x:Name="Menu_Modify" Header="修改" Click="Menu_Modify_OnClick"></MenuItem>
|
<MenuItem x:Name="Menu_Modify" Header="修改" Click="Menu_Modify_OnClick"></MenuItem>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
<esri:MapView x:Name="MainMapView" Map="{Binding Map, Source={StaticResource MapViewModel}}" Margin="0,19,0,0"
|
<Grid Margin="0,0,0,0">
|
||||||
ViewpointChanged="MainMapView_OnViewpointChanged" GeoViewTapped="MainMapView_OnGeoViewTapped"
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="32">
|
||||||
|
</RowDefinition>
|
||||||
|
<RowDefinition Height="400">
|
||||||
|
</RowDefinition>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Grid Grid.Row="1">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="150"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="650"></ColumnDefinition>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid Grid.Column="1">
|
||||||
|
<esri:MapView x:Name="MainMapView" Map="{Binding Map, Source={StaticResource MapViewModel}}"
|
||||||
|
Margin="0,0,0,0"
|
||||||
|
ViewpointChanged="MainMapView_OnViewpointChanged"
|
||||||
|
GeoViewTapped="MainMapView_OnGeoViewTapped"
|
||||||
MouseLeftButtonDown="MainMapView_OnMouseLeftButtonDown"
|
MouseLeftButtonDown="MainMapView_OnMouseLeftButtonDown"
|
||||||
MouseRightButtonDown="MainMapView_OnMouseRightButtonDown"/>
|
MouseRightButtonDown="MainMapView_OnMouseRightButtonDown" />
|
||||||
<ListBox x:Name="LayerListBox" Width="143" SelectedIndex="0" RenderTransformOrigin="0.451,1.105"
|
<Border BorderBrush="#FF8B1D76" BorderThickness="2,2,2,2" HorizontalAlignment="Right" Height="180"
|
||||||
Margin="0,56,0,13" HorizontalAlignment="Left" PreviewMouseMove="LayerListBox_OnPreviewMouseMove"
|
Width="180"
|
||||||
Drop="LayerListBox_OnDrop" PreviewMouseRightButtonDown="LayerListBox_OnPreviewMouseRightButtonDown"
|
|
||||||
PreviewMouseLeftButtonDown="LayerListBox_OnPreviewMouseLeftButtonDown">
|
|
||||||
<!-- <ListBox.ContextMenu> -->
|
|
||||||
<!-- <ContextMenu> -->
|
|
||||||
<!-- <MenuItem Header="删除" x:Name="Context_Menu_Delete" Click="Context_Menu_Delete_OnClick"/> -->
|
|
||||||
<!-- <MenuItem Header="缩放至图层" x:Name="Context_Menu_Fit" Click="Context_Menu_Fit_OnClick"/> -->
|
|
||||||
<!-- <MenuItem Header="图层符号化" x:Name="Context_Menu_Symbology" Click="Context_Menu_Symbology_OnClick"/> -->
|
|
||||||
<!-- </ContextMenu> -->
|
|
||||||
<!-- </ListBox.ContextMenu> -->
|
|
||||||
</ListBox>
|
|
||||||
<Popup x:Name="Layer_Popup" Placement="MousePoint" StaysOpen="True">
|
|
||||||
<Border Background="White" BorderBrush="Gray" BorderThickness="0.5">
|
|
||||||
<StackPanel>
|
|
||||||
<MenuItem Header="删除" x:Name="Context_Menu_Delete" Click="Context_Menu_Delete_OnClick" />
|
|
||||||
<MenuItem Header="缩放至图层" x:Name="Context_Menu_Fit" Click="Context_Menu_Fit_OnClick" />
|
|
||||||
<MenuItem Header="图层符号化" x:Name="Context_Menu_Symbology" Click="Context_Menu_Symbology_OnClick" />
|
|
||||||
</StackPanel>
|
|
||||||
</Border>
|
|
||||||
</Popup>
|
|
||||||
<Border BorderBrush="#FF8B1D76" BorderThickness="2,2,2,2" HorizontalAlignment="Right" Height="180" Width="202"
|
|
||||||
VerticalAlignment="Top" IsEnabled="False">
|
VerticalAlignment="Top" IsEnabled="False">
|
||||||
<esri:MapView x:Name="EagleMapView" />
|
<esri:MapView x:Name="EagleMapView" />
|
||||||
</Border>
|
</Border>
|
||||||
<Border BorderBrush="#000000" BorderThickness="1" HorizontalAlignment="Right" Height="24" Width="202"
|
|
||||||
VerticalAlignment="Top" IsEnabled="True" Margin="580,210,0,0"
|
|
||||||
Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
|
|
||||||
<ComboBox x:Name="BasemapChooser" HorizontalAlignment="Left" Height="24" Margin="9,-1,0,-1"
|
|
||||||
VerticalAlignment="Top" Width="182" SelectionChanged="BasemapChooser_OnSelectionChanged"
|
|
||||||
IsEnabled="True" />
|
|
||||||
</Border>
|
|
||||||
<Grid Margin="0,18,0,350" Background="White">
|
|
||||||
<Button x:Name="BtnDraw" Content="开始绘制" HorizontalAlignment="Left" Height="26"
|
|
||||||
Margin="169,4,0,0" VerticalAlignment="Top" Width="68" Click="BtnDraw_Click" IsEnabled="False" />
|
|
||||||
<Label Content="类型" HorizontalAlignment="Left" Margin="51,4,0,0"
|
|
||||||
VerticalAlignment="Top" RenderTransformOrigin="1.618,0.654" />
|
|
||||||
<ComboBox x:Name="SketchModeComboBox" HorizontalAlignment="Left" Margin="90,4,0,0"
|
|
||||||
VerticalAlignment="Top" Width="62" IsEnabled="False" />
|
|
||||||
<Button x:Name="BtnEdit" Content="编辑 " HorizontalAlignment="Left" Height="26"
|
|
||||||
Margin="257,4,0,0" VerticalAlignment="Top" Width="68" IsEnabled="False" Click="BtnEdit_Click" />
|
|
||||||
<Button x:Name="BtnUndo" Content="撤销 " HorizontalAlignment="Left" Height="26"
|
|
||||||
Margin="349,4,0,0" VerticalAlignment="Top" Width="68" Command="{Binding UndoCommand}"
|
|
||||||
IsEnabled="False" />
|
|
||||||
<Button x:Name="BtnRedo" Content="恢复" HorizontalAlignment="Left" Height="26"
|
|
||||||
Margin="440,4,0,0" VerticalAlignment="Top" Width="68" Command="{Binding RedoCommand}"
|
|
||||||
IsEnabled="False" />
|
|
||||||
<Button x:Name="BtnComplete" Content="完成" HorizontalAlignment="Left" Height="26"
|
|
||||||
Margin="525,4,0,0" VerticalAlignment="Top" Width="68" RenderTransformOrigin="1.412,0.308"
|
|
||||||
Command="{Binding CompleteCommand}" IsEnabled="False" />
|
|
||||||
<Button x:Name="BtnCancel" Content="取消" HorizontalAlignment="Left" Height="26"
|
|
||||||
Margin="610,4,0,0" VerticalAlignment="Top" Width="68" RenderTransformOrigin="1.412,0.308"
|
|
||||||
Command="{Binding CancelCommand}" IsEnabled="False" />
|
|
||||||
<Button x:Name="BtnClear" Content="清空" HorizontalAlignment="Left" Height="26"
|
|
||||||
Margin="695,4,0,0" VerticalAlignment="Top" Width="68" RenderTransformOrigin="1.412,0.308"
|
|
||||||
IsEnabled="False" Click="BtnClear_Click" />
|
|
||||||
<CheckBox x:Name="CBEditBegin" Content="开始" HorizontalAlignment="Left"
|
|
||||||
Margin="5,9,0,0" VerticalAlignment="Top" RenderTransformOrigin="1.073,1.812"
|
|
||||||
Checked="CBEditBegin_Checked" />
|
|
||||||
</Grid>
|
|
||||||
<Border HorizontalAlignment="Right" VerticalAlignment="Bottom">
|
<Border HorizontalAlignment="Right" VerticalAlignment="Bottom">
|
||||||
<ToolBar HorizontalAlignment="Left" Height="32" VerticalAlignment="Top" Width="150" Margin="0,0,10,10"
|
<ToolBar HorizontalAlignment="Left" Height="32" VerticalAlignment="Top" Width="150"
|
||||||
|
Margin="0,0,10,10"
|
||||||
x:Name="MovableToolbar">
|
x:Name="MovableToolbar">
|
||||||
<Button x:Name="Btn_Add_Shp" Height="32" Width="32" Click="Menu_OpenShp_Click">
|
<Button x:Name="Btn_Add_Shp" Height="32" Width="32" Click="Menu_OpenShp_Click">
|
||||||
<Button.Background>
|
<Button.Background>
|
||||||
@ -150,6 +116,91 @@
|
|||||||
</Button>
|
</Button>
|
||||||
</ToolBar>
|
</ToolBar>
|
||||||
</Border>
|
</Border>
|
||||||
|
<esri:MeasureToolbar HorizontalAlignment="Left" Margin="0,0,0,0" VerticalAlignment="Top"
|
||||||
|
Height="32" MapView="{Binding ElementName=MainMapView, Mode=OneWay}" />
|
||||||
|
<esri:Compass HorizontalAlignment="Left" Margin="155,300,0,0"
|
||||||
|
GeoView="{Binding ElementName=MainMapView, Mode=OneWay}" />
|
||||||
|
<esri:ScaleLine Margin="155,350,0,0" VerticalAlignment="Top" Width="124" Height="47"
|
||||||
|
MapView="{Binding ElementName=MainMapView, Mode=OneWay}" />
|
||||||
|
<Border BorderBrush="#000000" BorderThickness="0" HorizontalAlignment="Right" Height="32"
|
||||||
|
Width="202"
|
||||||
|
VerticalAlignment="Top" IsEnabled="True" Margin="420,210,0,0">
|
||||||
|
<ComboBox x:Name="BasemapChooser" HorizontalAlignment="Right" Height="32" Margin="0,0,0,0"
|
||||||
|
VerticalAlignment="Top" Width="182"
|
||||||
|
SelectionChanged="BasemapChooser_OnSelectionChanged"
|
||||||
|
IsEnabled="True" />
|
||||||
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<ListBox x:Name="LayerListBox" Width="143" SelectedIndex="0" RenderTransformOrigin="0.451,1.105"
|
||||||
|
Margin="0,0,0,0" HorizontalAlignment="Left"
|
||||||
|
PreviewMouseMove="LayerListBox_OnPreviewMouseMove"
|
||||||
|
Drop="LayerListBox_OnDrop"
|
||||||
|
PreviewMouseRightButtonDown="LayerListBox_OnPreviewMouseRightButtonDown"
|
||||||
|
PreviewMouseLeftButtonDown="LayerListBox_OnPreviewMouseLeftButtonDown" Grid.Column="0">
|
||||||
|
|
||||||
|
</ListBox>
|
||||||
|
</Grid>
|
||||||
|
<!-- <ListBox.ContextMenu> -->
|
||||||
|
<!-- <ContextMenu> -->
|
||||||
|
<!-- <MenuItem Header="删除" x:Name="Context_Menu_Delete" Click="Context_Menu_Delete_OnClick"/> -->
|
||||||
|
<!-- <MenuItem Header="缩放至图层" x:Name="Context_Menu_Fit" Click="Context_Menu_Fit_OnClick"/> -->
|
||||||
|
<!-- <MenuItem Header="图层符号化" x:Name="Context_Menu_Symbology" Click="Context_Menu_Symbology_OnClick"/> -->
|
||||||
|
<!-- </ContextMenu> -->
|
||||||
|
<!-- </ListBox.ContextMenu> -->
|
||||||
|
|
||||||
|
<Popup x:Name="Layer_Popup" Placement="MousePoint" StaysOpen="True">
|
||||||
|
<Border Background="White" BorderBrush="Gray" BorderThickness="0.5">
|
||||||
|
<StackPanel>
|
||||||
|
<MenuItem Header="删除" x:Name="Context_Menu_Delete" Click="Context_Menu_Delete_OnClick" />
|
||||||
|
<MenuItem Header="缩放至图层" x:Name="Context_Menu_Fit" Click="Context_Menu_Fit_OnClick" />
|
||||||
|
<MenuItem Header="图层符号化" x:Name="Context_Menu_Symbology" Click="Context_Menu_Symbology_OnClick" />
|
||||||
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
|
</Popup>
|
||||||
|
|
||||||
|
|
||||||
|
<Grid Margin="0,0,0,0" Grid.Row="0" MaxHeight="48" Height="48">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="60"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="32"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="150"></ColumnDefinition>
|
||||||
|
<ColumnDefinition Width="95"></ColumnDefinition>
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
<ColumnDefinition></ColumnDefinition>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Button x:Name="BtnDraw" Content="开始绘制" HorizontalAlignment="Left" Height="32"
|
||||||
|
Margin="0,0,0,0" VerticalAlignment="Top" Width="84" Click="BtnDraw_Click" IsEnabled="False"
|
||||||
|
Grid.Column="3" />
|
||||||
|
<Label Content="类型" HorizontalAlignment="Left" Margin="0,5,0,0"
|
||||||
|
VerticalAlignment="Top" RenderTransformOrigin="1.618,0.654" Grid.Column="1" />
|
||||||
|
<ComboBox x:Name="SketchModeComboBox" HorizontalAlignment="Left" Margin="0,0,0,0"
|
||||||
|
VerticalAlignment="Top" Width="150" IsEnabled="False" Grid.Column="2" />
|
||||||
|
<Button x:Name="BtnEdit" Content="编辑 " HorizontalAlignment="Left" Height="32"
|
||||||
|
Margin="0,0,0,0" VerticalAlignment="Top" Width="68" IsEnabled="False" Click="BtnEdit_Click"
|
||||||
|
Grid.Column="4" />
|
||||||
|
<Button x:Name="BtnUndo" Content="撤销 " HorizontalAlignment="Left" Height="32"
|
||||||
|
Margin="0,0,0,0" VerticalAlignment="Top" Width="68" Command="{Binding UndoCommand}"
|
||||||
|
IsEnabled="False" Grid.Column="5" />
|
||||||
|
<Button x:Name="BtnRedo" Content="恢复" HorizontalAlignment="Left" Height="32"
|
||||||
|
Margin="0,0,0,0" VerticalAlignment="Top" Width="68" Command="{Binding RedoCommand}"
|
||||||
|
IsEnabled="False" Grid.Column="6" />
|
||||||
|
<Button x:Name="BtnComplete" Content="完成" HorizontalAlignment="Left" Height="32"
|
||||||
|
Margin="0,0,0,0" VerticalAlignment="Top" Width="68" RenderTransformOrigin="1.412,0.308"
|
||||||
|
Command="{Binding CompleteCommand}" IsEnabled="False" Grid.Column="7" />
|
||||||
|
<Button x:Name="BtnCancel" Content="取消" HorizontalAlignment="Left" Height="32"
|
||||||
|
Margin="0,0,0,0" VerticalAlignment="Top" Width="68" RenderTransformOrigin="1.412,0.308"
|
||||||
|
Command="{Binding CancelCommand}" IsEnabled="False" Grid.Column="8" />
|
||||||
|
<Button x:Name="BtnClear" Content="清空" HorizontalAlignment="Left" Height="32"
|
||||||
|
Margin="0,0,0,0" VerticalAlignment="Top" Width="68" RenderTransformOrigin="1.412,0.308"
|
||||||
|
IsEnabled="False" Click="BtnClear_Click" Grid.Column="9" />
|
||||||
|
<CheckBox x:Name="CBEditBegin" Content="开始" HorizontalAlignment="Left"
|
||||||
|
Margin="0,0,0,0" VerticalAlignment="Top" RenderTransformOrigin="1.073,1.812"
|
||||||
|
Checked="CBEditBegin_Checked" Grid.Column="0" />
|
||||||
|
</Grid>
|
||||||
|
</Grid>
|
||||||
|
</ui:SimpleStackPanel>
|
||||||
</Window>
|
</Window>
|
||||||
@ -51,6 +51,7 @@ enum CURRENTOPERATION
|
|||||||
DelFeature,
|
DelFeature,
|
||||||
AddPolygonFeature,
|
AddPolygonFeature,
|
||||||
ModifyFeature,
|
ModifyFeature,
|
||||||
|
SketchEdit
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace GisDevelop_Exp
|
namespace GisDevelop_Exp
|
||||||
@ -92,17 +93,17 @@ namespace GisDevelop_Exp
|
|||||||
|
|
||||||
private readonly Dictionary<string, Basemap> _basemapOptions = new Dictionary<string, Basemap>()
|
private readonly Dictionary<string, Basemap> _basemapOptions = new Dictionary<string, Basemap>()
|
||||||
{
|
{
|
||||||
{ "Streets (Raster)", new Basemap(BasemapStyle.OSMStreets) },
|
{ "OSMStreets", new Basemap(BasemapStyle.OSMStreets) },
|
||||||
{ "Streets (Vector)", new Basemap(BasemapStyle.OSMStreetsRelief) },
|
{ "OSMStreetsRelief", new Basemap(BasemapStyle.OSMStreetsRelief) },
|
||||||
{ "Streets - Night (Vector)", new Basemap(BasemapStyle.ArcGISStreetsNight) },
|
{ "ArcGISStreetsNight", new Basemap(BasemapStyle.ArcGISStreetsNight) },
|
||||||
{ "Imagery (Raster)", new Basemap(BasemapStyle.ArcGISImagery) },
|
{ "ArcGISImagery", new Basemap(BasemapStyle.ArcGISImagery) },
|
||||||
{ "Imagery with Labels (Raster)", new Basemap(BasemapStyle.ArcGISImageryLabels) },
|
{ "ArcGISImageryLabels", new Basemap(BasemapStyle.ArcGISImageryLabels) },
|
||||||
{ "Imagery with Labels (Vector)", new Basemap(BasemapStyle.ArcGISImageryStandard) },
|
{ "ArcGISImageryStandard", new Basemap(BasemapStyle.ArcGISImageryStandard) },
|
||||||
{ "Dark Gray Canvas (Vector)", new Basemap(BasemapStyle.ArcGISDarkGray) },
|
{ "ArcGISDarkGray", new Basemap(BasemapStyle.ArcGISDarkGray) },
|
||||||
{ "Light Gray Canvas (Raster)", new Basemap(BasemapStyle.ArcGISLightGray) },
|
{ "ArcGISLightGray", new Basemap(BasemapStyle.ArcGISLightGray) },
|
||||||
{ "Light Gray Canvas (Vector)", new Basemap(BasemapStyle.ArcGISLightGrayBase) },
|
{ "ArcGISLightGrayBase", new Basemap(BasemapStyle.ArcGISLightGrayBase) },
|
||||||
{ "Navigation (Vector)", new Basemap(BasemapStyle.ArcGISNavigation) },
|
{ "ArcGISNavigation", new Basemap(BasemapStyle.ArcGISNavigation) },
|
||||||
{ "OpenStreetMap (Raster)", new Basemap(BasemapStyle.OSMNavigation) }
|
{ "OSMNavigation", new Basemap(BasemapStyle.OSMNavigation) }
|
||||||
};
|
};
|
||||||
|
|
||||||
private CURRENTOPERATION m_CurOper;
|
private CURRENTOPERATION m_CurOper;
|
||||||
@ -176,6 +177,7 @@ namespace GisDevelop_Exp
|
|||||||
await MainMapView.SetViewpointGeometryAsync(openedFeature.Extent);
|
await MainMapView.SetViewpointGeometryAsync(openedFeature.Extent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AddLayerNameToList();
|
AddLayerNameToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,6 +213,7 @@ namespace GisDevelop_Exp
|
|||||||
MainMapView.Map.InitialViewpoint = geodatabaseViewPoint;
|
MainMapView.Map.InitialViewpoint = geodatabaseViewPoint;
|
||||||
// MainMapView.Map = geodatabaseMap;
|
// MainMapView.Map = geodatabaseMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddLayerNameToList();
|
AddLayerNameToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -710,32 +713,35 @@ namespace GisDevelop_Exp
|
|||||||
{
|
{
|
||||||
MessageBox.Show(ex.ToString(), "There was a problem.");
|
MessageBox.Show(ex.ToString(), "There was a problem.");
|
||||||
}
|
}
|
||||||
}else if ( m_CurOper == CURRENTOPERATION.AddPolygonFeature)
|
}
|
||||||
|
else if (m_CurOper == CURRENTOPERATION.AddPolygonFeature)
|
||||||
{
|
{
|
||||||
if (linePoints == null)
|
if (linePoints == null)
|
||||||
linePoints = new List<MapPoint>();
|
linePoints = new List<MapPoint>();
|
||||||
if (linesList == null)
|
if (linesList == null)
|
||||||
linesList = new List<Graphic>();
|
linesList = new List<Graphic>();
|
||||||
linePoints.Add(e.Location);//将当前点加入点集
|
linePoints.Add(e.Location); //将当前点加入点集
|
||||||
if (linePoints.Count >= 2)//如果点集中点数足够
|
if (linePoints.Count >= 2) //如果点集中点数足够
|
||||||
{
|
{
|
||||||
if (linesList.Count > 0 && linePoints.Count > 2)//已有加入的线图形,则移除当前的图形,重新加入新的图形
|
if (linesList.Count > 0 && linePoints.Count > 2) //已有加入的线图形,则移除当前的图形,重新加入新的图形
|
||||||
{
|
{
|
||||||
Graphic curGraphic = linesList[linesList.Count - 1];
|
Graphic curGraphic = linesList[linesList.Count - 1];
|
||||||
MainMapView.GraphicsOverlays[0].Graphics.Remove(curGraphic);
|
MainMapView.GraphicsOverlays[0].Graphics.Remove(curGraphic);
|
||||||
linesList.Remove(curGraphic);
|
linesList.Remove(curGraphic);
|
||||||
}
|
}
|
||||||
|
|
||||||
//SimpleLineSymbol lineSymbol = new SimpleLineSymbol();
|
//SimpleLineSymbol lineSymbol = new SimpleLineSymbol();
|
||||||
//lineSymbol.Color = Color.Blue;
|
//lineSymbol.Color = Color.Blue;
|
||||||
//lineSymbol.Style = SimpleLineSymbolStyle.Dash;
|
//lineSymbol.Style = SimpleLineSymbolStyle.Dash;
|
||||||
//lineSymbol.Width = 3;
|
//lineSymbol.Width = 3;
|
||||||
Esri.ArcGISRuntime.Geometry.Polygon line = new
|
Esri.ArcGISRuntime.Geometry.Polygon line = new
|
||||||
Esri.ArcGISRuntime.Geometry.Polygon(linePoints);//由点集构造线
|
Esri.ArcGISRuntime.Geometry.Polygon(linePoints); //由点集构造线
|
||||||
Graphic lineGraphic = new Graphic(line, fillSymbol);//由线创建图形
|
Graphic lineGraphic = new Graphic(line, fillSymbol); //由线创建图形
|
||||||
MainMapView.GraphicsOverlays[0].Graphics.Add(lineGraphic);//加入该图形元素到覆盖层中
|
MainMapView.GraphicsOverlays[0].Graphics.Add(lineGraphic); //加入该图形元素到覆盖层中
|
||||||
linesList.Add(lineGraphic);//同时,将该图形加入链表
|
linesList.Add(lineGraphic); //同时,将该图形加入链表
|
||||||
}
|
}
|
||||||
}else if (m_CurOper== CURRENTOPERATION.ModifyFeature)
|
}
|
||||||
|
else if (m_CurOper == CURRENTOPERATION.ModifyFeature)
|
||||||
{
|
{
|
||||||
if (_featureLayer == null)
|
if (_featureLayer == null)
|
||||||
return;
|
return;
|
||||||
@ -951,8 +957,7 @@ namespace GisDevelop_Exp
|
|||||||
aMap.InitialViewpoint = geodatabaseViewPoint;
|
aMap.InitialViewpoint = geodatabaseViewPoint;
|
||||||
MainMapView.Map = aMap;
|
MainMapView.Map = aMap;
|
||||||
}
|
}
|
||||||
|
// AddLayerNameToList();
|
||||||
AddLayerNameToList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LayerListBox_OnPreviewMouseMove(object sender, MouseEventArgs e)
|
private void LayerListBox_OnPreviewMouseMove(object sender, MouseEventArgs e)
|
||||||
@ -1024,7 +1029,8 @@ namespace GisDevelop_Exp
|
|||||||
Top = 5,
|
Top = 5,
|
||||||
Right = 0,
|
Right = 0,
|
||||||
Bottom = 5
|
Bottom = 5
|
||||||
}
|
},
|
||||||
|
Height = 32
|
||||||
};
|
};
|
||||||
Console.WriteLine(pLayers[i].Name);
|
Console.WriteLine(pLayers[i].Name);
|
||||||
cb.Content = pLayers[i].Name;
|
cb.Content = pLayers[i].Name;
|
||||||
@ -1054,7 +1060,7 @@ namespace GisDevelop_Exp
|
|||||||
CheckBox cb = sender as CheckBox;
|
CheckBox cb = sender as CheckBox;
|
||||||
cb.IsChecked = true;
|
cb.IsChecked = true;
|
||||||
int index = GetLayerIndex(cb.ToolTip as string);
|
int index = GetLayerIndex(cb.ToolTip as string);
|
||||||
MainMapView.Map.OperationalLayers[index-1].IsVisible = true;
|
MainMapView.Map.OperationalLayers[index - 1].IsVisible = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static class Utils
|
internal static class Utils
|
||||||
@ -1292,15 +1298,16 @@ namespace GisDevelop_Exp
|
|||||||
|
|
||||||
private void MainMapView_OnMouseRightButtonDown(object sender, MouseButtonEventArgs e)
|
private void MainMapView_OnMouseRightButtonDown(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
if (m_CurOper== CURRENTOPERATION.AddPolygonFeature && linePoints != null)
|
if (m_CurOper == CURRENTOPERATION.AddPolygonFeature && linePoints != null)
|
||||||
{
|
{
|
||||||
Polygon poly = new Polygon(linePoints);//由点集构造线
|
Polygon poly = new Polygon(linePoints); //由点集构造线
|
||||||
AddFeature(poly, _featureLayer);
|
AddFeature(poly, _featureLayer);
|
||||||
if (linePoints != null)
|
if (linePoints != null)
|
||||||
linePoints.Clear();
|
linePoints.Clear();
|
||||||
if (linesList != null)
|
if (linesList != null)
|
||||||
linesList.Clear();
|
linesList.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_CurOper = CURRENTOPERATION.NullOpe;
|
m_CurOper = CURRENTOPERATION.NullOpe;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1313,6 +1320,7 @@ namespace GisDevelop_Exp
|
|||||||
MessageBox.Show("几何类型和图层要素类型不匹配");
|
MessageBox.Show("几何类型和图层要素类型不匹配");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建要素
|
// 创建要素
|
||||||
Feature feature = (Feature)pFeatureL.FeatureTable.CreateFeature();
|
Feature feature = (Feature)pFeatureL.FeatureTable.CreateFeature();
|
||||||
feature.Geometry = pGeo;
|
feature.Geometry = pGeo;
|
||||||
@ -1456,11 +1464,8 @@ namespace GisDevelop_Exp
|
|||||||
private async void SetClassBreaksRender(FeatureLayer pLayer, string sFieldName, int ClassifyCount = 5,
|
private async void SetClassBreaksRender(FeatureLayer pLayer, string sFieldName, int ClassifyCount = 5,
|
||||||
List<Symbol> pSymbolList = null)
|
List<Symbol> pSymbolList = null)
|
||||||
{
|
{
|
||||||
//ClassBreaksRenderer
|
|
||||||
ClassBreaksRenderer pCBRenderer = new ClassBreaksRenderer();
|
ClassBreaksRenderer pCBRenderer = new ClassBreaksRenderer();
|
||||||
//设置字段名
|
|
||||||
pCBRenderer.FieldName = sFieldName;
|
pCBRenderer.FieldName = sFieldName;
|
||||||
//设置统计查询条件,
|
|
||||||
StatisticDefinition statDefinitionMin = new StatisticDefinition(sFieldName, StatisticType.Minimum, "");
|
StatisticDefinition statDefinitionMin = new StatisticDefinition(sFieldName, StatisticType.Minimum, "");
|
||||||
StatisticDefinition statDefinitionMax = new StatisticDefinition(sFieldName, StatisticType.Maximum, "");
|
StatisticDefinition statDefinitionMax = new StatisticDefinition(sFieldName, StatisticType.Maximum, "");
|
||||||
List<StatisticDefinition> statDefinitions = new List<StatisticDefinition>
|
List<StatisticDefinition> statDefinitions = new List<StatisticDefinition>
|
||||||
@ -1469,13 +1474,10 @@ namespace GisDevelop_Exp
|
|||||||
statDefinitionMax,
|
statDefinitionMax,
|
||||||
};
|
};
|
||||||
StatisticsQueryParameters pQueryPara = new StatisticsQueryParameters(statDefinitions);
|
StatisticsQueryParameters pQueryPara = new StatisticsQueryParameters(statDefinitions);
|
||||||
//执行统计查询
|
|
||||||
StatisticsQueryResult queryResult = await pLayer.FeatureTable.QueryStatisticsAsync(pQueryPara);
|
StatisticsQueryResult queryResult = await pLayer.FeatureTable.QueryStatisticsAsync(pQueryPara);
|
||||||
//从统计结果中获取最大值,获取最小值
|
|
||||||
string str;
|
string str;
|
||||||
object max = null, min = null;
|
object max = null, min = null;
|
||||||
double dMax, dMin;
|
double dMax, dMin;
|
||||||
//获取该字段的最大值,最小值,为后续分级做准备
|
|
||||||
IReadOnlyDictionary<string, object> sResult = queryResult.First().Statistics;
|
IReadOnlyDictionary<string, object> sResult = queryResult.First().Statistics;
|
||||||
for (int i = 0; i < sResult.Count; i++)
|
for (int i = 0; i < sResult.Count; i++)
|
||||||
{
|
{
|
||||||
@ -1488,11 +1490,9 @@ namespace GisDevelop_Exp
|
|||||||
|
|
||||||
dMax = (double)(max);
|
dMax = (double)(max);
|
||||||
dMin = (double)(min);
|
dMin = (double)(min);
|
||||||
//计算并设置分级中每一级别的范围,以及符号
|
|
||||||
for (int i = 0; i < ClassifyCount; i++)
|
for (int i = 0; i < ClassifyCount; i++)
|
||||||
{
|
{
|
||||||
ClassBreak pClassBreak = new ClassBreak();
|
ClassBreak pClassBreak = new ClassBreak();
|
||||||
//每一级别范围的最大值、最小值
|
|
||||||
if (i == 0)
|
if (i == 0)
|
||||||
pClassBreak.MinValue = dMin;
|
pClassBreak.MinValue = dMin;
|
||||||
else
|
else
|
||||||
@ -1500,16 +1500,13 @@ namespace GisDevelop_Exp
|
|||||||
;
|
;
|
||||||
pClassBreak.MaxValue = dMin + (dMax - dMin) * (i + 1) / ClassifyCount;
|
pClassBreak.MaxValue = dMin + (dMax - dMin) * (i + 1) / ClassifyCount;
|
||||||
Color tempColor = Color.FromArgb(i * 50 + 10, 255, 255);
|
Color tempColor = Color.FromArgb(i * 50 + 10, 255, 255);
|
||||||
//创建符号,这里图层为面层,直接创建面符号,注意若图层为 点层、线层,需创建对应的点符号、线符号
|
|
||||||
SimpleLineSymbol tempSymbol2 = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Gray,
|
SimpleLineSymbol tempSymbol2 = new SimpleLineSymbol(SimpleLineSymbolStyle.Solid, Color.Gray,
|
||||||
1);
|
1);
|
||||||
Symbol pSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, tempColor, tempSymbol2);
|
Symbol pSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, tempColor, tempSymbol2);
|
||||||
pClassBreak.Symbol = pSymbol;
|
pClassBreak.Symbol = pSymbol;
|
||||||
//将设置好的ClassBreak放入ClassBreaksRenderer中。
|
|
||||||
pCBRenderer.ClassBreaks.Add(pClassBreak);
|
pCBRenderer.ClassBreaks.Add(pClassBreak);
|
||||||
}
|
}
|
||||||
|
|
||||||
//将创建好的ClassBreaksRenderer 赋值给图层
|
|
||||||
pLayer.Renderer = pCBRenderer;
|
pLayer.Renderer = pCBRenderer;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1639,6 +1636,7 @@ namespace GisDevelop_Exp
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
m_CurOper = CURRENTOPERATION.SketchEdit;
|
||||||
BtnCancel.IsEnabled = true;
|
BtnCancel.IsEnabled = true;
|
||||||
BtnRedo.IsEnabled = true;
|
BtnRedo.IsEnabled = true;
|
||||||
BtnUndo.IsEnabled = true;
|
BtnUndo.IsEnabled = true;
|
||||||
|
|||||||
@ -7,7 +7,11 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="符号系统" Height="453" Width="399"
|
Title="符号系统" Height="453" Width="399"
|
||||||
Loaded="Window_Loaded"
|
Loaded="Window_Loaded"
|
||||||
x:Name="Options_Window">
|
x:Name="Options_Window"
|
||||||
|
ResizeMode="NoResize"
|
||||||
|
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||||
|
ui:WindowHelper.UseModernWindowStyle="True"
|
||||||
|
ui:ThemeManager.RequestedTheme="Light">
|
||||||
<Grid Margin="0,0,30,70">
|
<Grid Margin="0,0,30,70">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="726*"/>
|
<ColumnDefinition Width="726*"/>
|
||||||
|
|||||||
@ -6,9 +6,13 @@
|
|||||||
xmlns:local="clr-namespace:GisDevelop_Exp"
|
xmlns:local="clr-namespace:GisDevelop_Exp"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="QueryResultWindow" Height="450" Width="319"
|
Title="QueryResultWindow" Height="450" Width="319"
|
||||||
Loaded="QueryResultWindow_OnLoaded">
|
Loaded="QueryResultWindow_OnLoaded"
|
||||||
|
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||||
|
ResizeMode="NoResize"
|
||||||
|
ui:WindowHelper.UseModernWindowStyle="True"
|
||||||
|
ui:ThemeManager.RequestedTheme="Light">
|
||||||
<Canvas>
|
<Canvas>
|
||||||
<ComboBox x:Name="comboBoxSelectionCount" Canvas.Left="23" Canvas.Top="21" Width="273" HorizontalAlignment="Left" VerticalAlignment="Center" SelectionChanged="ComboBoxSelectionCount_OnSelectionChanged"/>
|
<ComboBox x:Name="comboBoxSelectionCount" Canvas.Left="23" Canvas.Top="21" Width="273" HorizontalAlignment="Left" VerticalAlignment="Center" SelectionChanged="ComboBoxSelectionCount_OnSelectionChanged"/>
|
||||||
<DataGrid x:Name="dataGridResult" Height="356" Width="276" d:ItemsSource="{d:SampleData ItemCount=5}" HorizontalAlignment="Center" Canvas.Top="58" VerticalAlignment="Top" Canvas.Left="20"/>
|
<DataGrid x:Name="dataGridResult" Height="343" Width="276" d:ItemsSource="{d:SampleData ItemCount=5}" HorizontalAlignment="Center" Canvas.Top="71" VerticalAlignment="Top" Canvas.Left="20"/>
|
||||||
</Canvas>
|
</Canvas>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user