daffodil41

DynamicLayerRenderer not showing up in legend of Print Task output

Discussion created by daffodil41 on Nov 27, 2012
Latest reply on Jul 18, 2013 by sscialanca-esriitalia-it-esridist
Hello,

I'm having trouble understanding how to get the dynimically rendered layer to show its symbology in the legend when using an "Export Web Map" Print Task. The "Web_Map_As_Json" shows that the layers/layerDefinition/drawinInfo seems to be filled out properly (I believe):

{
   "mapOptions":{
      "extent":{
         "xmin":-16070985.376094976,
         "ymin":2340082.217928768,
         "xmax":-4525936.623905024,
         "ymax":10998868.782071233,
         "spatialReference":{
            "wkid":102100
         }
      },
      "spatialReference":{
         "wkid":102100
      }
   },
   "operationalLayers":[
      {
         "id":"layer0",
         "url":"http://server.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",
         "title":"layer0",
         "opacity":1
      },
      {
         "id":"DynamicLayerRenderer",
         "url":"http://xxxxxxx/xxxxxx/arcgis/rest/services//xxxx/2011Census_CCS/MapServer",
         "title":"DynamicLayerRenderer",
         "opacity":0.7,
         "visibleLayers":[
            6
         ],
         "layers":[
            {
               "id":6,
               "layerDefinition":{
                  "id":6,
                  "source":{
                     "type":"mapLayer",
                     "mapLayerId":6
                  },
                  "drawingInfo":{
                     "renderer":{
                        "type":"classBreaks",
                        "field":"BEE_OT_GALLON_NUM",
                        "minValue":-999,
                        "classBreakInfos":[
                           {
                              "classMaxValue":-999,
                              "label":"-999",
                              "description":"",
                              "symbol":{
                                 "color":[
                                    255,
                                    255,
                                    153,
                                    255
                                 ],
                                 "type":"esriSFS",
                                 "style":"esriSFSSolid"
                              }
                           },
                           {
                              "classMaxValue":1490,
                              "label":"-998 - 1490",
                              "description":"",
                              "symbol":{
                                 "color":[
                                    175,
                                    255,
                                    122,
                                    255
                                 ],
                                 "type":"esriSFS",
                                 "style":"esriSFSSolid"
                              }
                           },
                           {
                              "classMaxValue":4790,
                              "label":"1491 - 4790",
                              "description":"",
                              "symbol":{
                                 "color":[
                                    92,
                                    255,
                                    124,
                                    255
                                 ],
                                 "type":"esriSFS",
                                 "style":"esriSFSSolid"
                              }
                           },
                           {
                              "classMaxValue":8751,
                              "label":"4791 - 8751",
                              "description":"",
                              "symbol":{
                                 "color":[
                                    61,
                                    255,
                                    216,
                                    255
                                 ],
                                 "type":"esriSFS",
                                 "style":"esriSFSSolid"
                              }
                           },
                           {
                              "classMaxValue":17000,
                              "label":"8752 - 17000",
                              "description":"",
                              "symbol":{
                                 "color":[
                                    31,
                                    165,
                                    255,
                                    255
                                 ],
                                 "type":"esriSFS",
                                 "style":"esriSFSSolid"
                              }
                           },
                           {
                              "classMaxValue":103946,
                              "label":"17001 - 103946",
                              "description":"",
                              "symbol":{
                                 "color":[
                                    0,
                                    0,
                                    255,
                                    255
                                 ],
                                 "type":"esriSFS",
                                 "style":"esriSFSSolid"
                              }
                           }
                        ]
                     }
                  }
               }
            }
         ]
      },
      {
         "id":"layer1",
         "url":"http://xxxxxxx/xxxxxxx/arcgis/rest/services//xxxxxx/Reference/MapServer",
         "title":"layer1",
         "opacity":1,
         "visibleLayers":[
            0
         ],
         "layers":[

         ]
      },
      {
         "id":"layer2",
         "url":"http://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",
         "title":"layer2",
         "opacity":1
      }
   ],
   "exportOptions":{
      "outputSize":[
         1180,
         885
      ],
      "dpi":96
   },
   "layoutOptions":{
      "titleText":"<enter title>",
      "authorText":"http://xxxxxxxxx/debug.html",
      "scaleBarOptions":{

      },
      "legendOptions":{
         "operationalLayers":[
            {
               "id":"DynamicLayerRenderer",
               "subLayerIds":[
                  6
               ]
            },
            {
               "id":"layer1",
               "subLayerIds":[
                  0
               ]
            }
         ]
      }
   }
}


However, after the Print Task has produced the ouput (a pdf using a custom layout), the map is rendered fine, the legend does contain the correct operational layers, but renders the default symbology of the dynamic service layer (which is just a simple hollow fill). The Service layer does support dynamic layers.

Does the WebMapJson adequately describe the legend in the legendOptions given the description for the "layers"?

The ExportWebMap Specification doesn't really allow for anything other than strings or numbers for subLayerIds depending on the type of service you're trying to display.

I think I'm missing something basic but can't seem to see it...

Any help or comments would be appreciated,

Michael

Outcomes