Select to view content in your preferred language

Title/Subtitle layers Legend widget

1348
4
Jump to solution
01-16-2014 04:51 AM
anne-laurefernet
Deactivated User
Hello,

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?

I attached the example of my legend :

[ATTACH=CONFIG]30566[/ATTACH]

Here is what I would like (example of the legend widget):
http://resources.arcgis.com/en/help/flex-viewer/live/index.html?config=config-all.xml

Does anybody know if it is possible and if yes how?

Thanks in advance,
Anne
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Anne,

   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.

View solution in original post

0 Kudos
4 Replies
RobertScheitlin__GISP
MVP Emeritus
Anne,

   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é.
0 Kudos
anne-laurefernet
Deactivated User
Robert,

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?

Thanks!
Anne
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Anne,

   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.
0 Kudos
anne-laurefernet
Deactivated User
Robert,

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!

Anne
0 Kudos