Select to view content in your preferred language

Query without QueryTask

1589
3
07-12-2014 06:33 AM
BhavinSanghani
Frequent Contributor

Can you query and find features without using QueryTask? e.g. I want to find out features 'WHERE OBJECTID IN (1000, 2000)' but I don't know the layer and geometry. One way to do is fire feature query to all available layers but that would be little heavy when many layers are on the map. Any idea?

0 Kudos
3 Replies
YungKaiChin
Regular Contributor

Use queryDefinition.

0 Kudos
BhavinSanghani
Frequent Contributor

Is queryDefinition a class in ArcGIS JS API? I don't find it. Can you give link related to queryDefinition?

0 Kudos
YungKaiChin
Regular Contributor

Sorry. I mean layerDefinitions

Here is the reference with a short sample of how to use it:

arcgisdynamicmapservicelayer-amd | API Reference | ArcGIS API for JavaScript

var layerDefinitions = [];
layerDefinitions
[0] = "POPULATION > 5000000";
layerDefinitions
[5] = "AREA > 100000";
dynamicMapServiceLayer
.setLayerDefinitions(layerDefinitions);