Change Character Marker Symbol at runtime with SDK for .Net

4875
7
01-06-2015 03:22 AM
LaurentSIBILLE
New Contributor

Hello,

We are modifying symbology at runtime with the .net SDK for a DynamicLayer using a unique values Symbology. I get informations on the renderer with this code :

Dim layerDescr = DirectCast(layer.Value, FeatureServiceLayerInfo)

Dim renderer = DirectCast(layer.Value.DrawingInfo.Renderer, UniqueValueRenderer)

Dim valueInfo as UniqueValueInfo = renderer.Infos.SingleOrDefault(Function CStr(i.Values(0)) = item.Libelle)

And modify the symbol on the UniqueValueInfo object :

  • valueInfo.Symbol = newSymbol

It works if Simple Marker Symbols  are defined in ArcMap for the symbology, I can change properties (color, style…) and see changes on the map after renderer modification.

But if I define a Character Marker Symbol in ArcMap, the type of the Symbol return by the SDK is PictureMarkerSymbol. So I’am not able to change Font or Text for a symbol. Is this normal ? I was expecting a TextSymbol in place of PictureMarkerSymbol.

Furthermore,  if I create a TextSymbol dynamically and affect it to the renderer the points are not rendered on the map any more, is this type of symbol is supposed to be handled by the .net SDK ?

Thanks for you answer,

Best Regards.

0 Kudos
7 Replies
AnttiKajanus1
Regular Contributor II

Hey,

How are Character Marker Symbol defined in the FeatureService JSON after you publish it?

Text symbols should work, i suppose that you have already checked the sample. Can you create a simple reproducer for me to test the functionality?

0 Kudos
LaurentSIBILLE
New Contributor

Hi,

I checked with JSON format and the symbol is also returned as an image if Character Marker Symbol is defined in ArcMap :

"uniqueValueInfos": [

{

"symbol": {

"type": "esriPMS",

"url": "d171442e3fd737565627f5cfcb68b286",

"imageData": "iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAAXNSR0IB2cksfwAAAAlwSFlzAAAOxAAADsQBlSsOGwAAAJJJREFUGJVtj7EOAVEURI/kyU287ipFlFrFFhqFP/CzGh+g2gQfoFdwuxdmkWhsrDDtmZzMJD6ZmtkQGEjaA2eABPTMbCnpKGkL4O4VMIqIQwJWktZA06oiogbGZrZIZnaR1PCbEzBJOeerpD5w71IzqyTVKSJ27j57a786wC0Bj1KKu/u8S0spz/YFkjaS/syAFwMaQEyBPFrsAAAAAElFTkSuQmCC",

"contentType": "image/png",

"width": 6,

"height": 6,

"angle": 0,

"xoffset": 0,

"yoffset": 0

},

"value": "Armoire EP",

"label": "Armoire EP",

"description": ""

},

For the TextSymbol :

Effectively, I saw the sample using TextSymbol and it works when the TextSymbol is added on the graphicsOverlay but it doesn’t in my case when the TextSymbol replace the symbol in a UniqueValueInfo. I’ll try to create a sample.

0 Kudos
LaurentSIBILLE
New Contributor

Hi,

I made a sample based on ArcGISRuntime.Toolkit.Samples. I changed the Dynamic Legend sample (samples\WinDesktop\ArcGISRuntime.Toolkit.Samples\Legend\LegendByScaleSample.xaml.cs).

In order to reproduce, choose Toolkit / Legend / Dynamic Legend in Menu.

After loading :

If you click  on Change Renderer With SimpleMarkerSymbol, Circle Symbols are replaced with red square Symbols after map refresh.

If you click on Change Renderer with TextSymbol, you can repoduce the issue.

NB : It works when the same TextSymbol is added on GraphicsOverlays after a click on the map.

0 Kudos
LaurentSIBILLE
New Contributor

Hi,

You only answered to one of my questions. Could you please verify the sample about TextSymbol and UniqueValueRenderer that I posted on January the 7th and come back to me ?

Thanks

0 Kudos
dotMorten_esri
Esri Frequent Contributor

The server converts these to picture marker symbol, because there isn't a guarantee the client supports the particular font or style options.

0 Kudos
LaurentSIBILLE
New Contributor

OK, Thanks for your answer.

0 Kudos
LaurentSIBILLE
New Contributor

Hi,

You only answered to one of my questions. Could you please verify the sample about TextSymbol and UniqueValueRenderer that I posted on January the 7th and come back to me ?

Thanks

0 Kudos