Hi fellow enterprise users,
I'm not sure if there is interest in this information but we had some problems printing web maps that contained subtype group layers. Officially these layers are not supported for printing in versions 11.5 and below. However, there is a workaround I wanted to share.
It involves setting up a custom print tool and setting the token on subtype layer as well. In the 11.5 version of the webmap there is no dictionary entry of a token anywhere. Adding this token makes sure the print tool can access the subtype layer.
Some code snippets:
dict_web_map = json.loads(self.web_map_as_json)
for layer in dict_web_map.get("operationalLayers", []):
if "token" in layer:
layer["token"] = self.token
if layer.get("layerType") == "SubtypeGroupLayer":
for sublayer in layer.get("layers", []):
sublayer["token"] = self.token
for table in dict_web_map.get("tables", []):
if "token" in table:
table["token"] = self.token
self.web_map_as_json = json.dumps(dict_web_map)
result = arcpy.server.ExportWebMap(Web_Map_as_JSON=self.web_map_as_json,
Format=self.format_param,
Layout_Template=self.layout_template,
Layout_Item_ID=self.layout_item_id)
return result.getOutput(0)
I can make a more complete guide if there is interest