3.5 Add simple eagle map view
This commit is contained in:
parent
8a7c33489d
commit
cc948d9ce6
@ -18,6 +18,9 @@
|
|||||||
</MenuItem>
|
</MenuItem>
|
||||||
<MenuItem x:Name="Menu_View" Header="视图"/>
|
<MenuItem x:Name="Menu_View" Header="视图"/>
|
||||||
</Menu>
|
</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>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@ -14,6 +14,9 @@ using System.Windows.Media;
|
|||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Navigation;
|
using System.Windows.Navigation;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
|
using Esri.ArcGISRuntime.Geometry;
|
||||||
|
using Esri.ArcGISRuntime.Symbology;
|
||||||
|
using Color = System.Drawing.Color;
|
||||||
|
|
||||||
namespace GisDevelop_Exp
|
namespace GisDevelop_Exp
|
||||||
{
|
{
|
||||||
@ -26,6 +29,7 @@ namespace GisDevelop_Exp
|
|||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
EagleMapView.Map = new Map(BasemapStyle.ArcGISImageryStandard);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Menu_OpenShp_Click(object sender, RoutedEventArgs e)
|
private void Menu_OpenShp_Click(object sender, RoutedEventArgs e)
|
||||||
@ -87,5 +91,20 @@ namespace GisDevelop_Exp
|
|||||||
{
|
{
|
||||||
OpenGeoDatabase();
|
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