What parameters can be used with .../MapServer?f=jsapi to alter the results, like turning on or off a single layer?

Background:

When browsing an ArcGIS REST Services Directory one of the options at a MapServer level is to "view in ArcGIS JavaScript":

http://services.arcgisonline.com/arcgis/rest/services/Specialty/Soil_Survey_Map/MapServer screenshot

This leads to a light-weight web map with minimal chrome, widgets, etc. and no reliance on a 3rd party server like ArcGIS Online to draw the results. It is really handy for having a quick look at the service, with a bonus of having a shareable URL that anyone can see.

http://services.arcgisonline.com/arcgis/rest/services/Specialty/Soil_Survey_Map/MapServer?f=jsapi jsapi map screenshot

The problem, from my present perspective, is that the view is limited to the default definition in the MapServer service definition. In this soil survey example there are 3 layers in the MapServer. What I'd like to be able to do is use the same minimal-chrome webmap to view just one of those layers, not the whole map.

screenshot of desired layer listing

This Soils Survey isn't the best example of my dilemma since the desired layer will draw at the appropriate zoom level. The circumstance which prompted this question is a map service that has layers turned off by default. I can use ArcGIS Online's Use URL parameters to modify maps &layers=show:2,4 to fix that, but that invokes overhead and complexity I'm trying to avoid (using multiple servers and services for mere data viewing).

That is just a basic viewer page to allow you to see the service. It's not meant to be used as an "app" and as far as I know, the ability to pass parameters to that page is not supported.

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

  • Absence of a doc page and public discussion for it says you're right. However there's a world of difference between supported and possible. ;-) I hold hope for the latter... – matt wilkie Oct 1 '17 at 4:53
  • 1
    Matt, no, it's not even "possible" - a quick View Source confirms that. Your solution for using ArcGIS Online URL parameters is probably the easiest solution :) – Bjorn Svensson Oct 2 '17 at 17:31

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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