How to create render from symbol Stylex

736
5
02-23-2018 04:07 AM
Siva_SankaraReddy_T
New Contributor II

Hi all,

Created Stylx file in ArcGIS Pro. using SymbolStyle API, open the Symbol. But, how to create renderer to add graphicoverlay. please help me.

Tags (1)
0 Kudos
5 Replies
OliverBoesche
New Contributor II

Hi,

this shows the overall topic to your problem in C#. Think that could help.
Display military symbols with a dictionary renderer—ArcGIS Runtime SDK for .NET (WPF) | ArcGIS for D... 

Regards,

Oliver

0 Kudos
Siva_SankaraReddy_T
New Contributor II

Thanks for your reply. i tried following code.

 DictionarySymbolStyle symbolDictionary = await SymbolStyle.OpenAsync(@"D:\ArcGISRuntimeforJava\Test.stylx") as DictionarySymbolStyle;

Not access my stylx file. But it accessing sample mil2525d stylx file. Pls help me.

0 Kudos
OliverBoesche
New Contributor II

Please try to Debug the smybolDictionary after the await. There is an attribute Loaded and Error that normally tells you what is wrong.

0 Kudos
NagmaYasmin
Occasional Contributor III

Hi,

You could use the below code to display .stylx file created from Pro. Attached is the sample application.

string file_to_stylx = parent.FullName + "\\Data\\style.stylx";

symbolStyle = await SymbolStyle.OpenAsync(file_to_stylx);

IList<String> stringList = new List<string>();
stringList.Add("shoppingcenter01");  // key file, you can get this key by opening .stylx file in SQLite database

SimpleRenderer simpleRenderer = new SimpleRenderer(await symbolStyle.GetSymbolAsync(stringList));
newFeatureLayer.Renderer = simpleRenderer;

Hope that helps.

SymbolStyleFromStylx

0 Kudos
Siva_SankaraReddy_T
New Contributor II

Thanks for your help.

0 Kudos