I am new to Silverlight so please bare with me. I am testing the samples and they are excellent but when i try to in corporate my data i can't seem to get it to work. I am using the sample "Simple" under feature layer because i have some ArcGIS map services. This is my current code, so any help would be great thanks. We currently have some layers in ArcGIS server map services and varified the url and Map layer IDs through ArcGIS Services Directory.
My first guess is that the spatial references of the two services are not compatible.
Can you give more information, like which version of the API are you using, what error messages or behavior are you seeing, and have you added any ArcGIS references to your project?
I have included some code below that I test ran using some Earthquakes as the feature layer. It seems to work fine.
You say you "cant seem to make it work", but what is not working? Don't you get any data? Do you get an error? Do you see the tiled map but not the featurelayer? etc... I'm a really poor guesser when it comes to errors 🙂 I suggest you take a look at what goes on (or goes wrong) under the covers using Fiddler. I discuss this in this blogpost: http://blogs.esri.com/Dev/blogs/silverlightwpf/archive/2009/08/24/Troubleshooting-blank-layers.aspx Rob: Spatial Reference issues only applies to Tiled layers. Featurelayers automatically reproject themselves to the base map, so this should be a non-issue.
SharpGIS i ran fiddler and it seems like i am getting a 404 on my server. So do i need a clientaccesspolicy.xml, so would the policy used by ESRI work for mine?
When i run xaml i don't get 404 error with Fiddler. I am still getting a blank layer. Is the clientaccesspolicy.xm only need for Silverlight and not flex? reason i ask is because i can see the layers in Flex.
Flex uses a crossdomain.xml file, which is basically the same (Silverlight also supports using this file, but prefers the clientaccesspolicy.xml file). What are you getting a 404 on?