0

https://developers.arcgis.com/javascript/3/jsapi/printtemplate-amd.html#forcefeatureattributes

export map json data

https://developers.arcgis.com/rest/services-reference/exportwebmap-specification.htm

How does force feature attributes work? For example, I am working with that has this json data communicated to the print widget pdf service:

"operationalLayers" : [
 {
  "url" : "<url1>",
  "title" : "<title1>",
  "opacity" : <opacity2>,
  "gdbVersion": "<gdbVersion>",
  "visibleLayers" : [
   <layerId1>,
   <layerId2>
  ],
  "layers" : [
   {
    "id": <sublayerId1>,
    "name": <name>,
    "layerDefinition": {
     "definitionExpression": "<definitionExpression>",
     "layerTimeOptions": {
      "useTime": <true | false>,
      "timeDataCumulative": <true | false>,
      "timeOffset": <timeOffset1>,
      "timeOffsetUnits": "<esriTimeUnits>"
     },
     "drawingInfo": {
      "renderer" : {<renderer>},
      "transparency" : <transparency>,
      "scaleSymbols" : <true | false>,
      "showLabels" : <true | false>,
      "labelingInfo" : {<labelingInfo>},
     },
     "source": {<layerSource>},
     "gdbVersion": "<Geodatabase version name>"
    }
   }
  ]
 }
]

With force attribute checked off in arcgis online

"operationalLayers" : [
 {
  "featureCollection": {
   "layers": [
    {
     "layerDefinition": {
      "name": "<layerName>",
      "geometryType": "<esriGeometryType>",
      "drawingInfo": {<drawingInfo>},
      "objectIdField": "<objectIdFieldName>",  //optional
      "fields": [  //optional
       {
        "name": "<fieldName>",
        "type": "<esriFieldType>",
        "alias": "<fieldAliasName>"
       }
      ]
     },
     "featureSet": {
      "features": [
       {
        "geometry": {<geometry>},
        "attributes": {  //optional
         "<fieldName>": "<value>"
        },
        "symbol": {<symbol>}  //overrides symbol
                                      defined in the renderer
       }
      ]
     }
    }
   ]
  }
 }
]

Eventually, I want to write a python script to pull data from a feature layer using featureCollection or layer definitions to print dynamic text elements and then add it directly on the map print out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.