Hello,The problem comes from the transparency as you know :"Invalid a value in color: 25500"At some stage, the solution consists in parsing the "webMapAsJson" to modify values, this is an extract that demonstrate how I changed GraphicsLayers's transparency :
import json
jsonMap = json.loads(webMapAsJson) # -- so you can manipulate the json
if jsonMap.has_key("operationalLayers"): # -- to get in the operational layer array :
for operationalLayer in jsonMap["operationalLayers"]: #-- for each operational layer :
if operationalLayer.has_key("featureCollection"): #-- That would be a graphicsLayer
modifyTransparencyInGraphicsLayers(operationalLayer) # -- Send to a function to modify the json (this remove transparency in my case)
outputJson = json.dumps(jsonMap ) # -- then you reencode your jsonMap to json
result = arcpy.mapping.ConvertWebMapToMapDocument(outputJson , templateMxd) # -- Finally you can get back to the method described in the tutorial
def modifyTransparencyInGraphicsLayers(operationalLayer): # -> Modify Tranparency for 'GraphicLayers'
if operationalLayer["featureCollection"].has_key("layers"):
for operationalLayersGraphicsLayerLayer in operationalLayer["featureCollection"]["layers"]:
if operationalLayersGraphicsLayerLayer.has_key("featureSet"):
if operationalLayersGraphicsLayerLayer["featureSet"].has_key("features"):
for graphicsLayerParams in operationalLayersGraphicsLayerLayer["featureSet"]["features"]:
if graphicsLayerParams.has_key("symbol"):
if graphicsLayerParams["symbol"].has_key("color"):
if len(graphicsLayerParams["symbol"]["color"]) == 4:
graphicsLayerParams["symbol"]["color"][3] = 255
if graphicsLayerParams["symbol"].has_key("outline"):
if graphicsLayerParams["symbol"]["outline"].has_key("color"):
if len(graphicsLayerParams["symbol"]["outline"]["color"]) == 4:
graphicsLayerParams["symbol"]["outline"]["color"][3] = 255
return operationalLayer