Hello,
At the Developer Summit this year, I saw that you should now be able to take the ArcGIS Online Basemaps (such as the World Street Map), and export an area of interest to a tile cache that an application can use offline. Does anyone know where I would find this information?
Thanks,
Jen
From ArcGIS Runtime SDK for .NET perspective, if you are using Update 1, you can use OfflineMapTask to generate offline map from map created from portal item with basemap using the following code. Be sure to provide your ArcGIS.com credentials. If you are using v100 or v10.2.x, you can use ExportTileCacheTask (see this post). Both ways will create tpk file at the specified location.
public MainWindow()
{
InitializeComponent();
AuthenticationManager.Current.ChallengeHandler = new ChallengeHandler(async(info) =>
{
return await AuthenticationManager.Current.GenerateCredentialAsync(info.ServiceUri, "username", "password");
});
MyMapView.Map = new Map(new Uri("http://www.arcgis.com/home/item.html?id=48b8cec7ebf04b5fbdcaf70d09daff21"));
MyMapView.Map.InitialViewpoint = new Viewpoint(new Envelope(-13640236.783971909, 4543994.3422454093, -13619727.139469307, 4555760.1893863911, SpatialReferences.WebMercator));
}
private async void OnTakeOffline(object sender, RoutedEventArgs e)
{
try
{
var path = Path.Combine(Path.GetTempPath(), "OfflineMap");
if(Directory.Exists(path))
{
var mmpk = await MobileMapPackage.OpenAsync(path);
MyMapView.Map = mmpk.Maps.FirstOrDefault();
return;
}
Directory.CreateDirectory(path);
var task = await OfflineMapTask.CreateAsync(MyMapView.Map);
var areaOfInterest = MyMapView.GetCurrentViewpoint(ViewpointType.BoundingGeometry).TargetGeometry;
var parameters = await task.CreateDefaultGenerateOfflineMapParametersAsync(areaOfInterest);
var job = task.GenerateOfflineMap(parameters, path);
var result =await job.GetResultAsync();
MyMapView.Map = result.OfflineMap;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}