Query
The Query widget enables you to query information from a map service, a feature service, or an image service by executing a predefined query. It is performed on a single layer.
Configurable attributes
The following table describes the configurable attributes of the Query widget.
Attribute | Description |
---|---|
queries | Array of query task. Each element has the following child attributes:
|
Example
{
Example:
{
"queries": [
{
"url": "http://sampleserver6.arcgisonline.com/arcgis/rest/services/SampleWorldCities/MapServer/0",
"name": "SampleWorldCities - Cities",
"icon": "",
"filter": {
"logicalOperator": "AND",
"parts": [
{
"fieldObj": {
"name": "POP_CLASS",
"label": "POP_CLASS",
"shortType": "string",
"type": "esriFieldTypeString"
},
"operator": "stringOperatorIs",
"valueObj": {
"isValid": true,
"type": "unique",
"value": "250,000 to 499,999"
},
"interactiveObj": "",
"caseSensitive": false,
"expr": "POP_CLASS = '250,000 to 499,999'"
}
],
"expr": "POP_CLASS = '250,000 to 499,999'"
},
"showSQL": true,
"spatialFilter": {
"currentMapExtent": {
"default": true
},
"drawing": {
"default": false,
"geometryTypes": [
"POINT",
"POLYLINE",
"EXTENT"
],
"buffer": {
"defaultDistance": 100,
"defaultUnit": "MILES"
}
},
"useFeatures": {
"default": false,
"relationships": [
{
"relationship": "SPATIAL_REL_INTERSECTS",
"label": "intersect"
},
{
"relationship": "SPATIAL_REL_WITHIN",
"label": "contain"
},
{
"relationship": "SPATIAL_REL_CONTAINS",
"label": "within"
}
],
"buffer": {
"defaultDistance": 100,
"defaultUnit": "MILES"
}
},
"fullLayerExtent": {
"default": false
}
},
"popupInfo": {
"readFromWebMap": true
},
"orderByFields": [],
"useLayerSymbol": false,
"resultsSymbol": {
"color": [
0,
0,
128,
128
],
"size": 18,
"angle": 0,
"xoffset": 0,
"yoffset": 0,
"type": "esriSMS",
"style": "esriSMSCircle",
"outline": {
"color": [
0,
0,
128,
255
],
"width": 0.75,
"type": "esriSLS",
"style": "esriSLSSolid"
}
},
"keepResultsOnMapAfterCloseWidget": false,
"enableExport": true,
"singleResultLayer": true,
"webMapLayerId": "SampleWorldCities_3008"
}
]
}