+ Reply to Thread
Results 1 to 5 of 5

Thread: Programmatically Turning Layers Off/On

  1. #1
    Rich Hammond
    Join Date
    Aug 2010
    Posts
    2
    Points
    0
    Answers Provided
    0


    0

    Default Programmatically Turning Layers Off/On

    We're currently trying to recreate functionality we have in our ArcIMS based mapping application within the ArcGIS Server Flex Viewer. One of the options we currently allow our visitors is to toggle on and off map themes, or predefined groupings of similar layers (i.e. a Recreation theme that will turn on the parks layer, boat ramp layer and trails layer). In ArcIMS we accomplished this through code on the back-end: theme names were passed as a query string in the URL, layers to be turned on and off for each theme were stored in tables within our RDBMS.

    We're just getting our feet wet with the Flex Viewer and really are not sure where to begin to replicate this feature. We sorted through the standard widgets, but didn't come across anything that sounded like it would work. Does anyone have any suggestions or ideas that can get us going with this?

    Thanks in advance,
    Rich Hammond

    GIS Team Leader
    Florida Center for Community Design and Research
    University of South Florida

  2. #2
    Robert Scheitlin

    Join Date
    Mar 2010
    Posts
    9,253
    Points
    5578
    Answers Provided
    938


    0

    Lightbulb Re: Programmatically Turning Layers Off/On

    Rich,

    I think what you are after can be handled with out any code modification. It would require you to have several configuration files and in the FlexViewers url you would just use the appropriate parameter.

    i.e. http://gis.calhouncounty.org/IdentEx...ig-eSearch.xml

    Where ?config=config-eSearch.xml is the specific config file I want to load.

    Now in the config file you can specify a visiblelayers attribute for each mapservice.

    i.e
    Code:
    <layer label="Public Safety" type="dynamic" visible="true" visiblelayers="1,2"
    				   url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_PublicSafety_Louisville/MapServer"/>
    Just because it's not the answer you want, does not mean that it is not the answer.

    Robert Scheitlin

    GIS Manager
    Calhoun County, Alabama


  3. #3
    Nadeem Shaukat
    Join Date
    May 2010
    Posts
    53
    Points
    2
    Answers Provided
    0


    0

    Default Re: Programmatically Turning Layers Off/On

    Quote Originally Posted by rscheitlin View Post
    Rich,

    I think what you are after can be handled with out any code modification. It would require you to have several configuration files and in the FlexViewers url you would just use the appropriate parameter.

    i.e. http://gis.calhouncounty.org/IdentEx...ig-eSearch.xml

    Where ?config=config-eSearch.xml is the specific config file I want to load.

    Now in the config file you can specify a visiblelayers attribute for each mapservice.

    i.e
    Code:
    <layer label="Public Safety" type="dynamic" visible="true" visiblelayers="1,2"
    				   url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Louisville/LOJIC_PublicSafety_Louisville/MapServer"/>
    Robert,

    In your application through the link above, I have noticed that you have an extra combo box for "Search Layer Field:" which is not available in the esearch widget. It seems very useful since it provides the flexibility to search against multiple fields. Could you provide the information about how you have implemented it and the new lines to be added in the xml file. Thanks

    Nadeem

  4. #4
    Nadeem Shaukat
    Join Date
    May 2010
    Posts
    53
    Points
    2
    Answers Provided
    0


    0

    Default Re: Programmatically Turning Layers Off/On

    Quote Originally Posted by nshaukat View Post
    Robert,

    In your application through the link above, I have noticed that you have an extra combo box for "Search Layer Field:" which is not available in the esearch widget. It seems very useful since it provides the flexibility to search against multiple fields. Could you provide the information about how you have implemented it and the new lines to be added in the xml file. Thanks

    Nadeem
    Robert,

    Never mind. I see that it has been implemented in your latest update.

    Nadeem

  5. #5
    Robert Scheitlin

    Join Date
    Mar 2010
    Posts
    9,253
    Points
    5578
    Answers Provided
    938


    0

    Lightbulb Re: Programmatically Turning Layers Off/On

    Nadeem,

    Yep you have to check if you have the latest release very often. Like I am working on the 2.2.5 version right now.
    Just because it's not the answer you want, does not mean that it is not the answer.

    Robert Scheitlin

    GIS Manager
    Calhoun County, Alabama


+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts