Detect if layer contains any data?

318
1
02-08-2012 05:39 AM
RistoAlt
New Contributor
Can anyone say how can I detect if layer contains any data?

There is a list of layer checkboxes next to the map that user can activate/deactivate. The layers are retrieved from third-party map server.
Layers are about distribution. I only want to show layers that contain any data about distribution (not all objects are present on all layers).
Does anyone know how I can do that?

Regards,
Risto
0 Kudos
1 Reply
derekswingley1
Frequent Contributor
Use a queryTask's executeForIds method. If the query comes back with anything, your layer has data.
0 Kudos