How to export web map include graphic layer in ArcGIS 10.1?

8294
22
04-19-2012 08:02 PM
JUNGKEUNLIM
New Contributor
Hello,

Our system environment is as follow;

Server : ArcGIS server 10.1 pre-release
Client : ArcGIS API for Silverlight 3.0 pre-release

I want to export web map include graphic layer, but export web map function does not operate when graphic layer is included.
Tiled map is saved well except graphic layer.

I looked in Fiddler what Web_Map_JSON parameter as follow;

1. Success
http://192.168.104.65:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%...

2. Fail
http://192.168.104.65:6080/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%...
22 Replies
SchoppMatthieu
New Contributor III
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

0 Kudos
SteveLettau
New Contributor
Hi,
Has there been a definitive listing of the limitations of Export Web Map yet?

Specifically, I'm having trouble exporting a map that contains a graphics layer symbolized using a unique value renderer.

I'm getting a similar error: Error executing tool.: Layer "graphicsLayer2": Field 'pointType' not part of schema for this feature collection. Where the field 'pointType' contains the value to be rendered on.

Thanks!
Jill


Jill, did you ever resolve this?  I'm experiencing the same problem.  Steve
0 Kudos
JillianStanford
Occasional Contributor III
Jill, did you ever resolve this?  I'm experiencing the same problem.  Steve


Hi Steve,
Unfortunately, I didn't. Luckily for me, the layer that was giving me problems wasn't actually needed in the print out, so I would remove it from the map, export the map and then add it back in.
Jill
0 Kudos