Can't Download AGOL Tile Maps

924
1
09-12-2016 01:37 PM
thomasbales
Occasional Contributor

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;

0 Kudos
1 Reply
AnttiKajanus1
Occasional Contributor III

If I understood correctly, you get signed in ok to the portal that you are using and get portal and user information but when you try to create the offline export, it gives an error?

0 Kudos