ArcGIS API for Silverlight/WPF version 2.1 Release Candidate

2472
14
11-04-2010 03:19 PM
DavidAshton
Occasional Contributor III
First please let me say the Legend is awesome!!! You guys Rock!

I have one hopefully small and easy.....///seems stupid question.  If I have a project that was built with 2.0 api and just download the 2.1  Release Candidate  how should I update the Referrences like the ESRI.ARCGIS.CLINT.TOOLKIT ref?  What is the best practice?

Thanks
David
0 Kudos
14 Replies
JenniferNery
Esri Regular Contributor
I believe the install already takes care of updating the assemblies and the registry entries.  What you can do to check if this has been updated by the install - is to look at the Properties Window on the referenced Toolkit assembly.  Go to that path and check file properties if the version changed.  If the path says "Users" then it may not have grabbed from the proper location. Try deleting these references and re-add them again.
0 Kudos
DavidAshton
Occasional Contributor III
Jennifer,
Thanks for the reply.  So I was taking the route of deleting them and adding them again and I ran into this problem:

In my xaml code I created some bookmark links that look like this

<Button Style="{StaticResource MenuItem}" 
                            Content="High Valley" >
                                        <i:Interaction.Triggers>
                                            <i:EventTrigger EventName="Click">
                                                <esri:ZoomToAction TargetName="Map">
                                                    <esri:ZoomToAction.Geometry>
                                                        <esri:Envelope XMin="-117.242692847" YMin="34.103977315" XMax="-116.537719897" YMax="34.795206527" />
                                                    </esri:ZoomToAction.Geometry>
                                                </esri:ZoomToAction>
                                            </i:EventTrigger>
                                        </i:Interaction.Triggers>
                                    </Button>



This code was fine with 2.0 but now with the 2.1 api it is giving me the following error messages:

The value "ZoomToAction" can not be added to a collection or dicitionary of type "TriggerToActionCollection"

and

The attachable property 'Geometry' was not found in the type 'ZoomToAction'.

It is having problems with:

<esri:ZoomToAction TargetName="Map">
                                                    <esri:ZoomToAction.Geometry>
                                                        <esri:Envelope XMin="-117.242692847" YMin="34.103977315" XMax="-116.537719897" YMax="34.795206527" />
                                                    </esri:ZoomToAction.Geometry>
                                                </esri:ZoomToAction>


So I just assumed I didn't covert to 2.1 correctly but maybe I'm missing something else?
0 Kudos
JenniferNery
Esri Regular Contributor
I tried your code with 2.1 RC and I was not able to reproduce the error.

Do you have  ESRI.ArcGIS.Client and ESRI.ArcGIS.Client.Behaviors added to your project references? Can you check the file path where it is pointing to?
0 Kudos
DavidAshton
Occasional Contributor III
Jennifer,

Thanks, I did have an older version of ESRI.ArcGIS.Client.Behaviors and I guess that was causing the problem.

But now I've ran into a new issue.  My code is compliling but I'm getting a warning that is stating:
Invalid CastException was thrown on Legend:
"Unable to cast object of type 'Microsoft.Expression.DesignModel.DocumentModel.DocumentPrimitiveNode' to type 'Microsoft.Expression.DesignModel.DocumentModel.DocumentCompositeNode'.
   at Microsoft.Expression.DesignModel.InstanceBuilders.ArrayInstanceBuilder.InstantiateTargetType(IInstanceBuilderContext context, ViewNode viewNode)
   at Microsoft.Expression.DesignModel.InstanceBuilders.ClrObjectInstanceBuilder.Instantiate(IInstanceBuilderContext context, ViewNode viewNode)
   at Microsoft.Expression.DesignModel.Core.ViewNodeManager.Instantiate(ViewNode viewNode)"


It is happening in my xaml where I'm setting the LayerIDs for the legen



                   <esri:Legend Map="{Binding ElementName=MyMap}"  
                         LayerIDs="TestService"


I think it should be good I'm declaring my service like this:

<esri:ArcGISDynamicMapServiceLayer ID="TestService" Url="http://XXXX.com/ArcGIS/rest/services/TestService/MapServer" Opacity=".5" Initialized="ArcGISDynamicMapServiceLayer_Initialized" />


Any ideas?

Thanks
David
0 Kudos
JenniferNery
Esri Regular Contributor
I know this error, it is annoying 😛

Unfortunately, we have no control over this but we are trying to get some clarification from Microsoft regarding this issue.

The error only appears in Design view. You can still run your application without problem.

If you remove LayerIDs in your Legend, this error will go away.

The only thing I can say is that our team is aware of this Design view error and we too are finding answers about how we can possibly get this issue resolved or atleast workaround so that our users can still see Design view without the annoying error popping up 😛
0 Kudos
CameronBlandy
Occasional Contributor
We are running ArcGIS Server 9.3.1. and we wanted to use the new Legend. In the brief notes for the 2.1 Release Candidate it mentions that we need a Legend Service to create Swatches. It says to get it from ArcGIS.com but I not sure where. Secondly, it says that the Map Service must be public. What exactly does this mean??
0 Kudos
DominiqueBroux
Esri Frequent Contributor

It says to get it from ArcGIS.com but I not sure where.

From ArcGIS Server 10 sp1, map services provide a legend resource to return legend details. With map services prior to this version, the legend control uses a SOAP legend service provided by ArcGIS.com.
You have nothing to do to get it, it's predefined in the legend control : depending on the map service version, the legend is requested on arcgis.com or on the map service itself.

Note that the SDK sample http://help.arcgis.com/en/webapi/silverlight/2.1/samples/start.htm#LegendSimple is using a 9.3.1 dynamic map service (http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty).




Secondly, it says that the Map Service must be public. What exactly does this mean??
It means that, with map services prior to 10SP1, arcgis.com must be able to access to your map service in order to return the swatches. For example, this can't work with a service like http://localhost/arcgis/rest/..... because the arcgis.com soap service can't access to your localhost.
This limitation doesn't exist with 10SP1 map services.
0 Kudos
CameronBlandy
Occasional Contributor
Dominique,

Thanks for the explanation. My only remaining question/comment is, I assume I just logon to arcgis.com and have my service posted/hosted there???

Cameron
0 Kudos
DaveTimmins
Occasional Contributor II
Hi Cameron,

you don't have to post your service / map to arcgis.com unless you want to. That's more related to sharing data that other users will find useful.When Dominique is referring to arcgis.com being able to access the service it just means that the service must be accessible publically. This is because it uses the SOAP endpoint of the service to generate the swatches and therefore needs to be able to interrogate the SOAP endpoint.
0 Kudos