Multiple Layers with Binding Parameters
This example of a Mapping Service POST request renders a pie chart layer over a map layer. It shows how to render layers that use a named view with bind parameters.
POST Request
POST http://hostname:port/rest/Spatial/MappingService/maps/image.png;w=800;h=600;c=-101.0,42.0,EPSG:4269;z=3000%20mi
Content-type: application/json
Authorization: Basic or Spectrum Token
Example
{
"name": "MapWithPieLayer",
"layers": [{
"type": "PieLayer",
"depthfactor": "0.50",
"verticalalignment": "MIDDLE",
"wedgerenderdirection": "CLOCKWISE",
"startangle": "180.0",
"horizontalalignment": "CENTER",
"charteffecttype": "AS3D",
"charttype": "FULL",
"diameter": {
"uom": "Inch",
"value": "1.0"
},
"piebasesize": {
"usescale": "true",
"mapscale": "2.28096E7"
},
"opacity": "1.0",
"categories": [{
"expression": "Pop_1994",
"description": "Pop_1994",
"style": {
"type": "NamedStyle",
"name": "/Samples/NamedStyles/AreaStyleBlue"
}
},
{
"expression": "Pop_Male",
"description": "Pop_Male",
"style": {
"type": "NamedStyle",
"name": "/Samples/NamedStyles/AreaStyleGreen"
}
},
{
"expression": "Pop_Fem",
"description": "Pop_Fem",
"style": {
"type": "NamedStyle",
"name": "/Samples/NamedStyles/AreaStyleRed"
}
}
],
"spatialexpression": "Obj",
"table": {
"type": "NamedTable",
"name": "/Samples/NamedTables/NamedViewTable_BindParameter"
},
"parameters": [{
"name": "param",
"value": ["Canada", "United States", "Mexico"],
"type": "String"
}],
"border": {
"type": "NamedStyle",
"name": "/Samples/NamedStyles/LineStyleSolid"
},
"graduation": {
"graduationmethod": "SQUARE_ROOT",
"valueatsize": "250000000"
}
},
{
"type": "NamedLayer",
"name": "/Samples/NamedLayers/WorldFeatureLayer"
}
]
}
Notes
Specify a layer containing the bind parameter as part of the layer element.
The map renders with the parameters defined as part of the request. When no parameters are specified, then the default bind parameters (defined as part of the view table) are used instead.
The syntax to provide the parameters as part of the request applies to all layers. For a group layer, specify the bind parameters at the group layer level not at the individual layer level.