I have never worked with maps before, and I got assigned on this project with ArcGIS. Noone to ask, cause noone has worked here either so I am turning to you guys. I have to create a tree of checkboxes, and clicking them turns the visibility of the clicked tile on or off. I have managed to find some methods, ArcGISTiledMapServiceLayer and ArcGISDynamicMapServiceLayer. but they don't help me because I cannot give them a link like: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services. but what I need is to take all the folder names from there, enter image description here make them the parents in the tree, then get the services that interest me (in this case there are 3 names in the first folder, don't know which one would be a tile) enter image description here and put them as leaves in the tree. An example of the behavior I need to reproduce is this: enter image description here in the link I pasted, go to BloomfieldHillsMichigan ,then BloomfieldHillsMichigan/Parcels, click on ArcGIS.com Map from the "View In:" secition, then the "Details" tab, then "Content". And there is the checkbox I need to reproduce, and the text is "Parcels". And all of this has to be in a tree structure, with all the folders we had in the folder section. Is there a way I could accomplish this? Thanks

  • 2
    Maybe you could edit your question to simplify it somehow - at first glance it looks overwhelming :) some screenshots would bring value too; maybe step-by-step description of what it is you are trying to achieve. – Alex Tereshenkov Feb 25 '14 at 12:04

What you need to do, is to query your ArcGIS Server REST Endpoint via JSON, and then Parse the Result.

Let us take the example of the ArcGIS Online Sample Server that you are using. You normally use http://sampleserver3.arcgisonline.com/ArcGIS/rest/services as the url in your browser. But if you append an ?f=json at the end of it, the server responds in JSON. Just try this Link: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services?f=json

From the response, you can figure out which folders are present, and build your required folder UI wherever required.

  • I thought of that, but then I thought it should be more like an object that gives me the urls, and I don't have to build them by concatenating strings...Thanks – bokkie Feb 25 '14 at 17:25
  • The urls are pretty simple. You can't nest folders. So it's only one level deep that you need to go to get the map services. And once you have the map service, calling it in json format will give all its layers in one go. – Devdatta Tengshe Feb 25 '14 at 17:50

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.