Having Consistency issues creating PictureMarkerSymbols

129
5
04-10-2019 01:55 PM
Highlighted
New Contributor

I am working in a WPF client application with the ArcGISRuntime version of 100.1. currently i am experiencing an issue getting my PictureMarkerSymbol to render consistently when there are more than 5 or 6 items on my map vector tile base map. I am combining it with a text marker symbol, to create a composite symbol on the map, and the test symbol portion will always render. 

I have passed a list of items to this code snippet one at a time to create the symbols. Please let me know if i need to post more code or you have any questions.

public static async Task<Symbol> CreateSymbols(string text, SymbolTypes type, SymbolShapes shape)
{
   var iconPath = string.Empty;
   iconPath = string.Format(@"pack://application:,,,/Images/{0}_{1}.png", type.ToString(), shape.ToString());
   var icon = new Uri(iconPath, UriKind.RelativeOrAbsolute);
   var pc = new PictureMarkerSymbol(icon);
   pc.Width = 30;
   pc.Height = 30;

   var cm = new CompositeSymbol();
   var ts = new TextSymbol()
   {
      Color = Colors.Black,
      FontStyle = FontStyle.Normal,
      FontDecoration = FontDecoration.None,
      FontFamily = "Arial",
      FontWeight = FontWeight.Bold,
      Size = 14,
      VerticalAlignment = VerticalAlignment.Middle,
      HorizontalAlignment = HorizontalAlignment.Center,
      OffsetY = shape == SymbolShapes.Arrow ? 5 : 0
   };

   ts.Text = text;
   cm.Symbols.Add(pc);
   cm.Symbols.Add(ts);

   return await Task.Factory.StartNew<Symbol>(() => { return cm; });
}

Reply
0 Kudos
5 Replies
Highlighted
Esri Frequent Contributor

Are you able to reproduce the issue with v100.5?

Is there a reason for the last line of code and making everything async, rather than just returning the symbol synchronously?

Highlighted
New Contributor

I cannot switch to 100.5, out of my hands in that area. 

i will try to remove the awaiter on the last line to see if that resolves the issue. 

Reply
0 Kudos
Highlighted
Esri Frequent Contributor

> I cannot switch to 100.5, out of my hands in that area. 

Not even temporarily just to see if that resolves the issue? If it does perhaps we can at least track down what version it started working, and it would confirm it's a bug we since fixed.

Reply
0 Kudos
Highlighted
New Contributor

i briefly upgraded to Runtime 100.5 and ran my application. Had the same results, that it inconsistently renders the PictureMarkerSymbol, especially when there are more that 5 or 6 symbols on the base map

Reply
0 Kudos
Highlighted
New Contributor

I also posted on this last year,in this thread. Upon revisiting, I am still in a place of inconsistency. The map refresh process only works about half the time with over 10 icons on the map. I am hoping to link the threads and helpful individuals to get a resolution to this issue. @JenniferNery   

Reply
0 Kudos