0

Can you use URL parameters in ArcGIS Server 10 Viewer for Flex to turn on layers?

I have had success using URL parameters to go to specific coordinates.

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked May 12, 2011 at 13:06
1
  • do you mean adding visible=true to the basemap layer url? or are you talking about something else? Commented May 12, 2011 at 13:54

3 Answers 3

4

No, the compiled version of ArcGIS Viewer for Flex does not directly support using URL parameters to turn on/off layers.
http://help.arcgis.com/en/webapps/flexviewer/help/index.html#/Viewer_URL_parameters/01m300000029000000/

However, you can use URL parameters to point the application to different configuration files, and inside the configuration files you can specify particular map services, layers, etc. http://help.arcgis.com/en/webapps/flexviewer/help/index.html#/Main_configuration_file/01m300000018000000/

To set the visibility for specific layers within a mapservice (overriding the map service visibilities), use the visiblelayers property on the layer tag. For example:

<layer visiblelayer="0,2" .../>

visiblelayers - Which sublayers to show when the application first opens. The default is as specified on the server. Only applies to dynamic, arcims and wms. For WMS it is required or no sublayers will be shown.

http://help.arcgis.com/en/webapps/flexviewer/help/index.html#//01m30000000p000000.htm

answered May 15, 2011 at 1:17
5
  • Thx for this insight. I know how to specify map services in the main config.xml, but don't see any reference in the documentation as to specifying certain layers?? Commented May 16, 2011 at 13:16
  • When I say Layers I mean specific layers that are controlled through the msd. I want to be able to turn them on or off even if they are not on or off in the msd. Commented May 16, 2011 at 13:30
  • I use <layer visiblelayer="14,15" label="Layers" type="dynamic" visible="true" alpha=".8" url="xxxxxx/maps/rest/services/operational/MapServer"> Commented May 17, 2011 at 20:21
  • with no luck. 14 is a Group and 15 is a sub-layer within 14. Commented May 17, 2011 at 20:23
  • was able to get it to work by referencing the Group only. So, thanks very much for your insightful input!!!!!!!!!!!!! Commented May 17, 2011 at 20:56
0

I think you'd need to add a group layer of lots of layers in the map service, then turn them on and off. However, this approach, I think, means all child layers will be turned on when it is loaded as default?

Dynamic TOC

Using the link above, you could choose to use the TOC or implement the layer changes otherwise. I think this is what you need isn't it?

answered May 12, 2011 at 14:16
0

If so then my layer urls look like this...

<layer label="CRI Wells" type="feature" visible="True"
 info="widgets/InfoTemplates/SimpleInfoWinWidget.swf"
 infoconfig="widgets/InfoTemplates/IWT_Watford_Wells.xml"
 url="http://gismap/ArcGIS/rest/services/CRI_Well/MapServer/0"/> 

Or Maybe this is the answer you are looking for...
flex api 2.3.1

answered May 12, 2011 at 14:47
5
  • We (me the GIS guy and our Web Developer) are trying to use something like index.html?center=-9411560,4766650&level=6 used in fairfield-city.org/maps/gis/… (which takes me to where I want users to see our golf course) Commented May 13, 2011 at 13:06
  • plus I'd like to be able to add something like include:51,52 (like in the REST Export Map functionality) so that they see greens and fairways, which aren't on by default. Basically, I am trying to get away from creating another map service just for this task and others Commented May 13, 2011 at 13:06
  • We are wanting to replace all of our static PDF map images on our non-GIS site with iframes that use the above url (coords changed per task) plus whatever we want them to see that isn't on by default relative to the page's use. Here is a use we are working on for Golf fairfield-city.org/golf/map.cfm. Commented May 13, 2011 at 13:06
  • As you can see by the cluttered window, we'd also like to pass through the url what widgets are used. We're still cleaning it up to make it look pretty too; just a month into using flex viewer. Commented May 13, 2011 at 13:07
  • @Derek I like the look of your widgets. Maybe you wouldn't mind sharing a few? Commented Jan 12, 2012 at 23:20

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.