3.6 Alter basemap
This commit is contained in:
parent
cb87a4a08d
commit
0618695c88
@ -26,5 +26,8 @@
|
|||||||
<Border BorderBrush="#FF8B1D76" BorderThickness="2,2,2,2" HorizontalAlignment="Right" Height="180" Width="202" VerticalAlignment="Top" IsEnabled="False">
|
<Border BorderBrush="#FF8B1D76" BorderThickness="2,2,2,2" HorizontalAlignment="Right" Height="180" Width="202" 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>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@ -32,12 +32,35 @@ namespace GisDevelop_Exp
|
|||||||
private string _statesUrl =
|
private string _statesUrl =
|
||||||
"https://services.arcgis.com/jIL9msH9OI208GCb/arcgis/rest/services/USA_Daytime_Population_2016/FeatureServer/0";
|
"https://services.arcgis.com/jIL9msH9OI208GCb/arcgis/rest/services/USA_Daytime_Population_2016/FeatureServer/0";
|
||||||
private ServiceFeatureTable _featureTable;
|
private ServiceFeatureTable _featureTable;
|
||||||
|
|
||||||
|
private readonly Dictionary<string, Basemap> _basemapOptions = new Dictionary<string, Basemap>()
|
||||||
|
{
|
||||||
|
{ "Streets (Raster)", new Basemap(BasemapStyle.OSMStreets) },
|
||||||
|
{ "Streets (Vector)", new Basemap(BasemapStyle.OSMStreetsRelief) },
|
||||||
|
{ "Streets - Night (Vector)", new Basemap(BasemapStyle.ArcGISStreetsNight) },
|
||||||
|
{ "Imagery (Raster)", new Basemap(BasemapStyle.ArcGISImagery) },
|
||||||
|
{ "Imagery with Labels (Raster)", new Basemap(BasemapStyle.ArcGISImageryLabels) },
|
||||||
|
{ "Imagery with Labels (Vector)", new Basemap(BasemapStyle.ArcGISImageryStandard) },
|
||||||
|
{ "Dark Gray Canvas (Vector)", new Basemap(BasemapStyle.ArcGISDarkGray) },
|
||||||
|
{ "Light Gray Canvas (Raster)", new Basemap(BasemapStyle.ArcGISLightGray) },
|
||||||
|
{ "Light Gray Canvas (Vector)", new Basemap(BasemapStyle.ArcGISLightGrayBase) },
|
||||||
|
{ "Navigation (Vector)", new Basemap(BasemapStyle.ArcGISNavigation) },
|
||||||
|
{ "OpenStreetMap (Raster)", new Basemap(BasemapStyle.OSMNavigation) }
|
||||||
|
};
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
Initialize();
|
||||||
EagleMapView.Map = new Map(BasemapStyle.ArcGISImageryStandard);
|
EagleMapView.Map = new Map(BasemapStyle.ArcGISImageryStandard);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Initialize()
|
||||||
|
{
|
||||||
|
MainMapView.Map = new Map(_basemapOptions.Values.First());
|
||||||
|
BasemapChooser.ItemsSource = _basemapOptions.Keys;
|
||||||
|
BasemapChooser.SelectedIndex = 0;
|
||||||
|
}
|
||||||
|
|
||||||
private void Menu_OpenShp_Click(object sender, RoutedEventArgs e)
|
private void Menu_OpenShp_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
OpenShp();
|
OpenShp();
|
||||||
@ -194,5 +217,11 @@ namespace GisDevelop_Exp
|
|||||||
MainMapView.Map = pMap;
|
MainMapView.Map = pMap;
|
||||||
MainMapView.SelectionProperties.Color = Color.Cyan;
|
MainMapView.SelectionProperties.Color = Color.Cyan;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void BasemapChooser_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
var selectedBasemapTitle = e.AddedItems[0].ToString();
|
||||||
|
MainMapView.Map.Basemap = _basemapOptions[selectedBasemapTitle];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user