Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Anyone know if you can use URL parameters to turn on layers. I have had success using URL parameters to go to specific coordinates.

share|improve this question
    
do you mean adding visible=true to the basemap layer url? or are you talking about something else? –  Brad Nesom May 12 '11 at 13:54
add comment

3 Answers 3

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

share|improve this answer
    
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?? –  Derek May 16 '11 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. –  Derek May 16 '11 at 13:30
    
I use <layer visiblelayer="14,15" label="Layers" type="dynamic" visible="true" alpha=".8" url="xxxxxx/maps/rest/services/operational/MapServer"/>; –  Derek May 17 '11 at 20:21
    
with no luck. 14 is a Group and 15 is a sub-layer within 14. –  Derek May 17 '11 at 20:23
    
was able to get it to work by referencing the Group only. So, thanks very much for your insightful input!!!!!!!!!!!!! –  Derek May 17 '11 at 20:56
add comment

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?

share|improve this answer
add comment

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

share|improve this answer
    
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) –  Derek May 13 '11 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 –  Derek May 13 '11 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. –  Derek May 13 '11 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. –  Derek May 13 '11 at 13:07
    
@Derek I like the look of your widgets. Maybe you wouldn't mind sharing a few? –  Brad Nesom Jan 12 '12 at 23:20
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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