Select to view content in your preferred language

Why is Silverlight Ignoring my Feature Symbol

754
5
04-13-2011 09:37 AM
AaronEdwards1
Emerging Contributor
My application worked perfectly a few months ago.  Since then the client has upgraded to the latest version of ArcGIS Server (10.something, I believe). 

Now, all of a sudden, the map ignores my Feature Symbols and uses instead the symbology associated with the map in Arc, presumably as specified by the REST service.

That would be fine, except I have some cool mouse-over animations that are now being ignored.

Anyone else encounter this?

Thanks.
0 Kudos
5 Replies
DominiqueBroux
Esri Frequent Contributor
You are right. From ArcGIS server 10, the feature layer rest end point provides symbology informations and this info is used as default renderer.

There are 2 possible workarounds:
- on event featurelayer_initialized, you reset the renderer to null so your featuresymbol will be used,
- instead of setting a feature symbol, you can set a 'SimpleRenderer' using that feature symbol. This simple renderer won't be overwritten by the default renderer.
0 Kudos
AaronEdwards1
Emerging Contributor
Great, thank you Dominique. 

I used a renderer with the same symbol, and it worked perfectly.  

Are Symbols specified in Feature Layers depricated now?  The documentation still lists it this way, by the way. 

Thanks again.

Aaron
0 Kudos
AnastasiaAourik
Emerging Contributor
Hi Dominique...

Is there a difference between setting where clause on featurelayer vs running a  querytask...
I think I am a bit stumped. My current querytask returns results that I build in MyGraphicsLayer as RedPushPins.
I have a ArcGISDynamicMapLayer for the layers in this map, plus N feature layers for my OnDemand MapTips; So when user queries, I set visibility of these two items to true, and draw the push pin.
Now, my client would like me to NOT show (all) features, just the query results (using the default msd renderer)...

what is the right way to do this?
0 Kudos
DominiqueBroux
Esri Frequent Contributor

Is there a difference between setting where clause on featurelayer vs running a querytask...


'Globally' one can say that a FeatureLayer is a GraphicsLayer running for you the query task.
But if you look at the details, a featurelayer is much more than that. It adds:
- default symbology
- time extent
- editing capabilities with save option
- querymode (ondemand, selectiononly)
- attribution

 
Now, my client would like me to NOT show (all) features, just the query results (using the default msd renderer)...


In your case, to display a query result with the default symbology, you might use a feature layer in selectinonly mode ant put the graphics coming from your query in this layer in order to take advantage of the automatic symbology (in short, replace your graphicslayer with pushpin symbology by a featurelayer in selectionlonly mode)
0 Kudos
AnastasiaAourik
Emerging Contributor
Thank You for this feedback.
I have solved this problem of wanting to display pushpin and default symbology on
query results as well as preserving the ability to check/uncheck layer visibility
on a layer that may have query results.


http://forums.arcgis.com/threads/38544-Complex-Queries-Client-wants-PushPin-Symbology-and-MSD-symbol...
0 Kudos