Render a Grid layer

Following is an example of Grid layer:

Post Request

http://<hostname>:<port>/rest/Spatial/MappingService/maps/image.png;w=512;h=512;b=-218.166521,
-81.543143,247.208455,86.200601,EPSG:4326
Authorization: <Basic or Spectrum Token>

Example

{
   "layers":[
      {
         "type":"GridLayer",
         "table":{
            "type":"NamedTable",
            "name":"/Samples/NamedTables/WorldcapTable"
         },
         "style":{
            "type":"GridStyle",
            "inflections":[
               {
                  "color":"blue",
                  "description":"",
                  "value":10000
               },
               {
                  "color":"yellow",
                  "description":"",
                  "value":100000
               },
               {
                  "color":"red",
                  "description":"",
                  "value":200000
               },
               {
                  "color":"green",
                  "description":"",
                  "value":500000
               },
               {
                  "color":"white",
                  "description":"",
                  "value":2000000
               }
            ]
         },
         "cellWidth":{
            "uom":"MILE",
            "value":50
         },
         "valueExpression":"Cap_Pop",
         "spatialExpression":"Obj",
         "interpolator":{
            "type":"IDWInterpolator",
            "aggregationMethod":"AVERAGE",
            "exponent":2,
            "maxPoints":25,
            "searchRadius":100
         },
         "inflectionCollection":{
            "type":"CustomInflectionCollection",
            "roundBy":1,
            "inflectionMethod":"EQUAL_RANGE",
            "inflectionColorBinList":{
               "inflectionColorBin":[
                  {
                     "color":"RED"
                  },
                  {
                     "color":"YELLOW"
                  },
                  {
                     "color":"GREEN"
                  },
                  {
                     "color":"#FFD400"
                  },
                  {
                     "color":"#FFAA00"
                  },
                  {
                     "color":"#FF7F00"
                  },
                  {
                     "color":"#FF5500"
                  },
                  {
                     "color":"#FF2A00"
                  },
                  {
                     "color":"#FF0000"
                  }
               ]
            }
         },
         "gridEnvelope":{
            "crs":{
               "type":"name",
               "properties":{
                  "name":"epsg:4326"
               }
            },
            "bbox":[
               [
                  -218.166521,
                  -81.543143
               ],
               [
                  247.208455,
                  86.200601
               ]
            ]
         }
      }
   ]
}
Note: When inflection collection is specified, and style is not present,the colors are based on inflection collection.

If both inflection collection and style are specified, the style takes precedence.