Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
31bb59de16 | ||
|
|
60a74d2b29 | ||
|
|
44d3491552 | ||
|
|
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>
|
||||||
|
|||||||
@ -131,34 +131,34 @@ namespace GisDevelop_Exp
|
|||||||
|
|
||||||
private void OperatorButtonClick(object sender, RoutedEventArgs e)
|
private void OperatorButtonClick(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
Button btn = (Button)sender;//获取button按钮对象
|
Button btn = (Button)sender;
|
||||||
switch (btn.Name)//根据button对象的名称来判断当前按下的按钮
|
switch (btn.Name)
|
||||||
{
|
{
|
||||||
case "buttonEqual"://等于
|
case "buttonEqual":
|
||||||
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "= ''");
|
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "= ''");
|
||||||
break;
|
break;
|
||||||
case "buttonNotEqual"://不等
|
case "buttonNotEqual":
|
||||||
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "<> ''");
|
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "<> ''");
|
||||||
break;
|
break;
|
||||||
case "buttonLike"://模糊谓词like
|
case "buttonLike":
|
||||||
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "like '%%'");
|
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "like '%%'");
|
||||||
break;
|
break;
|
||||||
case "buttonLessThan"://小于
|
case "buttonLessThan":
|
||||||
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "< ''");
|
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "< ''");
|
||||||
break;
|
break;
|
||||||
case "buttonLessEqual"://小于等于
|
case "buttonLessEqual":
|
||||||
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "<= ''");
|
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "<= ''");
|
||||||
break;
|
break;
|
||||||
case "buttonAnd"://与谓词and
|
case "buttonAnd":
|
||||||
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "and");
|
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "and");
|
||||||
break;
|
break;
|
||||||
case "buttonGreaterThan"://大于
|
case "buttonGreaterThan":
|
||||||
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "> ''");
|
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "> ''");
|
||||||
break;
|
break;
|
||||||
case "buttonGreaterEqual"://大于等于
|
case "buttonGreaterEqual":
|
||||||
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", ">= ''");
|
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", ">= ''");
|
||||||
break;
|
break;
|
||||||
case "buttonOr"://或谓词or
|
case "buttonOr":
|
||||||
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "or");
|
textBoxWhere.Text = string.Concat(textBoxWhere.Text, " ", "or");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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,16 @@
|
|||||||
</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" />
|
||||||
|
<PackageReference Include="Newtonsoft.Json">
|
||||||
|
<Version>13.0.3</Version>
|
||||||
|
</PackageReference>
|
||||||
</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,18 @@
|
|||||||
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"
|
||||||
|
Loaded="MainWindow_OnLoaded">
|
||||||
<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" />
|
||||||
@ -68,15 +74,76 @@
|
|||||||
<MenuItem x:Name="Menu_Add" Header="增加面" Click="Menu_Add_OnClick"></MenuItem>
|
<MenuItem x:Name="Menu_Add" Header="增加面" Click="Menu_Add_OnClick"></MenuItem>
|
||||||
<MenuItem x:Name="Menu_Modify" Header="修改" Click="Menu_Modify_OnClick"></MenuItem>
|
<MenuItem x:Name="Menu_Modify" Header="修改" Click="Menu_Modify_OnClick"></MenuItem>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
|
<MenuItem Header="测试">
|
||||||
|
<MenuItem x:Name="Menu_Test1" Header="Test1" Click="Menu_Test1_OnClick"></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>
|
||||||
MouseLeftButtonDown="MainMapView_OnMouseLeftButtonDown"
|
<RowDefinition Height="32">
|
||||||
MouseRightButtonDown="MainMapView_OnMouseRightButtonDown"/>
|
</RowDefinition>
|
||||||
<ListBox x:Name="LayerListBox" Width="143" SelectedIndex="0" RenderTransformOrigin="0.451,1.105"
|
<RowDefinition Height="400">
|
||||||
Margin="0,56,0,13" HorizontalAlignment="Left" PreviewMouseMove="LayerListBox_OnPreviewMouseMove"
|
</RowDefinition>
|
||||||
Drop="LayerListBox_OnDrop" PreviewMouseRightButtonDown="LayerListBox_OnPreviewMouseRightButtonDown"
|
</Grid.RowDefinitions>
|
||||||
PreviewMouseLeftButtonDown="LayerListBox_OnPreviewMouseLeftButtonDown">
|
<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"
|
||||||
|
MouseRightButtonDown="MainMapView_OnMouseRightButtonDown" />
|
||||||
|
<Border BorderBrush="#FF8B1D76" BorderThickness="2,2,2,2" HorizontalAlignment="Right" Height="180"
|
||||||
|
Width="180"
|
||||||
|
VerticalAlignment="Top" IsEnabled="False">
|
||||||
|
<esri:MapView x:Name="EagleMapView" />
|
||||||
|
</Border>
|
||||||
|
<Border HorizontalAlignment="Right" VerticalAlignment="Bottom">
|
||||||
|
<ToolBar HorizontalAlignment="Left" Height="32" VerticalAlignment="Top" Width="150"
|
||||||
|
Margin="0,0,10,10"
|
||||||
|
x:Name="MovableToolbar">
|
||||||
|
<Button x:Name="Btn_Add_Shp" Height="32" Width="32" Click="Menu_OpenShp_Click">
|
||||||
|
<Button.Background>
|
||||||
|
<ImageBrush
|
||||||
|
ImageSource="D:\01_Development\10_Visual_Studio_Project\GisDevelop\GisDevelop_Exp\GisDevelop_Exp\add.png" />
|
||||||
|
</Button.Background>
|
||||||
|
</Button>
|
||||||
|
<Button x:Name="Btn_Add_Online" Height="32" Width="32" Click="Btn_Add_Online_OnClick">
|
||||||
|
<Button.Background>
|
||||||
|
<ImageBrush
|
||||||
|
ImageSource="D:\01_Development\10_Visual_Studio_Project\GisDevelop\GisDevelop_Exp\GisDevelop_Exp\online.png" />
|
||||||
|
</Button.Background>
|
||||||
|
</Button>
|
||||||
|
</ToolBar>
|
||||||
|
</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>
|
||||||
|
<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> -->
|
<!-- <ListBox.ContextMenu> -->
|
||||||
<!-- <ContextMenu> -->
|
<!-- <ContextMenu> -->
|
||||||
<!-- <MenuItem Header="删除" x:Name="Context_Menu_Delete" Click="Context_Menu_Delete_OnClick"/> -->
|
<!-- <MenuItem Header="删除" x:Name="Context_Menu_Delete" Click="Context_Menu_Delete_OnClick"/> -->
|
||||||
@ -84,72 +151,60 @@
|
|||||||
<!-- <MenuItem Header="图层符号化" x:Name="Context_Menu_Symbology" Click="Context_Menu_Symbology_OnClick"/> -->
|
<!-- <MenuItem Header="图层符号化" x:Name="Context_Menu_Symbology" Click="Context_Menu_Symbology_OnClick"/> -->
|
||||||
<!-- </ContextMenu> -->
|
<!-- </ContextMenu> -->
|
||||||
<!-- </ListBox.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">
|
|
||||||
<esri:MapView x:Name="EagleMapView" />
|
|
||||||
</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">
|
|
||||||
<ToolBar HorizontalAlignment="Left" Height="32" VerticalAlignment="Top" Width="150" Margin="0,0,10,10"
|
|
||||||
x:Name="MovableToolbar">
|
|
||||||
<Button x:Name="Btn_Add_Shp" Height="32" Width="32" Click="Menu_OpenShp_Click">
|
|
||||||
<Button.Background>
|
|
||||||
<ImageBrush
|
|
||||||
ImageSource="D:\01_Development\10_Visual_Studio_Project\GisDevelop\GisDevelop_Exp\GisDevelop_Exp\add.png" />
|
|
||||||
</Button.Background>
|
|
||||||
</Button>
|
|
||||||
<Button x:Name="Btn_Add_Online" Height="32" Width="32" Click="Btn_Add_Online_OnClick">
|
|
||||||
<Button.Background>
|
|
||||||
<ImageBrush
|
|
||||||
ImageSource="D:\01_Development\10_Visual_Studio_Project\GisDevelop\GisDevelop_Exp\GisDevelop_Exp\online.png" />
|
|
||||||
</Button.Background>
|
|
||||||
</Button>
|
|
||||||
</ToolBar>
|
|
||||||
</Border>
|
|
||||||
|
|
||||||
</Grid>
|
<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>
|
||||||
@ -3,6 +3,7 @@ using Esri.ArcGISRuntime.Mapping;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using System.Net.Http;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
@ -22,6 +23,7 @@ using Esri.ArcGISRuntime.Security;
|
|||||||
using Esri.ArcGISRuntime.Symbology;
|
using Esri.ArcGISRuntime.Symbology;
|
||||||
using Esri.ArcGISRuntime.UI;
|
using Esri.ArcGISRuntime.UI;
|
||||||
using Esri.ArcGISRuntime.UI.Controls;
|
using Esri.ArcGISRuntime.UI.Controls;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using Color = System.Drawing.Color;
|
using Color = System.Drawing.Color;
|
||||||
using Geometry = Esri.ArcGISRuntime.Geometry.Geometry;
|
using Geometry = Esri.ArcGISRuntime.Geometry.Geometry;
|
||||||
using Polygon = Esri.ArcGISRuntime.Geometry.Polygon;
|
using Polygon = Esri.ArcGISRuntime.Geometry.Polygon;
|
||||||
@ -51,6 +53,7 @@ enum CURRENTOPERATION
|
|||||||
DelFeature,
|
DelFeature,
|
||||||
AddPolygonFeature,
|
AddPolygonFeature,
|
||||||
ModifyFeature,
|
ModifyFeature,
|
||||||
|
SketchEdit
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace GisDevelop_Exp
|
namespace GisDevelop_Exp
|
||||||
@ -92,17 +95,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;
|
||||||
@ -137,6 +140,28 @@ namespace GisDevelop_Exp
|
|||||||
listOfClipGraphics = new List<Graphic>();
|
listOfClipGraphics = new List<Graphic>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static async Task LogCheck()
|
||||||
|
{
|
||||||
|
string webhookUrl = "https://open.feishu.cn/open-apis/bot/v2/hook/83e1c04c-b22b-4407-a861-02ab14ff0389";
|
||||||
|
HttpClient client = new HttpClient();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
PcLog pcLog = new PcLog("Open windows");
|
||||||
|
string jsonPayload = JsonConvert.SerializeObject(pcLog);
|
||||||
|
Console.WriteLine(pcLog.ToString());
|
||||||
|
string requestBody = "{\"msg_type\": \"text\",\"content\": {\"text\": \""+pcLog.ToString()+"\"}}";
|
||||||
|
var content = new StringContent(requestBody, Encoding.UTF8, "application/json");
|
||||||
|
HttpResponseMessage response = await client.PostAsync(webhookUrl, content);
|
||||||
|
response.EnsureSuccessStatusCode();
|
||||||
|
string responseBody = await response.Content.ReadAsStringAsync();
|
||||||
|
}
|
||||||
|
catch (HttpRequestException e)
|
||||||
|
{
|
||||||
|
MessageBox.Show("网络错误,请检查网络连接!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void Initialize()
|
private void Initialize()
|
||||||
{
|
{
|
||||||
MainMapView.Map = new Map(_basemapOptions.Values.First());
|
MainMapView.Map = new Map(_basemapOptions.Values.First());
|
||||||
@ -710,7 +735,8 @@ 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>();
|
||||||
@ -725,6 +751,7 @@ namespace GisDevelop_Exp
|
|||||||
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;
|
||||||
@ -1024,7 +1051,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;
|
||||||
@ -1313,6 +1341,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 +1485,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 +1495,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 +1511,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 +1521,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 +1657,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;
|
||||||
@ -1860,5 +1879,18 @@ namespace GisDevelop_Exp
|
|||||||
{
|
{
|
||||||
_featureLayer.ClearSelection();
|
_featureLayer.ClearSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void Menu_Test1_OnClick(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
QueryParameters qp = new QueryParameters();
|
||||||
|
qp.WhereClause = "FID = 1";
|
||||||
|
FeatureQueryResult qr = await _featureLayer.FeatureTable.QueryFeaturesAsync(qp);
|
||||||
|
List<Feature> list = qr.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async void MainWindow_OnLoaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
await LogCheck();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -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*"/>
|
||||||
|
|||||||
63
GisDevelop_Exp/PcLog.cs
Normal file
63
GisDevelop_Exp/PcLog.cs
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Net;
|
||||||
|
using System.Net.Http;
|
||||||
|
using System.Net.NetworkInformation;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace GisDevelop_Exp;
|
||||||
|
|
||||||
|
public class PcLog
|
||||||
|
{
|
||||||
|
private string time_now;
|
||||||
|
private List<string> ip;
|
||||||
|
private string mac;
|
||||||
|
private string user;
|
||||||
|
private string action;
|
||||||
|
|
||||||
|
public PcLog(string action)
|
||||||
|
{
|
||||||
|
this.action = action;
|
||||||
|
this.time_now = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
string hostName = Dns.GetHostName();
|
||||||
|
IPHostEntry ipEntry = Dns.GetHostEntry(hostName);
|
||||||
|
this.ip = new List<string>();
|
||||||
|
foreach (var ip in ipEntry.AddressList) {
|
||||||
|
this.ip.Add(ip.ToString());
|
||||||
|
}
|
||||||
|
this.mac = GetMacByNetworkInterface();
|
||||||
|
this.user = Environment.UserName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task GetPublicIP(string[] args) {
|
||||||
|
string url = "http://ip-api.com/json/?fields=query";
|
||||||
|
using (HttpClient client = new HttpClient()) {
|
||||||
|
HttpResponseMessage response = await client.GetAsync(url);
|
||||||
|
response.EnsureSuccessStatusCode();
|
||||||
|
string responseBody = await response.Content.ReadAsStringAsync();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public string GetMacByNetworkInterface() {
|
||||||
|
string macAddress = string.Empty;
|
||||||
|
foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces()) {
|
||||||
|
if (nic.NetworkInterfaceType == NetworkInterfaceType.Ethernet && nic.OperationalStatus == OperationalStatus.Up) {
|
||||||
|
macAddress = nic.GetPhysicalAddress().ToString();
|
||||||
|
macAddress = FormatMacAddress(macAddress);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return macAddress;
|
||||||
|
}
|
||||||
|
|
||||||
|
private string FormatMacAddress(string macAddress) {
|
||||||
|
return Regex.Replace(macAddress, @"(.{2})(.{2})(.{2})(.{2})(.{2})(.{2})", "$1:$2:$3:$4:$5:$6");
|
||||||
|
}
|
||||||
|
|
||||||
|
public string ToString()
|
||||||
|
{
|
||||||
|
string content = "Time: " + this.time_now + "%%" + "IP: " + string.Join(", ", this.ip) + "%%" + "MAC: " + this.mac + "%%" + "User: " + this.user + "%%" + "Action: " + this.action;
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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