Select to view content in your preferred language

10.0 sp1 and Legend Issues

933
4
03-29-2011 08:03 AM
MichaelBlom
Deactivated User
Hi there,

I'm using the standard esri snippet for building my legend:

<esri:Legend x:Name="TheLegend" Width="212" Height="231" Map="{Binding ElementName=Map}" LayerItemsMode="Tree" LayerIDs="Layer1, Layer2, Layer3" ShowOnlyVisibleLayers="False">
                <esri:Legend.MapLayerTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding Label}"/>
                            <Slider Maximum="1" Value="{Binding Layer.Opacity, Mode=TwoWay}" Width="50" />
                        </StackPanel>
                    </DataTemplate>
                </esri:Legend.MapLayerTemplate>
                
                <esri:Legend.LayerTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <TextBlock Text="{Binding Label}"/>
                        </StackPanel>
                    </DataTemplate>
                </esri:Legend.LayerTemplate>
            </esri:Legend>


Looking at fiddler, when the legend attempts to build, it makes a call to a service that ESRI hosts, and this service wants to make a call to my arcgis server, something it won't be able to do due to the fact that my server is not externally facing.

htp://www.arcgis.com/sharing/tools/legend?soapUrl=myservice'sNonRestUrl

{"error":{"code":500,"message":"Unable to generate legends: lonoap05\nUnable to connect to Host: lonoap05...............

So my question is, how do I take advantage of the new Legend Service at 10.0 sp1 so that the call to create the legend doesnt go via ESRI's service? and how do I implement this in my xaml?  It seems that the <esri:Legend.MapLayerTemplate> (from the toolkit) defaults to using the ESRI legend generator service.

Thanks for any help you could provide me, and others I would imagine.

Mike
0 Kudos
4 Replies
DominiqueBroux
Esri Frequent Contributor

how do I take advantage of the new Legend Service at 10.0 sp1 so that the call to create the legend doesnt go via ESRI's service? and how do I implement this in my xaml?

You have nothing to implement. This is done automatically as soon as your service is hosted by ArcGIS server 10SP1.

From your fiddler trace, your server version is prior to 10SP1. Isn't it?
0 Kudos
MichaelBlom
Deactivated User
Thanks very much for your quick reply!

I think you might be onto something.

I ran the two upgrades for sp1:
GISServices and WebApplications

I suspect something happened in the running of these.

One issue could be that our ArcGIS server is installed to the 😧 drive of the machine it's on.

I will check a few things out and update this post.

Mike
0 Kudos
DominiqueBroux
Esri Frequent Contributor
You are welcome.

You can check which server version you are running with a request to your server (e.g. http://services.arcgisonline.com/ArcGIS/rest/services).

The version should be 10.01 for server 10SP1.

Note : if you updated very recently your server, it might be a browser cache issue as well try clearing the cache.
0 Kudos
MichaelBlom
Deactivated User
Okay,
Problem solved.
I did a post install, restarted arcgis server, and now the call to create the legend runs through my arcgis server.

Thanks for your help Dominique.
0 Kudos