Select to view content in your preferred language

Export styled map image using REST APIs

40
0
yesterday
Labels (1)
IvanCotti
New Contributor

I created a style which uses the OSM v2 vector tile service as url (link).

I'm using ArcGIS in Unreal Engine and my goal is to export an image of a small region of the map to use it in a widget.

I've not seen any way to do so with a vector tile service unlike MapService which does have an export map option.

Right now i'm looking at export web map task (link) which should support vector tile layers, but i've not been able to get it to work.

This is my request (using this page😞

{
   "mapOptions":{
      "extent":{
         "xmin":-74.2841,
         "ymin":40.5096,
         "xmax":-73.8068,
         "ymax":40.8947,
         "spatialReference":{
            "wkid":4326
         }
      },
      "spatialReference":{
         "wkid":4326
      }
   },
   "operationalLayers":[
      {
         "url":"https://services.arcgisonline.com/arcgis/rest/services/World_Street_Map/MapServer"
      }
   ],
   "baseMap":[
      {
         "title":"VectorTileLayer as BaseMap",
         "baseMapLayers":[
            {
               "type":"VectorTileLayer",
               "layerType":"VectorTileLayer",
               "title":"World_Basemap",
               "styleUrl":"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/a4173e7071f7463594d2b3bc585cf978?type=style",
               "visibility":true,
               "opacity":1
            }
         ]
      }
   ],
   "exportOptions":{
      "dpi":300,
      "outputSize":[
         1000,
         1000
      ]
   },
   "layoutOptions":{
      
   },
   "reportOptions":{
      
   }
}

Using a MapServer works, but again it's unstyled:

IvanCotti_0-1718627548780.png

I tried to use the VectorTileServer instead, replacing it with:

"url": "https://basemaps-api.arcgis.com/arcgis/rest/services/OpenStreetMap_v2/VectorTileServer"

 But that gives me an error instead. Adding the token to the url, or as an added parameter, did not help.

Omitting the operational layers completely led to a white image instead.

 

Is there a way to export a styled image of a given map region?

Thank you in advance.

0 Kudos
0 Replies