AnsweredAssumed Answered

Get properties of layers in a map service

Question asked by json.ajax on Feb 3, 2016
Latest reply on Mar 16, 2016 by kenbuja

My app loads one of map services containing vector and raster layers. When identifying on a map, users expect to see query results from all visible vector layers in a data grid. In my case, all raster layers should be ignored because of no attribute data.

 

So when I looped through all visible layer IDs and run query tasks on each of them, I didn't see any API function or class gave info about the layer properties (such as Geometry Type or Fields, basically whatever returns from hitting a layer url in a browser). Such properties appear only with a query result. Surely a simple xhr request would return all layer info. But that's another series of another roundtrips to the server. Or maybe I missed something hidden deep in API docs.

 

I don't think my use case of identifying all layers is unique or peculiar. What's Esri's arugment for API not exposing or packing the complete layer properites when loading them into the Map instance? However, it already exposes some of properties such as Definition at the service level as an array, and Default Visibility and Max/Min Scale in individual LayerInfos. A bit strange, isn't it?

Outcomes