Select to view content in your preferred language

Another Enhanced TOC/Legend Widget

3932
37
03-28-2011 01:05 AM
ZillaPlace
Emerging Contributor
Hi guys,

I don't like an idea of separating TOC and legend. Maybe I am an old-fashion guy, but I like to have a widget where I could see icons and names, turn on/off layers, tell whether or not a layer is in its display scale range. And it has to handle sublayers because I have a lot of layers with subtypes. It would be cool if I could click a layer and see the layer properties. It doesn't have to show all of them, but just some major pieces. You know, something like the TOC in ArcMap.

And some of my friends are still using 9.3.1 and others have gone to 10. The widget should work for all of them, although I wouldn't mind telling them that it runs faster and more smoothly with 10. The widget should load the legend for a meshup of services hosted on either 10 or 9.3.1.

If you were like me, take a look at this widget. You may like it. It's a beta version developed on FlexViewer 2.2.
Tags (2)
0 Kudos
37 Replies
NathanEnge
Esri Contributor
Plaizilla
Until you decided whether to support WMS, or not...is there a way to turn off the messag boxes when there are WMS layers referenced in the config file?
0 Kudos
ZillaPlace
Emerging Contributor
Plaizilla
Until you decided whether to support WMS, or not...is there a way to turn off the messag boxes when there are WMS layers referenced in the config file?


Hi Nathan,

You could use the excludelayer tag in Legend2Widget.xml to exclude the wms layers from the legend.

<excludelayer>your layer label in [operationallayers]</excludelayer>
0 Kudos
NathanEnge
Esri Contributor
BLASTED!.
Thats the ticket. thanks mate.
0 Kudos
philippschnetzer
Frequent Contributor
The option to disable the 'Layer properties state' would be great.  Although it's a nice feature it is not needed for certain apps.
Thanks.
0 Kudos
LeeAllen
Frequent Contributor
Zilla:

Is there any way that you can add options in the xml to:
1. disable Layer Properties button - my users don't need see this info, and I think it will add confusion
2. disable the filter ability - when using app for very specific tasks, only a few layers are included, so this is not needed.
3. is it possible to exclude multiple layers from the legend? If so, what is the syntax?

Thanks.
0 Kudos
JustinRiggs
Emerging Contributor
Plaizilla,

When I tried to implement your widget I get the following error message:

Failed to load the legend for States
Code: 500
Error: Unable to generate legends: iiakdenipl00120
Unable to connect to Host: iiakdenipl00120 Port: -1
Please verify the Service URL specified is correct :- http://iiakdenipl00120/ArcGIS/services/AMV/States/MapServer

The URL is correct (all the data displays correctly on the map) - do you have any idea what's going on?

Thanks for a great widget, and I'll look forward to hearing your response...

Justin
0 Kudos
ZillaPlace
Emerging Contributor
Plaizilla,

When I tried to implement your widget I get the following error message:

Failed to load the legend for States
Code: 500
Error: Unable to generate legends: iiakdenipl00120
Unable to connect to Host: iiakdenipl00120 Port: -1
Please verify the Service URL specified is correct :- http://iiakdenipl00120/ArcGIS/services/AMV/States/MapServer

The URL is correct (all the data displays correctly on the map) - do you have any idea what's going on?

Thanks for a great widget, and I'll look forward to hearing your response...

Justin


Hi Justin,

Actually the widget depends on a shared tool on arcgis.com/sharing/tools/legend?soapUrl=xxx to generate a legend on 9.3.1. Your service (SOAP) has to be accessible to the public, so the shared tool could generate the legend for your service. It is definitely possible to write a separate tool on my own, but I am not sure if it's worth the effort, since more and more people are moving to 10 (fast). Sorry about that. I posted that limitation a couple of days ago in Code Gallery.

What is your time frame of moving to 10 like?
0 Kudos
ZillaPlace
Emerging Contributor
Hi lallen/philip,

I implemented your suggestion and uploaded the new widget. Please check it out. Thanks for the suggestions!

1. added propertyEnabled in the widget config to show or hide the property buttons
2. added filterEnabled in the widget config to show or hide the keyword filter and collapse/expand all buttons

lallen, you could include multiple excludedLayer tags, one for each layer to be excluded. The syntax is like this:
    <excludelayer>sample_layer1</excludelayer>
    <excludelayer>sample_layer2</excludelayer>
0 Kudos
JustinRiggs
Emerging Contributor
Hi Justin,

Actually the widget depends on a shared tool on arcgis.com/sharing/tools/legend?soapUrl=xxx to generate a legend on 9.3.1. Your service (SOAP) has to be accessible to the public, so the shared tool could generate the legend for your service. It is definitely possible to write a separate tool on my own, but I am not sure if it's worth the effort, since more and more people are moving to 10 (fast). Sorry about that. I posted that limitation a couple of days ago in Code Gallery.

What is your time frame of moving to 10 like?


I'm actually on 10 already. I don't know if my service is available to the public, though. How would I determine that? If I had to take my best guess, I'd guess it's not, as we operate in an environment where internet is not available, only intranet. Thanks for your help, and I'll look forward to hearing back from you...

Justin
0 Kudos
ZillaPlace
Emerging Contributor
I'm actually on 10 already. I don't know if my service is available to the public, though. How would I determine that? If I had to take my best guess, I'd guess it's not, as we operate in an environment where internet is not available, only intranet. Thanks for your help, and I'll look forward to hearing back from you...

Justin


If you are on 10 already, please make sure you apply SP1 to your arcgis server.

iiakdenipl00120 is host name, but unreachable. Check if your server is accessible outside your domain. Usually your server's qualified host name should be something like gis.server.edu.
0 Kudos