Good Morning,
I created my runtime content from ArcMap ( xyz.geodatabase ). and try to create a desktop application that show my layers, but is look like the
ArcGISTiledMapServiceLayer is overlapping my layers and I cannot see them. When I comment the ArcGISTiledMapServiceLa, my layers are showing up. I am using the code that is in the sample that comes with ArcGIS Runtime for .NET and is not working either. Any help will be very apreciated.
Below is the code I am using: ( same from example: Feature Layer from Local Database in SRcGisRuntineSDKDotNet_DesktopSample )
<UserControl x:Class="ArcGISRuntimeSDKDotNet_DesktopSamples.Samples.FeatureLayerFromLocalGeodatabase"
xmlns:esri="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013">
<Grid>
<esri:MapView x:Name="MyMapView" WrapAround="True"
Loaded="MyMapView_Loaded" >
<esri:Map>
<esri:ArcGISTiledMapServiceLayer DisplayName="Basemap"
ServiceUri="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" />
</esri:Map>
</esri:MapView>
</Grid>
<UserControl>
namespace ArcGISRuntimeSDKDotNet_DesktopSamples.Samples
{
public partial class FeatureLayerFromLocalGeodatabase : UserControl
{
private const string GDB_PATH = @C:\Data\Data.geodatabase;
public FeatureLayerFromLocalGeodatabase()
{
InitializeComponent();
}
private void MyMapView_Loaded(object sender, RoutedEventArgs e)
{
CreateFeatureLayers();
}
private async void CreateFeatureLayers()
{
try
{
var gdb = await Geodatabase.OpenAsync(GDB_PATH);
Envelope extent = null;
foreach (var table in gdb.FeatureTables)
{
var flayer = new FeatureLayer()
{
ID = table.Name,
DisplayName = table.Name,
FeatureTable = table
};
if (!Geometry.IsNullOrEmpty(table.ServiceInfo.Extent))
{
if (Geometry.IsNullOrEmpty(extent))
extent = table.ServiceInfo.Extent;
else
extent = extent.Union(table.ServiceInfo.Extent);
}
MyMapView.Map.Layers.Add(flayer);
}
await MyMapView.SetViewAsync(extent.Expand(1.10));
}
catch (Exception ex)
{
MessageBox.Show("Error creating feature layer: " + ex.Message, "Samples");
}
}
}
}
Thank you
JoseLuisCorral