Add simple eagle map view
This commit is contained in:
parent
8a7c33489d
commit
e3e0f4364f
@ -18,6 +18,9 @@
|
||||
</MenuItem>
|
||||
<MenuItem x:Name="Menu_View" Header="视图"/>
|
||||
</Menu>
|
||||
<esri:MapView x:Name="MainMapView" Map="{Binding Map, Source={StaticResource MapViewModel}}" Margin="0,19,0,0" />
|
||||
<esri:MapView x:Name="MainMapView" Map="{Binding Map, Source={StaticResource MapViewModel}}" Margin="0,19,0,0" ViewpointChanged="MainMapView_OnViewpointChanged"/>
|
||||
<Border BorderBrush="#FF8B1D76" BorderThickness="2,2,2,2" HorizontalAlignment="Right" Height="180" Width="202" VerticalAlignment="Top" IsEnabled="False">
|
||||
<esri:MapView x:Name="EagleMapView"/>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@ -14,6 +14,9 @@ using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using Esri.ArcGISRuntime.Geometry;
|
||||
using Esri.ArcGISRuntime.Symbology;
|
||||
using Color = System.Drawing.Color;
|
||||
|
||||
namespace GisDevelop_Exp
|
||||
{
|
||||
@ -26,6 +29,7 @@ namespace GisDevelop_Exp
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
EagleMapView.Map = new Map(BasemapStyle.ArcGISImageryStandard);
|
||||
}
|
||||
|
||||
private void Menu_OpenShp_Click(object sender, RoutedEventArgs e)
|
||||
@ -87,5 +91,20 @@ namespace GisDevelop_Exp
|
||||
{
|
||||
OpenGeoDatabase();
|
||||
}
|
||||
|
||||
private void MainMapView_OnViewpointChanged(object? sender, EventArgs e)
|
||||
{
|
||||
EagleMapView.GraphicsOverlays.Clear();
|
||||
Esri.ArcGISRuntime.Geometry.Polygon vExtent = MainMapView.VisibleArea;
|
||||
Envelope eagleViewEnvelop = vExtent.Extent;
|
||||
Color lineColor = Color.FromArgb(255, 255, 0, 0);
|
||||
SimpleLineSymbol lineSymbol = new Esri.ArcGISRuntime.Symbology.SimpleLineSymbol(SimpleLineSymbolStyle.Dash, lineColor,2.0);
|
||||
Color fillColor = Color.FromArgb(0, 0, 0, 0);
|
||||
SimpleFillSymbol fillSymbol = new SimpleFillSymbol(SimpleFillSymbolStyle.Solid, fillColor, lineSymbol);
|
||||
var graphicOverlay = new Esri.ArcGISRuntime.UI.GraphicsOverlay();
|
||||
var envGraphic = new Esri.ArcGISRuntime.UI.Graphic(eagleViewEnvelop, fillSymbol);
|
||||
graphicOverlay.Graphics.Add(envGraphic);
|
||||
EagleMapView.GraphicsOverlays.Add(graphicOverlay);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user