0

Is there a way to query the list of all features service layers and map layers from ArcGIS Server via ArcGIS javascript?

  • There should be a getcapabilities function that list the services and layers present in server. – neogeomat May 18 '18 at 2:08
0

You can access this information via a REST request against the ArcGIS Server API. Something like this:

esriRequest({
  url: serviceUrl,
  content: {
    "f": "json"
  },
  callbackParamName: "callback"
}).then(function(response) {

  // do stuff here

});

Full demo here.

  • Is it possible to drill down to list and sort the feature layers by Geometry Type? i am trying to do a look alike version of Database Connection in Catalog tree of ArcMap into web form? Is there other ways to display? – Faa May 18 '18 at 14:48
  • If you had a developer who knows what they're doing, yes they could make the proper REST calls, using the method I am showing above, to use a Tree widget (like jsTree jstree.com/demo) to build a tree-style control of the services. – GavinR May 18 '18 at 16:33
  • can you show me some examples? – Faa May 20 '18 at 17:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.