AnsweredAssumed Answered

Can't Download AGOL Tile Maps

Question asked by tibalesdev on Sep 12, 2016
Latest reply on Sep 13, 2016 by akajanus-esristaff

I am working on an online offline map from  the DotNet tutorial offline map tutorial. Everything works well including the offline rendering from the locally created database. However, when I want to use another tiled base map such as the following

http://tiledbasemaps.arcgis.com/arcgis/rest/services/World_Topo_Map/MapServer I am not able to. I have tried using the credential variable from the IdentityManager class using my organization login and password from bellow documentation but have not had any luck. The credentials are not going through. Help!!!

 

Thanks,

Tom

 

_portal = new ArcGISPortal();

...

 

// use the IdentityManager to authenticate a user for a portal
try
{
    // exception will be thrown here for bad credential ...
    var cred = await Esri.ArcGISRuntime.Security.IdentityManager.Current.GenerateCredentialAsync(
        "http://anorganization.maps.arcgis.com", "myLogin", "myPassword");

 

    // add credential if generation was successful
    Esri.ArcGISRuntime.Security.IdentityManager.Current.AddCredential(cred);
}
catch(ArcGISWebException webExp)
{
    // ... handle exception for bad credential here ...
}

 

// connect to the server (IdentityManager automatically includes the credential if available)
_portal = await Esri.ArcGISRuntime.Portal.ArcGISPortal.CreateAsync(new Uri("http://anorganization.maps.arcgis.com"));
ArcGISPortalUser user = _portal.CurrentUser;
var userName = user.FullName;
var orgName = _portal.ArcGISPortalInfo.Name;

Outcomes