Select to view content in your preferred language

Static Image Widget and Legend

844
4
05-11-2011 10:23 AM
RashidMalik1
Emerging Contributor
All:  I am looking for a way to use the static image widget to display a legend.  I know this functionality is available out of the box with the viewer.  However, based on what layer is selected, I want a difference legend to display.  So, for example, if I have list of three different thematic maps, I want a different legend to show up based on what layer is selected.  Any help would be greatly appreciated.   Thanks
Tags (2)
0 Kudos
4 Replies
MehulChoksey
Esri Contributor
Have you tried setting legend url in the config of the ThematicQueryWidget's config?

 <theme labelref="Unemployment" >
       <query layer="4" minscale="0" maxscale="25000001" legendurl="assets/images/Legend_unemp.png" > <!-- layer 4 is a state layer -->
           <listfields>
                <field name="NAME" alias="State" />
                <field name="UNEMPRT_CY" alias="2009 Unemployment (%)" />
.
.
.
0 Kudos
RashidMalik1
Emerging Contributor
Mehul:  Yes I have.  Everything works fine as it should.  However, what I really want to do is use the ThematicQueryWidget to switch the themes and the legends, but when I click on a polygon, it uses the the new PopUps from 2.3.1.   To be precise, I want to use the following operational layers and display once I click on a county polygon per se.  Please let me know if there is a way to do it.  Thanks

<layer label="Demographics" type="tiled" visible="false" alpha="0.5" url="http://server.arcgisonline.com/ArcGIS/rest/services/Demographics/USA_Median_Household_Income/MapServ...">
    <sublayer id="3" popupconfig="popups/PopUp_Demographics_Counties.xml"/>
    </layer>
0 Kudos
MehulChoksey
Esri Contributor
To achieve what you are trying, you will need to know the sublayer for which the popup is rendered.
This information is available in PopUpRendererSkin. You will have to dispatch an event from this skin that thematicQuery Widget would listen to and then based on the mapping of the layer and legend (defined in thematicQueryWidget's config) dispatch event for staticImage widget to show the url.

hope this helps....

Mehul
0 Kudos
RashidMalik1
Emerging Contributor
To achieve what you are trying, you will need to know the sublayer for which the popup is rendered.
This information is available in PopUpRendererSkin. You will have to dispatch an event from this skin that thematicQuery Widget would listen to and then based on the mapping of the layer and legend (defined in thematicQueryWidget's config) dispatch event for staticImage widget to show the url.

hope this helps....

Mehul


Mehul, I am somewhat new to the world of Flex.  Could you be a little bit more explicit?  Thanks
0 Kudos