Select to view content in your preferred language

Create a Legend

2356
7
06-02-2010 01:36 PM
RandyArchibald
New Contributor
I noticed that many of the gallery maps show data in the legend tab.  However none of the maps that I create will display any data in this tab.  What is the process that I need to go through to create one of these legends?
Tags (2)
0 Kudos
7 Replies
MikeMinami
Esri Notable Contributor
Well, a few things could be happening here.

1. Basemaps don't have a legend. So if your map just has a basemap in it, then the legend will be empty.
2. If you've added layers to your map from a local GIS server that is not accessible on the Web (i.e., behind your firewall), ArcGIS.com will not be able to generate a legend from it.

If the above don't apply, perhaps you can share your web map with everyone and provide the URL to it here.

Thanks,

Mike
0 Kudos
KirstinMaxwell
New Contributor
Until my map service is open to the web then I won't be able to view any legend items, is that correct?  Do I have to do something specific when I set up the reverse proxy stuff to enable the legend widget to function correctly?
0 Kudos
MikeMinami
Esri Notable Contributor
Yes, your service has to be accessible outside of your organization.  I am not aware of anything special that needs to be done, as long as the service is publicly available.

Thanks,

Mike
0 Kudos
SargentMcDonald
New Contributor III
On my arcgis.com map the legend won't update to changes in symbology in the map services in IE 7. Also it doesn't update in the ChromeTwoPanel web application I exported.
Legend updates in FF and Chrome browsers. I haven't been able to test IE8 yet. Any ideas why this would be?  It says it is "creating legend" but it just pulls in the old legend.  I would post the link but I had to change the colors back to the original b/c it was live on my site already.
Thanks.
0 Kudos
MikeMinami
Esri Notable Contributor
The legend swatches are images, so I suspect they are getting cached by the browser. Try clearing the browser cache and then refresh the page.

Thanks,

Mike
0 Kudos
SargentMcDonald
New Contributor III
Did that as a first solution already. Also went to a computer that had never even opened the site and it loaded the old legend.
0 Kudos
MikeMinami
Esri Notable Contributor
Sargent McDonald,

There is an issue with IE8 and earlier browsers that forces us to store the legend swatches on our back end servers and provide URLs to them for the IE8 browser to display. These legend swatches are stored permanently until we detect a change in the service. However, we only look for change at the layer level in the service, and we're not actually detecting that legend swatches have changed due to a rendering change (e.g., comparing legend image swatches).

Thus, this is not a client side problem that is fixed by clearing the browser cache and also explains why you saw the "old" legend even when you went to a different computer. This also explains why it works correctly in Firefox and Chrome.

The workaround is to actually make a change at the layer level in your map service that will cause the legend to be regenerated on our back end servers. Here's what you can do:


  1. In ArcMap, change the rendering of the layer you want to change.

  2. Make a change to the list of layers in the map (e.g., change the order of layers, rename a layer, add a temporary layer that you'll remove later).

  3. Update the service running on your GIS server.

  4. In ArcGIS.com map viewer, display the legend, it should now be correct.

  5. In ArcMap, undo any layer change you made (i.e., put the layer order back, remove the temp layer)

  6. Update the service running on your GIS server.

  7. In ArcGIS.com map viewer, display the legend, it should be correct.


Let us know if this works for you,

Thanks,

Mike
0 Kudos