Select to view content in your preferred language

"unable to export tiles" for Hybrid Reference Layer (for Export)

446
0
06-03-2022 05:50 AM
SokoFromNZ
Regular Contributor

Hello,

I am already successfully exporting World-Imagery via ExportTileCacheTask/Job. Unfortunately it doesn't export the street and city names.

Now I found the "Hybrid Reference Layer (for Export)" (https://www.arcgis.com/home/item.html?id=e7817b59ec4b40e4a1e55241b8695534) which I weirdly not able to export.

Here is the source:

var uri = new Uri("https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_Export_v2/VectorTileServer");
var basemap = new ArcGISVectorTiledLayer(uri);
await basemap.LoadAsync();
try
{
	var exportVectorTilesTask = await ExportVectorTilesTask.CreateAsync(uri, "MY-API-KEY");
	var parameters = new ExportVectorTilesParameters
	{
		AreaOfInterest = new Envelope(6.223174,51.818727,6.283174,51.851728, SpatialReferences.Wgs84),
		MaxLevel = 1,
	};

	var job = exportVectorTilesTask.ExportVectorTiles(parameters, Path.Combine(Environment.ExpandEnvironmentVariables("%userprofile%"), @"Desktop\\ExportTest.vtpk"));
	job.ProgressChanged += OfflineMapJob_ProgressChanged;
	job.Start();
	await job.GetResultAsync();
}
catch (Exception ex)
{
	// fails with
	// ex.Message: Unable to export tiles.
	// ex.Code: 404
	// ex.Response:
    //    StatusCode: 200, ReasonPhrase: 'OK', Version: 1.1, Content: System.Net.Http.ByteArrayContent, Headers:
    //    {
    //      Transfer-Encoding: chunked
    //      Connection: keep-alive
    //      Date: Fri, 03 Jun 2022 12:43:53 GMT
    //      Access-Control-Allow-Origin: *
    //      Vary: Accept-Encoding,Authorization,X-Esri-Authorization
    //      X-XSS-Protection: 1; mode=block
    //      X-Content-Type-Options: nosniff
    //      Strict-Transport-Security: max-age=63072000
    //      X-ArcGIS-Instance-Id: i-0f609041b5a05b360
    //      X-Powered-By: ArcGIS-Online-Hosted-Services
    //      X-Cache: Miss from cloudfront
    //      Via: 1.1 745bd6e0dfe1d054bf9397c4a6fbc612.cloudfront.net (CloudFront)
    //      X-Amz-Cf-Pop: VIE50-P1
    //      X-Amz-Cf-Id: cnl_07OkeX23tz0Qk8GgGfxgHGVEr1XRS6Q9fMyMRAjJGZvEU5suTw==
    //      Content-Type: application/json; charset=utf-8
    //      Content-Length: 159
    //    }, Trailing Headers:
    //    {
    //    }
	throw;
}

 

When I use a different uri which I found this one in a related article (https://services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheBasis/VectorTileServer) the job succeeds. Is it a authorization issue? I have an developer API key and enought tiles left of my quota.

Is there another uri I could use?

All I actually would need offline is the content if BasemapStyle.ArcGISImageryLabels map/layer:

new Esri.ArcGISRuntime.Mapping.Map(new Basemap(BasemapStyle.ArcGISImageryLabels));

 

Tags (3)
0 Replies