How to supply account info when building offline map

Discussion created by educos on Aug 21, 2017
Latest reply on Aug 22, 2017 by akajanus-esristaff


This part of code is what I have written based on the "Create an offline map" Guide:


            Map theMap = new Map(new Uri(_configService.ServerConfiguration.SigMapUrl));
            OfflineMapTask task = await OfflineMapTask.CreateAsync(theMap);
            Envelope areaOfInterest = theMap.Item.Extent;
            GenerateOfflineMapParameters parameters = await task.CreateDefaultGenerateOfflineMapParametersAsync(areaOfInterest);
            parameters.MaxScale = 3000;
            OfflineMapCapabilities results1 = await task.GetOfflineMapCapabilitiesAsync(parameters);
            string pathToOutputPackage = DependencyService.Get<IFileService>().CreateLocalDBFolder(App.CurrentConfigName+"/Sig");
            GenerateOfflineMapJob job = task.GenerateOfflineMap(parameters, pathToOutputPackage);
            GenerateOfflineMapResult results2 = await job.GetResultAsync();
When I run this part of code, a dialog opens in middle of the process that asks to me to give login and password to get acces to tiled basemap.
What sort of code should I add to avoid this dialog opening and to give these information (login and password)  hard-coded in code ?
And I have a second question, concerning this part of code. Downloading the tiles from the server can be a long operation. Is there some ways to have a sort of progress event to give some UI progress on interface (% of downloading for exemple) ?