I am working with flex 2.5 andI have a question concerning the legend widget.
I realized that I have two titles in the legend : the name of my mapservice and the name of the layer. Can I choose to display only one? Or perhaps rename the layer only in the legend widget?
The Earthquakes layer in the Viewer that you are likely referencing, displays that way because it is added as a type="feature" and not type="dynamic". If you go to the More button and turn on "Data Extract Incidents" you will see more of what your layer looks like. Dynamic type layers will always appear in the Legend with the label that is defined in the main config.xml and then with the sub layer name. This is because dynamic layers can have multiple sub layers. Hope this clears things up for you.
The title of the item in the legend widget is what you have as the label for the layer in the main config.xml and the subtitle is the name of the map services actual featurelayer in the REST service end point. So to not have them both show up as Eligibilité then do not set the layers label in the main config.xml as Eligibilité.
Thanks for the explanation. When I erased the layer label I had at first title "Oplay1" in my legend so apaprently I need a layer label. To show only one title I had to put label="" in my config.xml. Now I only have one title but with a blank space above.
It solves my pb in a way but still does not look like the esri example. [ATTACH=CONFIG]30570[/ATTACH]
Is there something else to do to reach the same legend than the example? Is it because I'm in flex 2.5?
The Earthquakes layer in the Viewer that you are likely referencing, displays that way because it is added as a type="feature" and not type="dynamic". If you go to the More button and turn on "Data Extract Incidents" you will see more of what your layer looks like. Dynamic type layers will always appear in the Legend with the label that is defined in the main config.xml and then with the sub layer name. This is because dynamic layers can have multiple sub layers. Hope this clears things up for you.
Thanks again for the explanation, it made things clear for me now! I tried to put my layer as feature type and indeed I see the difference. Know how to solve this now, thank you very much!