Select to view content in your preferred language

Silverlight Application + Website

902
5
08-03-2010 02:01 PM
AnneReis
Emerging Contributor
To whomever is interested and willing to help:
I'm trying to add a map service from my local campus server to my Silverlight App/Website in Expression Blend 4. I'm able to add in basic ESRI controls via toolkit in Assets and can see these controls in my live website, but my map doesn't show up. Basically, the map is supposed to be a TiledMapServiceLayer. I've tried deleting the arcgis online server and adding my campus server, but that doesn't seem to work. Anyone have a clue what might be happening. Do I need to bind the map? I'm still working in 9.3.1 ArcInfo and 9.3.1 ArcServer. Could this be the problem?
Thanks for any help,
Anne
0 Kudos
5 Replies
TonyAlmeida
MVP Regular Contributor
My first guess would be spatial reference, but you should probably post your code so we can see what's going on.
0 Kudos
AnneReis
Emerging Contributor
Thanks for replying, Akilly. I'm very new to this and am learning Silverlight (Expression Blend). Which portion of the code? This portion:

<Grid x:Name="LayoutRoot" Background="White">
  <esri:Map x:Name="map" Background="White" Margin="8,137,8,8" IsLogoVisible="False" ToolTipService.ToolTip="{Binding ElementName=LayoutRoot}">
   <esri:ArcGISTiledMapServiceLayer ID="SustainMapService" Url="http://webgis/ArcGISUWM/rest/services/SustainMap/MapServer"/>
  </esri:Map>

Also, do you know of any good resources (books/online) for learning the ArcGIS API for Silverlight?

Many thanks!
0 Kudos
JenniferNery
Esri Regular Contributor
Which version of API for SL/WPF are you using?
You can learn more about v2.0 from here (see Concepts tab also)
http://help.arcgis.com/en/webapi/silverlight/samples/start.htm

In the code you provided, I don't think you need to have your tooltip bound to the grid. Are you able to go to your map layer's URL through IE? At minimum, I think the following code should be sufficient to display your map.
<Grid x:Name="LayoutRoot" Background="White">
 <esri:Map x:Name="map">
  <esri:ArcGISTiledMapServiceLayer ID="SustainMapService" Url="http://webgis/ArcGISUWM/rest/services/SustainMap/MapServer"/>
 </esri:Map>
</Grid>


Jennifer
0 Kudos
PaulLeedham
Deactivated User
Make sure you have a cross domain policy file located on your Campus ArcGIS Server machine.  If this is not present your Silverlight application will not be able to communicate with your server to display your map services.
Here is a link explaining the reasons for doing so: http://blogs.esri.com/Dev/blogs/arcobjectsdevelopment/archive/2009/09/10/ArcGIS-Developers_3A00_-Tip...

Thanks,

Paul Leedham
City of Hudson
http://gis.hudson.oh.us/
0 Kudos
MartenLiebster
Deactivated User
Make sure you have a cross domain policy file located on your Campus ArcGIS Server machine.  If this is not present your Silverlight application will not be able to communicate with your server to display your map services.
Here is a link explaining the reasons for doing so: http://blogs.esri.com/Dev/blogs/arcobjectsdevelopment/archive/2009/09/10/ArcGIS-Developers_3A00_-Tip...

Thanks,

Paul Leedham
City of Hudson
http://gis.hudson.oh.us/


What has helped me a lot in detecting this issue (as well as many others), and I consider it an essential tool, is Fiddler2.

If this is the problem, you'll see a failed attempt to retrieve the clientaccesspolicy.xml and crossdomain.xml files from the remote server.

http://www.fiddler2.com/fiddler2/

And if you're using binary WCF RIA, there here's a plugin to help (the bottom of the page has the link):
http://blogs.msdn.com/b/silverlightws/archive/2010/05/10/fiddler-inspector-for-wcf-silverlight-polli...
0 Kudos