AnsweredAssumed Answered

esriRequest with multiple map layers

Question asked by gregb_mcpao on Nov 7, 2019
Latest reply on Nov 13, 2019 by gregb_mcpao

How do I return multiple layers including a map layer that is a definitionExpression when doing an esriRequest?

 

If I request a single map layer that is a definitionExpression, the map layer is returned.

      {
         "id": 1,
            "layerDefinition": {
               "drawingInfo": drawingInfo,
                  "source": {
                     "type": "mapLayer",
                       "mapLayerId": 1
                  },
                  "definitionExpression": "PARID='"+parid+"'"
         }
      }

 

If I request two map layers, one with a definitionExpression, no map layers are returned. 

 

"layers": [  {  "id": 256,

      "layerDefinition": {

            "source": {

                  "type": "mapLayer", "mapLayerId": 256 }
             }
      },

      {
         "id": 1,
            "layerDefinition": {
               "drawingInfo": drawingInfo,
                  "source": {
                     "type": "mapLayer",
                       "mapLayerId": 1
                  },
                  "definitionExpression": "PARID='"+parid+"'"
         }
      }

 

If I request a single map layer that is not a definitionExpression, the map layer is returned.

 

Example of map a single map layer shown in black text and white background

 

Outcomes