Select to view content in your preferred language

Feature Layer not displaying in Silverlight

2541
5
07-26-2010 05:38 PM
StephenLead
Honored Contributor
I'm a novice at SilverLight so I'm experimenting with the samples at http://resources.esri.com/help/9.3/arcgisserver/apis/silverlight/help/Creating_featurelayer.htm

This shows how to add a feature layer onto a basemap layer:

<esri:FeatureLayer ID="MyFeatureLayer"
Url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/Map..." >
</esri:FeatureLayer>

http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Specialty/ESRI_StatesCitiesRivers_USA/Map... shows that this featureclass has the spatial reference 4326 and is a dynamic layer (not fused cache).

This sample works fine on my machine in Visual Studio 2008 SP1 with ArcGIS Server 10. The problem comes when I try to substitute my own ArcGIS Server layer.

Using the Services Directory I can see the details of my service:

http://steve-xps/ArcGIS/rest/services/States/MapServer
Layers: States (0)
Spatial Reference: 4326
Single Fused Map Cache: false

The details seem to be identical to the sample ESRI service (although my layer is a polygon), but this layer doesn't show on the map when I run my SilverLight application. I can view this layer in ArcCatalog and there are definitely features there, and they're in the correct geographic position.

In Visual Studio I'm replacing the reference above with:

<esri:FeatureLayer ID="MyFeatureLayer"
Url="http://steve-xps/ArcGIS/rest/services/States/MapServer/0" >
</esri:FeatureLayer>

Any suggestions as to why my layer isn't showing?

Thanks,
Steve
0 Kudos
5 Replies
DominiqueBroux
Esri Frequent Contributor
You need to initialize a feature symbol or a renderer (else the graphics won't be rendered).

As it's a polygon layer, your symbol must be a FillSymbol
0 Kudos
StephenLead
Honored Contributor
Hi Dominique,

Thanks very much for the tip - I should have read the instructions more closely.

Is there a way to display a non-cached layer using the symbology which has already been set in the MXD? The services catalog shows that there is already symbology set for these features:

Drawing Info:
Renderer:
Unique Value Renderer:

Field 1: statecode
Simple Fill Symbol:
Style: esriSFSSolid, Color: [190, 243, 250, 255]

Thanks,
Steve
0 Kudos
DominiqueBroux
Esri Frequent Contributor
If the symbology is set in your feature layer service, the SL API will use it if you don't set manually any other symbology.
In short, come back to your previous version 🙂
0 Kudos
DeepaBalasundaram
New Contributor
In my silverlight application, the feature layer only displays few data items. What should I do to make it display all the data from my map service?

Thanks in advance!
0 Kudos
WilliamDonahue
Emerging Contributor
In my silverlight application, the feature layer only displays few data items. What should I do to make it display all the data from my map service?

Thanks in advance!


I ran into this problem a while ago...

My problem was that the all other values checkbox was not displayed. and then i needed to reset my REST Cache.
0 Kudos