Using the ArcGIS Server JavaScript API, it's possible to specify an attribute query in the form of a layerDefinition against a Dynamic layer.
For example, the following query will restrict the layer to show only features where the population is greater than 5,000,000:
var layerDefinitions = [];
layerDefinitions[0] = "POPULATION > 5000000";
dynamicMapServiceLayer.setLayerDefinitions(layerDefinitions);
Is it possible to specify a bounding box in the layer definition?
That is, apply a spatial query in addition to any attribute query. The query should be based directly on the layer's geometry field (not an attribute derived from the geometry). Assume the data is stored in WGS84 and is "geometryType": "esriGeometryPoint"
.