I am trying to load a basemap on my GUI. Its the very basic application. My problem is that after I have written the correct code in the .xaml file and the xaml.cs file and built it with no errors, I only get a blank main window. I think that only the .xa

858
4
11-09-2017 09:30 PM
ArvindSingh
New Contributor

I tried with the sample code available in the arcgis runtime sdk guide, even with the exact files available in github I am only getting a blank main window. The map loads in the designer console but not in the GUI. Please tell me what the problem might be. 

0 Kudos
4 Replies
dotMorten_esri
Esri Notable Contributor

To help trouble-shooting could you post the XAML you used, as well as information about which version of the runtime you're using and which platform (WPF/UWP/Xamarin.Android/Xamarin.iOS) etc that you're running on?

0 Kudos
ArvindSingh
New Contributor

I have installed arcgis runtime sdk 100.1.0 over visual studio 2015 in a 32bit PC

The code is taken from one of the samples available on the arcgis developer guide.

XAML:

<UserControl x:Class="ArcGISRuntime.WPF.Samples.DisplayMap.DisplayMap"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<esri:MapView x:Name="MyMapView"/>
</Grid>
</UserControl>

XAML.CS:

using Esri.ArcGISRuntime.Mapping;
using System.IO;

namespace ArcGISRuntime.WPF.Samples.DisplayMap
{
public partial class DisplayMap
{
public DisplayMap()
{
InitializeComponent();

// Create the UI, setup the control references and execute initialization
Initialize();
}

private void Initialize()
{
// Create new Map with basemap
Map myMap = new Map(Basemap.CreateImagery());

// Assign the map to the MapView
MyMapView.Map = myMap;
}
}
One line in my output log saya "Could not open or find PDB file"

for arcgisruntime.dll and Accessibility.dll. I wonder if thst is the real problem.

0 Kudos
dotMorten_esri
Esri Notable Contributor

Code looks ok. You can ignore the PDB warning. 

Did you check the load status of the layer you added? Or try loading it manually which would throw the error instead:

   await myMap.Basemap.BaseLayers[0].LoadAsync()

0 Kudos
ArvindSingh
New Contributor

I did that. I loaded the layer manually. I get this error now: System.Net.Http.HttpRequestException occured in mscorlib.dll. I think it has something to do with my PC not being connected to the internet but I have to work offline unfortunately. Alternatively, can I use a map available on my local machine? or change the IP settings to local..... Please suggest. 

0 Kudos