Currently moving from Runtime 10.1.1 to 100.1 ...
10.1.1 Code to load Rest Basemap was...
Dim NewTiledLayer As New ESRI.ArcGIS.Client.ArcGISTiledMapServiceLayer()
With NewTiledLayer
.Url = "https://mapgenie.osi.ie/arcgis/rest/services/WM/basemap_premium/MapServer "
.Token = "abcdefghigh123456789"
End With
MyMap.Layers.Add(NewTiledLayer)
What is the equivalent code in 100.1 ?
In v100.x, you no longer set a Token property. You may set Credential or implement ChallengeHandler.
AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async (info) =>
{
// Option A: Use ChallengeHandler to prompt for login
return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, "username", "password");
});
var layer = new ArcGISMapImageLayer(new Uri("http://sampleserver6.arcgisonline.com/arcgis/rest/services/Wildfire_secure/MapServer"));
// Option B: Set Credential property
layer.Credential = await AuthenticationManager.Current.GenerateCredentialAsync(layer.Source, "user1", "user1");
MyMapView.Map = new Map(new Basemap(layer));