Select to view content in your preferred language

Custom renderer with AcceleratedDisplay

2775
4
Jump to solution
04-29-2014 02:14 AM
Labels (1)
MiriRevivo
Deactivated User
Hello,

We've written a simple class that implements the IRenderer interface in order to create a renderer with our own logic.
The symbols the renderer returns are only symbols from within the API (mostly PictureMarkerSymbols).
When we turn the AcceleratedDisplay mode on, this stops working. The question is why? We are not using any WPF-based symbology, and only working within the API. To my understanding this is supposed to work.

What we are doing is, for instance, the very simple following thing:

    public class AdvancedSymbologyRenderer : IRenderer     {         public ESRI.ArcGIS.Client.Symbols.Symbol GetSymbol(Graphic graphic)         {             var symbol = new PictureMarkerSymbol() { Source = new BitmapImage(new Uri(@"C:\Icons\plane.png")) };             return symbol;         }     }


The error we are getting is the "classic" AcceleratedDisplay error, saying that the renderer cannot be serialized to JSON.
This occurrs as an ArgumentException when our renderer is passed to this method - ESRI.ArcGIS.Client.Runtime.NativeGraphicsLayer.UpdateRenderer().

Thanks,
Miri.
0 Kudos
1 Solution

Accepted Solutions
AnttiKajanus1
Deactivated User
Hey Miri,

Unfortunately creating custom Renderers that works with AcceleratedDisplay is not supported. We recommend to use available Renderers in all the cases where you can do that. In cases where you need to handle creating symbols or setting them using a way that are not supported by Renderers, you need to do that directly on graphic / feature level.

View solution in original post

0 Kudos
4 Replies
AnttiKajanus1
Deactivated User
Hey Miri,

Unfortunately creating custom Renderers that works with AcceleratedDisplay is not supported. We recommend to use available Renderers in all the cases where you can do that. In cases where you need to handle creating symbols or setting them using a way that are not supported by Renderers, you need to do that directly on graphic / feature level.
0 Kudos
MiriRevivo
Deactivated User
Hi Antti,

Thanks for your response.
I don't think this limitation is documented, or at least I haven't found it.

We have also tried doing that at the feature level (this is a feature layer). The symbology of the feature layer is taken from the map service of origin, and then we try using the RendererTakesPrecendence property to allow setting symbols manually for each feature, but this property is not honored in the Accelerated Display..
In this scenario, when we switch to the regular mode, the RendererTakesPrecendence property is honored and everything works as expected.

This seems like a bug.
What do you think?

Thanks,
Miri.
0 Kudos
AnttiKajanus1
Deactivated User
Hey,

Did you check Mike's response on this? If you still have that issue, can you send me a repro about that and I could check too.
0 Kudos
MiriRevivo
Deactivated User
Hey Antti,

No, I actually missed it, thanks!
I will check it out and let you know.

Miri.
0 Kudos