The following code fails with an exception even though the service states exportTilesAllowed=true.
Exception: "Tile export is not enabled: Vector tile service does not support exporting tiles"
I've included code for loading the basemap using ArcGISVectorTiledLayer which accurately parses the exportTilesAllowed as true. See the screenshot.
var uri = new Uri("https://services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheBasisTerreng/VectorTileServer");
var basemap = new ArcGISVectorTiledLayer(uri);
await basemap.LoadAsync();
try
{
var exportVectorTilesTask = await ExportVectorTilesTask.CreateAsync(uri);
}
catch (Exception e)
{
// fails with: "Tile export is not enabled: Vector tile service does not support exporting tiles"
throw;
}
I've also tested with "https://basemaps.arcgis.com/arcgis/rest/services/World_Basemap_Export_v2/VectorTileServer" which works just fine.
Using ArcGIS Runtime for .NET v100.13 @WinUI 3
Solved! Go to Solution.
Thanks for providing those URLs.
Each vector tile layer has a set of style resources to go with it. You can see those at these URLs:
What's happening is that the style for the GeocacheBasisTerreng layer actually brings a couple more layers into the mix. Here's the style JSON's sources property:
"sources": {
"esri": {
"url": "https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheBasis/VectorTileServer/",
"type": "vector",
"maxzoom": 16,
"tiles": [
"https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheBasis/VectorTileServer/tile/{z}/{y}/{x}.pbf"
]
},
"curves": {
"url": "https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheHoydekurver/VectorTileServer/",
"type": "vector",
"maxzoom": 16,
"tiles": [
"https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheHoydekurver/VectorTileServer/tile/{z}/{y}/{x}.pbf"
]
},
"hillshade": {
"url": "https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheRelieff/VectorTileServer/",
"type": "vector",
"maxzoom": 16,
"tiles": [
"https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheRelieff/VectorTileServer/tile/{z}/{y}/{x}.pbf"
]
}
}
You can see the curves and hillshade layers that exist in addition to that specified in the GeocacheBasis layer.
One of those, GeocacheHoydekurver has this JSON definition which has exportTilesAllowed set to false, which is disabling the overall layer:
You would need to reach out to the service owner to see if they could enable exporting tiles for the GeocacheHoydekurver service.
Hope that helps!
I played some more with different services.
https://services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheBasis/VectorTileServer
The first one is the one that fails. The second one is from the same vendor, same server. It works, and the only difference in the service json document is the service name.
Thanks for providing those URLs.
Each vector tile layer has a set of style resources to go with it. You can see those at these URLs:
What's happening is that the style for the GeocacheBasisTerreng layer actually brings a couple more layers into the mix. Here's the style JSON's sources property:
"sources": {
"esri": {
"url": "https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheBasis/VectorTileServer/",
"type": "vector",
"maxzoom": 16,
"tiles": [
"https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheBasis/VectorTileServer/tile/{z}/{y}/{x}.pbf"
]
},
"curves": {
"url": "https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheHoydekurver/VectorTileServer/",
"type": "vector",
"maxzoom": 16,
"tiles": [
"https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheHoydekurver/VectorTileServer/tile/{z}/{y}/{x}.pbf"
]
},
"hillshade": {
"url": "https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheRelieff/VectorTileServer/",
"type": "vector",
"maxzoom": 16,
"tiles": [
"https://vector.services.geodataonline.no/arcgis/rest/services/GeocacheVector/GeocacheRelieff/VectorTileServer/tile/{z}/{y}/{x}.pbf"
]
}
}
You can see the curves and hillshade layers that exist in addition to that specified in the GeocacheBasis layer.
One of those, GeocacheHoydekurver has this JSON definition which has exportTilesAllowed set to false, which is disabling the overall layer:
You would need to reach out to the service owner to see if they could enable exporting tiles for the GeocacheHoydekurver service.
Hope that helps!
That explains alot. Thank you for your quick response.